October 09, 2024, 04:06:02 PM

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

0 Members 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: June 11, 2024, 04:47:56 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

May 23, 2024, 04:43:36 AM #10 Last Edit: June 11, 2024, 04:48:19 AM by 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 back 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

May 23, 2024, 11:35:13 AM #11 Last Edit: June 11, 2024, 04:48:32 AM by Brian
Here's the lib and inc files for DDoc, if you need them, for the above program

Brian

Brian

May 29, 2024, 11:44:25 AM #12 Last Edit: June 11, 2024, 04:49:10 AM by Brian
Hi,

For those of you who want to take advantage of the Print Form feature, I have modified the Preferences dialog for you to add your Name, Address and DoB. This means you don't have to re-compile the program in any way

There is also an updated CHM and ini file. This zip contains the exe, source, help file and ini only

Brian

Brian

June 11, 2024, 04:55:23 AM #13 Last Edit: June 11, 2024, 10:26:33 AM by Brian
I have realised when you used the 'Print All' menu option that it could do with a bit more detail, so I have added an extra edit field for you to type in medication instructions, such as 'Take 1 a day, with food' or 'Take 1, twice a day' or 'Take 1 at night, with water' etc

Because I have added an extra field onto the MDB, you will have to re-enter your data into the program, but it will be most unlikely that there will be hundreds of lines to alter!

All you need in the zip. I have deleted all previous uploads of the program

Brian

LarryMc

on the list of meds that I take to all my visits to Dr's offices, hospitals, ERs, etc there is a column that list the reason I take the med(was prescribed it)
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

I'll take a look at that, Larry - thanks for responding

Brian

Brian

June 13, 2024, 07:59:16 AM #16 Last Edit: July 01, 2024, 03:35:58 AM by Brian
In response to Larry's suggestion about having an extra field to state why a particular medication was prescribed when you printed a list of meds, here's a little fix. As before, if you have already got a database set up, you will have to re-input the data

I have also adjusted the DDoc print routines to print Letter paper size if you are in the US or Canada, and as A4 for other countries

Note that I have changed the 'Print All' menu option to 'Print Listing' and modified the help file

Re-uploaded today . . .

BrianNo message is associated with this attachment.

Brian

August 28, 2024, 09:35:15 AM #17 Last Edit: August 28, 2024, 09:49:18 AM by Brian
I have had a niggling error in my Tablets program when updating a prescription, and the other day a light went on, and I found it, so new version - 1.5

Changes:
Version now 1.5
Font when printing a prescription form is now 'Handlee' - the NanumPen font was a bit untidy with some characters. The font file is in the 'resources' folder
The Listbox is now clickable, and does the same function as double-clicking a line in the Listview. I also managed to get rid of an annoying flickering when selecting a line in the Listbox
Edited the help file
Various cosmetic changes

All you need in the zip file

Brian

Brian

Found a problem where it wasn't saving or clearing the PrescribedFor text properly at times. Just the IWB file and exe with this zip

Brian