HEALTH WORKER LOGS

transferring work logs to a new system

Some health workers in Texas needed to move their work logs from one system to another. This involved transferring thousands of entries with times, locations, descriptions and other details from an export in PDF format to a very different system.

I used a Python library called pdfplumber to extract the data from the PDF files and convert it to JSON format, then I used JavaScript to transform the JSON data into the format required for the new system.

The old system had two "description" fields (specific information about patients and treatment) but the new system only had one. The health workers gave me some quite complicated guidelines for combining the descriptions, so I wrote a JavaScript function which followed the guidelines, and automatically generated the new combined descriptions.

I entered all the data from the first health worker into the new system. She was very pleased, so I got started on the data from the second health worker. Unfortunately we were in different time zones (6 hours apart) and when the first health worker looked more closely at the new entries, she realised that the system had changed them all by 6 hours, and there was no easy way to change them back. She told me not to worry about it, and she would go through and change them all when she had time.

There were hundreds and hundreds of entries, and I really wanted to help her, so I worked on a way to automate the time adjustments.

I decided to use Playwright to control Google Chrome.

My Playwright script needed to:

I ran my script - and it didn't work. I realised that working through the entries in chronological order, the script was often trying to move an entry to a time where another entry already existed, which caused an error. I changed my script to work through the entries in REVERSE chronological order, so the script wouldn't cause any time conflicts.

I ran my script again - and it still didn't work. I realised that as the times changed, the entries didn't always stay displayed in chronological order on the system, so working through them in reverse chronological order wasn't reliable.

I had an idea - I created a Python list of all the events with their original times, then the script worked through MY list of events in reverse order, no matter what order they were displayed in after they were adjusted. I felt sure I'd figured it out, so I ran my script again, this time at maximum speed.

It worked perfectly! I made a video of it working on a sample to show the health worker. It was quite impressive watching it work at maximum speed - popups were opening and closing and the times were being adjusted at a furious rate. She was very happy and told me to go ahead and run my script on her whole work log.

I ran my script again - it adjusted the times perfectly for all the entries. The health worker was very happy, and when I transferred the entries from the old system to the new system for other health workers, I was able to take into account our different time zones and get it right the first time. I really learned a lot about adaptability from this project!