May 29, 2024, 09:42:33 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Tablets Database

Started by Brian, January 13, 2024, 11:20:28 AM

Previous topic - Next topic

Brian and 1 Guest are viewing this topic.

Brian

Hi,

I have two or three prescriptions, and they all run out on different dates, and need renewing at different times. This program is to help me keep track of when to re-order

I've been working on this program on and off for quite a few days, and with Bill H's valuable help have overcome some of the trickier SQL problems

Full source code included, with exe. It is a Project. To start your own database, rather than the test data, just delete 'Tablets.mdb' from the \data folder, and run the program again, and a new, empty MDB will be created

Any comments or suggestions welcomed

Brian

Brian

January 15, 2024, 10:48:23 AM #1 Last Edit: January 17, 2024, 04:09:52 AM by Brian
Hello,

Because you never know how a program really works until you start using it in earnest, I found some changes I had to do. I was trying to enter a Dosage value of 2.5, and as I had set the edit control to numbers only, it wouldn't take the value

So the Dosage edit control is now sub-classed to accept numbers and a full stop only (plus backspace)
All the listview columns are now sortable
There is a check on startup to make sure the \backup folder is really there, and creates one if not
The database now starts with an ORDER BY clause on the Reorder column, so it shows the first to renew at the top of the list
Put a static control on the screen to show how many days were allocated before a renewal date shows in red

Think that's it, but you will have to delete your Tablets.mdb and generate a new one, as the format for the database is now different

Included the source file and a compiled exe

Brian

LarryMc

Quote from: Brian on January 13, 2024, 11:20:28 AMI have two or three prescriptions
You wrote a program to keep track of 2 or 3? LOL

Then I need an accounting firm to keep track of my 18 0r 19!!! LOL
In reality, the pharmacy is quick to call me when it is time for a refill because if I miss one , with all my meds, they will have to lay someone off.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

Larry,

I was being a bit conservative when I said 2 or 3 - I didn't want Forum members to think I was a pill junky! Actually, I have 7 or 8 different ones to take. I have no problem remembering what and when to take, this just helps me to remember when to re-order. And it seems to be working well, and was nice to program something practical for once

And I had a feeling you might might be taking more than me!

Brian

billhsln

14 prescribed (1 of those is when needed) and 3 over the counter.

My pharmacy also lets me know when I need to renew.  Of course, every once in a while, I forget to either take my morning pills or evening, so that throws off my numbers.  I do one of those tablet holders that does an entire week at once with morning and evening spots.

My pharmacy lets me know how much the drugs cost and what I paid for them, so I wrote a program to track their price and what I paid, but not near as polished as Brian's program.

But I am doing ok and still using IWB daily.  I do lots of ODBC connection into an AS400 using SQL which is sitting at my work over 87 miles from where I live.

Bill
When all else fails, get a bigger hammer.

Brian

January 22, 2024, 06:56:45 AM #5 Last Edit: January 24, 2024, 06:26:07 AM by Brian
Hello,

Done a bit of work on this program. It now sorts correctly, putting the first-to-renew prescriptions to the top. I did this with a hidden ISO date field, and sorting on that, so the structure of the MDB has changed from the other versions

I also took out a couple of sub-routines that were not needed at all. I pinched them from some other program I had that did need them, but not this one

There is also a print routine added to print a list of your prescriptions, using DDoc

All the icons and images, etc, that are needed for the program to compile are now in the 'resources' folder. The main MDB file and help file are now in the program folder

Pre-uploaded programs have been removed from the Forum, and are replaced with this version, now 1.3

Brian

Brian

Hi,

Slight adjustment to how the program is calculating the re-ordering of a prescription. Noticed that some re-order dates weren't being changed to red in the Listview. This one-line change does the trick. You will have to re-compile, though

Brian

Brian

February 19, 2024, 07:45:18 AM #7 Last Edit: March 01, 2024, 04:18:42 AM by Brian
Well, you never know how a program is going to behave until you start using it . . .

After having a couple of Repeat Prescriptions to enter, I realised that the In Stock value was just going up and up. This version now updates the In Stock total, and then calculates how many tablets/pills have been taken from the Started Course date and the day you entered the Repeat amount, and deducts that from the In Stock total. It then resets the Started Course to your Repeat entry date

I have also set up a Repeat Prescription Form in the style that our GPs require. Okay for me, but could require some fiddling from your end. Just Ctrl-click the items that you want to order, and press Ctrl+F

The font I used to simulate handwriting is Nanum Pen, and can be downloaded freely from:
https://fonts.google.com/specimen/Nanum+Pen+Script?query=nanum

You will have to alter your Name to suit in the PrintForm() sub-routine, at Line 1299, and also the three address lines at Lines 1312, 1315 and 1317. And don't forget your Date of Birth at Line 1339 - and then re-compile

For my signature, I used a blue Biro, and scanned it in, and saved as a 24-bit bitmap with a size of 400 x 192. Saving as 8-bit would have meant a smaller file size, but 24-bit gave a more realistic colour

Removed all the previous uploads

Brian

Edit: Just realised you will need my updated ddoc.inc

Edit 1/3/2024: Important small update to Tablets.iwb

Brian

Updated Tablets.iwb uploaded in the previous post

Brian

Brian

Hi,

If anyone is using this program, there is an important, but small, update for the program:

In the EditUpdate() sub, change this line:

InStock-=iVar
to
InStock-=iVar*PerDay

and then re-compile. It was wrongly calculating how many tablets there were left when adding a repeat Prescription to the database. I knew something was wrong, but I couldn't figure out where

Brian

Brian

Hi,

While using this program, I noticed that if you failed to fill in a required Prescription entry, the program fell over. It now checks all the edit boxes, and if one is empty (or more) the program beeps and highlights the offending edit box in red, and changes to the default colour when you click in it to enter data

This program also fixes an error when updating a Prescription, where if you took more than one tablet per day, it wasn't calculating the RunsOut and OrderBy dates correctly

Everything included in the zip, and includes the exe

Brian

Brian

Here's the lib and inc files for DDoc, if you need them, for the above program

Brian