FHIR Chat · Appointment Status · clinic-arrivals

Stream: clinic-arrivals

Topic: Appointment Status


view this post on Zulip Grahame Grieve (Mar 21 2020 at 09:20):

comment on SaveAppointmentStatus:

TODO: Not sure if we actually need to store anything in here, maybe the actual message content that was received.

view this post on Zulip Grahame Grieve (Mar 21 2020 at 09:20):

yeah, we do. For each appointment, we need to store the following information:

view this post on Zulip Grahame Grieve (Mar 21 2020 at 09:22):

  • have we sent the post-registration message?
  • have we sent the pre-appointment message?
  • have we went them an invitation to a teleconference message?
  • have we sent them a please come inside message?

view this post on Zulip Grahame Grieve (Mar 21 2020 at 09:23):

that's historical input into the message processing algorithm

view this post on Zulip Grahame Grieve (Mar 21 2020 at 09:24):

why do we have PatientPhoto?

view this post on Zulip Grahame Grieve (Mar 21 2020 at 09:25):

what is RebookAppointment about?

view this post on Zulip Grahame Grieve (Mar 21 2020 at 09:25):

shouldn't ArrivalStatus be an enum?

view this post on Zulip Grahame Grieve (Mar 21 2020 at 09:27):

@Brett Esler can a patient have more than one appointment at once?

view this post on Zulip Grahame Grieve (Mar 21 2020 at 09:41):

AppointmentStartTime should be a DateTime?

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:00):

The plan with storage for the appointments was to store that extra content in the local filesystem as extras
Patient photo can be removed.

view this post on Zulip Brett Esler (Mar 21 2020 at 10:00):

yes more than one appointment per patient ispossible

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:01):

at the same time?

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:01):

plan with storage for the appointments was to store that extra content in the local filesystem as extras

Good. Comment suggested otherwise

view this post on Zulip Brett Esler (Mar 21 2020 at 10:04):

yes can have multiple appointments for same patient at the same time...booked in for multiple practitioners is possible as separate appointments... not very common though

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:04):

hmm. it kind of blows the model. Do they get arrived for all of them? DO they move to happening all at once?

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:05):

Maybe just arrive the first one and log a message (display a popup too?)

view this post on Zulip Brett Esler (Mar 21 2020 at 10:07):

it is pretty rare I am thinking; you get warned in BP when you book two slots for the same time for a given patient

view this post on Zulip Brett Esler (Mar 21 2020 at 10:10):

I thik arriving one based on SMS would be fine; the other can be done manually if they care

view this post on Zulip Brett Esler (Mar 21 2020 at 10:11):

will need to think about the SMS to come inside; don;t wan t to send multiple - maybe suppress for a period after sending one out for a patient

view this post on Zulip Brett Esler (Mar 21 2020 at 10:11):

this is pretty rare in IRL

view this post on Zulip Brett Esler (Mar 21 2020 at 10:13):

there is the other case where patient visits twice in one day - might have appt with GP and then later with allied health

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:28):

the one where they visit twice in one day is cool with me, I think. Have to keep an eye on sequence... and be careful not to overlap protocols

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:28):

If there's more one appointment at the same time, we'll just ignore the second altogether

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:29):

I'm not sure why we split appointments into Waiting, Expecting, and Fulfilled. Is that useful?

view this post on Zulip Brett Esler (Mar 21 2020 at 10:31):

That is just the appointment status division - we only trigger SMS on arrived (waiting) -> fulfilled

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:32):

not true. we trigger on other status too now. and if there's more than one, they might overlap, and it matters.

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:32):

so I think that separating them into different lists by status is not a useful thing

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:34):

The fulfilled is going away and replacing with a MessagesReadyToSend queue

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:34):

(as that's what it's for - I think)

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:34):

hmm I think you need to explain that - I'm not sure that i follow that model

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:34):

I'm doing the simple template editor part and storage at the moment.

view this post on Zulip Brett Esler (Mar 21 2020 at 10:36):

we don't show fulfilled do we? just queue up send messages when arrived patients go into consult

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:36):

That's right, once they're fulfilled, we send a message and then forget about them.

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:37):

I don't think it's quite so simple. What happens if they respond to that message?

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:37):

But do want to queue and store that in temp storage in case it restarts or the web receiver fails, so that we can retry.

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:37):

what do we need to queue for? that I haven't followed..

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:39):

The messages that are to be sent to the Patient for whatever reason...

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:39):

I don't want to queue anything. The algorithm should go like this:

  • load list of already known appointments
  • get list of appointments for today
  • for each appointment in today's list
    • do you need to send a message
    • send it
    • update the status to say it's sent and store it (so it doesn't get sent again)
  • done

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:39):

no queuing there....

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:40):

We need to refactor a workflow processor that takes the before/after appointment and then decides what actions need to occur -> Messages be sent, and that gets queued, in case things fail somewhere.

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:41):

we assume Twilio doesn't fail. So once it says it's got it, we record that we sent it. If we die at any stage, we just start again using what's stored

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:41):

if we die between twilio saying ok and us recording that, we send one duplicate message

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:41):

So the extended appointment data that is stored separately has that data right?

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:42):

yes

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:42):

Ok, no queue needed then :smile:

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:43):

I do want to refactor the message processing, yes. I want to move all the logic into a single class that has all the smarts, and just gets called with the 2 lists, and has the services provided to

  • send messages
  • update stored status for an appointment

It's not responsible for the details. We happy with that layout?

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:43):

That is where I wanted to get it.

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:44):

And what the MessageProcessing class was intended to do, but got lots of extras in it...

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:44):

