calculate Appointments units?

anthony.selby

Well-known member
Joined
Sep 3, 2009
Messages
65
Programming Experience
5-10
Hey everyone,

I'm been working on a EMR program for a chiropractor friend of mine. I have got most of it working, there are ten touch screen (stations) with dual monitors that display x-rays and allow the doctor to make up his reports and billing information. Everything works over the network I stream everything its multi-threaded and has been working alright. Now I'm trying to integrate there appointments (there using paper now) and its just driving me crazy. I will say that the way he does his appointments is one of the most complex I've heard but he tells me its a standard practice in there kind of office.

I will try and explain it the best I can, for the sake of this example there are 4 different types of appointments, we will call them Standard, Console, Console & Xray, Extendend.

He books appointments every 20 mins, and has 2 of them at a time.

Standard appointments last 20 mins long
Console appointments last 30 mins
Console & X-Ray last 40 mins
extendend last 60 mins

He can do 2 Standard appointments at once (they take 1 available slot for that time slot)
Console appointments take 3 slots (2 in one time period and 1 in the next time period)
console & x-ray take 4 slots (2 in both time periods)
extended take 8 (2 in the first time slot and 1 in every other time slot)


if you think about it like this is helps

Time | Slot 1
| Slot 2
8:00 AM | Standard (Patient 1)
| Standard (Patient 2)
8:10 AM | Finish Standard (Patient 1) | Finish Standard (Patient 2)
8:20 AM | Console (Patient 3) | Console (Patient 3)
8:30 AM | Console (Patient 3) | Standard (Patient 4)
8:40 AM | Finish console (Patient 3) | Finish Standard (Patient 4)
8:50 AM | Extended (Patient 4) | Extended (Patient 4)
9:00 AM | "" | Standard (Patient 5)
9:10 AM | "" | Finish Standard (Patient 5)
....

I want to give them a box where they enter the date and the type of appointment and it displays the available times, I just can't figure out how I would do that. I tried a couple of things and none of them work out ... I would love any ideas, right now I store the all kinds of information and I would like to make in a way that they can change the appointment lengths or amount of time slots required with out me having to do anything (a user settings section) If anyone wants to give me there ideas I can explain exact what structures and information I'm storing but it doesn't matter whatever it takes that what I can change it to ...

Thanks
 
The least common denominator is 10. Let's call a unit 10, and divide each hour into 6 units. A standard appointment would use 2 units, a console appt uses 3 units, a console/xray uses 4 units, and an extended appt uses 6 units.

Now you can take it from there.
 
I've done that already ... but if I'm going to allow them to add and change the appointment types how would a go about knowing if the appointment needs time slots vertically or horizontally ...

I can post some of the code (have no problem posting everything ... its just alot)
 
yeah ... that kinda the whole point ... I can't think of a good way to set it up ... so that they will be able to create or edit there own appointment types without me having to rewrite everything ... for example what if they change a appointment type to 45 mins.

I'm looking for ideas on how to set it up so the end user can semi easily take care of this on there own
 
If the appointment slot should include 45 minutes, then that makes the least common denominator 5 minutes. Therefore, assign the unit variable accordingly to account for any future changes. That computes to 12 units per hour, with the smallest appointment slot equal to a span of 4 units (20 minutes).

Divide up each hour into 12 parts and fill in with the number of units needed for each appointment. That shouldn't be too difficult to do.
 
alright ...

This is what I have now for them setting up there appointments page

screen.jpg


From there I take that information and fill it in to a structure

VB.NET:
Structure sAppointmentTypes
     Dim Name As String
     Dim Length As Integer
     Dim NumberOfTimeSlotsUsed As Integer
     Dim Horizontal As Boolean
     Dim Vertical As Boolean
End Structure

On the appointments page I have them select a patient, then a date, and appointment type (from the appointment types they entered)

I want to fill a list view with all the available times

When an appointment is created I store that and I and 1 to a Dictionary(of date, integer) which I use to tell me how many of the time slots have been used for that time.

I have no problem enumerating through all the times that the clinic is open, but I don't think I have enough information or I can't think of a good way to use the information that I have to be able to tell them what times are available and which ones are either full or don't have enough time slots open in the right order.

Thats where I'm running in to problems, getting enough information in an easy enough why that the girl at the front desk can do everything she needs without calling me ... Even if they make an appointment type that lasts over an hour

I don't know if I was explaining myself well enough earlier ... hopefully everything makes sense ... thank you for your time so far
(just talking these things out sometimes helps)

this is what I have so far for finding the times (it doesn't work) ... I'm missing a lot of logic ... I just can't see how it would work (with entries some entries moving in both directions)

VB.NET:
 Do Until CurrentTime > TempCloseTime
            If CurrentAppointmentTypes(ComboBox2.SelectedIndex).Vertical = True Then
                Try
                    If UsedTime(CurrentTime) + CurrentAppointmentTypes(ComboBox2.SelectedIndex).NumberOfTimeSlotsUsed <= CurrentSettings.NumberOfAppointmentsPerTimeSlot + 1 Then
                        'Add Patients Name To The List
                        Dim TempItem As New ListViewItem.ListViewSubItem
                        Dim TempMainItem As New ListViewItem
                        TempItem.Text = (GetPatientNameFromAppointmentTime(CurrentTime))
                        TempMainItem.Text = CurrentTime.ToShortTimeString
                        TempMainItem.SubItems.Add(TempItem)

                        ListView3.Items.Add(TempMainItem)

                    End If
                Catch KeyExp As KeyNotFoundException
                    'No Patients Found
                    ListView3.Items.Add(CurrentTime.ToShortTimeString)
                End Try

                CurrentTime = CurrentTime.AddMinutes(CurrentSettings.TimeSlotSpacing)


                If CurrentSettings.ClinicClosesForLunch = True Then
                    If TempLunchSwitch = False Then
                        Dim TempLunchStart As Date = Date.Parse(SeedDate & " " & CurrentSettings.ClinicLunchTimeStart)
                        If CurrentTime > TempLunchStart Then
                            Dim TempLunchEnd As Date = Date.Parse(SeedDate & " " & CurrentSettings.ClinicLunchTimeEnd)
                            CurrentTime = TempLunchEnd
                            TempLunchSwitch = True
                        End If
                    End If
                End If
            Else
                'Appointment Type Moves Horizontal First
                If AvailbleTime(CurrentTime) + CurrentAppointmentTypes(ComboBox2.SelectedIndex).NumberOfTimeSlotsUsed Then

                End If
            End If
        Loop
 
Last edited:
Back
Top