Python Forum
Function to Select a Date
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function to Select a Date
#1
I am attempting to create a function that would load a set of medical records and determine what was the date of treatment. Any given page of a medical treatment record not could have a lot of dates, right? In most cases, the medical record will have something like "Treatment Date: ##/##/####" or "Visit Date", "encounter date:" ahd that should faciliate location of the date that is in fact the treatment. But some medical records simply have a date, often in larger font text, and no text near indicating that date to be a treatment date .

In the selection of the correct treatment date for a given page and collection of pages, I am wondering about this. Nearly always, a group of pages in the medical record I am seeking to classify will be in treatment order - either forward or going backward. Is there a way in code to look at all the dates and the page number that they live on, and find this ascending or descending date pattern?
Reply
#2
Are these scanned paper records? EHRs typically have a field for the date of service, so if this is unstructured as you say I'm guessing you are speaking of scanned records.

If scanned, have they been through OCR so you are working with text, or just the images?

More assumptions - it sounds like you have text. Next challenge is that dates can be part of a note, not just identifying the date of service. "Patient seen today for followup of appendectomy performed 5/1/2023" for example. Also, you would need to handle multiple formats - some people use 5-1-23, some use slashes, some put the year first.

Can you give more specifics?
Reply
#3
Thanks for your reply. Yes these are pdf documents created in itext from tiff files. I would expect to have to handle every variation of dates, include "July 4, 2023".
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  replace nan values by mean group by date.year, date.month wissam1974 5 8,509 Feb-19-2020, 06:25 PM
Last Post: AnkitGupta
  Finding date count from a list of date range in pandas trillerducas72 0 2,760 May-24-2018, 02:30 AM
Last Post: trillerducas72

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020