so I'll leave coordination in MessageProcessing.cs, and create a new class MessageLogic that just does the thinking

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:44):

this always happens ;-)

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:45):

Yes it does...
If I strip all the Fhir Server state handling out, that's almost there...
But go for it.

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 10:54):

The intro message setting can also be removed from the settings class, as that's just another template right?

view this post on Zulip Grahame Grieve (Mar 21 2020 at 10:56):

yes

view this post on Zulip Grahame Grieve (Mar 21 2020 at 11:02):

ok, I added the MessageLogic class. Can you check that you're happy with that interface for it?

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:10):

he incoming mobile number does not match to a known patient: reply with "This is not a recognised phone number
Do you think this might be better to just ask them to call the reception?

view this post on Zulip Grahame Grieve (Mar 21 2020 at 11:12):

yes. It's a template anyway, but use your discretion for the default value

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:13):

It was the further processing on the content...

view this post on Zulip Grahame Grieve (Mar 21 2020 at 11:18):

sigh. I committed my token again. Putting the token in a file I have to remember not to commit just isn't working for me :-(

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:19):

put a .gitignore ;)

view this post on Zulip Grahame Grieve (Mar 21 2020 at 11:22):

it's in appSettings.json in Test.Models. You put it there...

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:22):

I put the file there, it had nothing in it...

view this post on Zulip Grahame Grieve (Mar 21 2020 at 11:23):

but you set it up so that the values have to go in there.. can we change it to use the settings for the app?

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:24):

If you have a unit test for the thing, needs settings, hence boom.
The app doesn't have it checked in anywhere.

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:24):

That's only used in the unit test, not the app.

view this post on Zulip Grahame Grieve (Mar 21 2020 at 11:32):

yeah but that's what I was testing... hence, needs the credentials somewhere. But hell, it works. Don't need to test it anymore...

view this post on Zulip Grahame Grieve (Mar 21 2020 at 11:32):

I added pseudo code to the messageLogic class. you ok with it's interface?

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:32):

Once you're happy with them, Mark the test with an Ignore attribute so others don't run them accidentally.

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:33):

Was just committing the settings and template changes.

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:34):

Then I'll take a peek

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:49):

Drop the Initialize method (that's just all the stuff that needs to provide)

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:50):

Do we need the 2 lists of appointments?
Can't we just use the state that is in the appointment?

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:52):

Otherwise I like it.

view this post on Zulip Grahame Grieve (Mar 21 2020 at 11:56):

why drop the initialise method?

view this post on Zulip Grahame Grieve (Mar 21 2020 at 11:56):

we do need the 2 lists, because they have different sources

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:56):

Or put all of the things that you need to initialize on it (all the other stuff)

view this post on Zulip Grahame Grieve (Mar 21 2020 at 11:56):

I'm not following

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:57):

All the other interface implementations

view this post on Zulip Grahame Grieve (Mar 21 2020 at 11:58):

?

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 11:59):

Populating the value of AppointmentUpdater etc.

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 12:00):

Also wondering if TimeNow could be a param to the 3 functions instead of a prop?

view this post on Zulip Grahame Grieve (Mar 21 2020 at 12:00):

it could be. I decided it shouldn't because it's wrong to touch it in production; it's a test mode thing.

view this post on Zulip Grahame Grieve (Mar 21 2020 at 12:01):

I put initialise on the Engine itself in case we decide that there's direct configuration for the engine itself, and to be consistent

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 12:02):

Fair deal

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 12:03):

Though TimeNow will change over time, and if this object goes over days, it might not get re-initiailized

view this post on Zulip Grahame Grieve (Mar 21 2020 at 12:06):

hmm. I guess I anticpated that this would be created each time. Or at least, initialised each time

view this post on Zulip Grahame Grieve (Mar 21 2020 at 12:06):

do the settings get reloaded, or only at start up?

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 12:16):

The settings object is live, unless you copy the value out of it

view this post on Zulip Grahame Grieve (Mar 21 2020 at 12:21):

I think that means it gets reloaded on the fly from the file? or not?

view this post on Zulip Grahame Grieve (Mar 21 2020 at 12:22):

hopefully the answer is that it gets ignored and overwritten at shutdown

view this post on Zulip Brett Esler (Mar 21 2020 at 12:22):

Hey is the current version buildable or do i neeed an update to VS?

CS8703
The modifier 'public' is not valid for this item in C# 7.3. Please use language version 'preview' or greater.
ClinicArrivals.Models (net462)
D:\Oridashi\Repositories\ClinicArrivals\ClinicArrivals.Models\IAppointmentUpdater.cs
5
Active

view this post on Zulip Grahame Grieve (Mar 21 2020 at 12:25):

update and try again

view this post on Zulip Brett Esler (Mar 21 2020 at 12:31):

can you do ITemplateProcessor as well? same issue

view this post on Zulip Grahame Grieve (Mar 21 2020 at 12:32):

update ;-)

view this post on Zulip Grahame Grieve (Mar 21 2020 at 12:32):

ok. I'm done for the day. I'll be up early working on getting the template processor working and then back on the message engine

view this post on Zulip Grahame Grieve (Mar 21 2020 at 12:33):

check MessageEngineTester - that's driving things for me now

view this post on Zulip Brett Esler (Mar 21 2020 at 12:36):

cool - working on checking MD and will try and get Zedmed happening...

view this post on Zulip Brian Postlethwaite (Mar 21 2020 at 16:08):

Got lots done last night in the background processing infrastructure

view this post on Zulip Grahame Grieve (Mar 21 2020 at 19:42):

great


Last updated: Apr 12 2022 at 19:14 UTC