-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating new episodes #1847
Comments
I think there could be issues with using a pathway to create a new episode. So is your usecase that you have a patient that is connected to a different episode and want to add an additional episode to a patient? |
I am just looking for a straightforward way to create new episodes for patients. The referenced piece of documentation was the only thing that came close to it, as far as I could find. |
Hi @WoutV You will be pleased to hear that creating new episodes for patients is a thing that frequently happens within Opal applications via various different strategies - sometimes based on a direct user action, sometimes as the side effect of a user action, sometimes based on some external interface etc etc. I've never had to do it via the Admin console. In order to best advise you, I wonder if you could explain what your application is and what the context of the episode you want to create is ? |
I want to store different lines of chemotherapy treatment as separate episodes, to make sure that we can keep the linked adverse events, responses, ... (modeled as subrecords) linked to the right line of treatment, instead of having just one episode per patient where we put all the subrecords for that one patient. Ideally this would happen through the click of a button, which would then prompt to create a new episode with some metadata (number of the line of treatment, start date, ...) I feel like I am missing a key part of knowledge on how to do this. |
Hi @WoutV One of the interesting things here is that we largely don't do this in practice - it's happened but not regularly. Creating an episode on the client, method 1: with other data entryIf I needed to, I'd do it in a custom controller, rather than with a Pathway. Episodes and subrecords have their own API endpoint. Something like:
(This isn't tested, and it's been a while.) To load in a modal, something like:
Creating an episode method 2, single pressAnother way would be to add a + button to creates the new episode and calls the
Other considerationsIf I understand what a line of chemotherapy is (entirely possible I don't !) then I'm not sure I would definitely model that as a separate episode however - in general, we have moved towards having as few episodes per patient as possible - particularly not multiple concurrent episodes per patient for a single team. Hard to say definitively without reviewing your code or understanding the context further. You're doing this because it's possible to have 0-n instances of multiple other subrecords per line of chemotherapy and it links them neatly? |
Your final consideration is indeed what I am trying to model. The different lines of treatment are sequential in time (not overlapping or active at the same time), but they consist of different drug administrations, they contain the response of the patient to that specific treatment line, possible adverse events, ... and all these subrecords only relate to one specific treatment line. To me it made the most sense to model them as episodes (treatment lines) with subrecords (AE, drug administration, response, ...). I will take a look at the two options you described, and see how it fits. Thanks! |
OK, so if they don't ever overlap, then another option, which does allow you to use the Pathway code to add initial data in other subrecords rather than have to wire form data yourself, is to create the 'next' treatment line episode before it's used but only display it when it becomes active. In this application, an 'FP17' is conceptually analogous to your treatment line. (Specifically It's more or less a visit to the dentist) The Register / Add patient pathway is overriden to create some empty episodes https://github.com/odonto/odonto/blob/v0.32/odonto/pathways.py#L67 When these 'New' episodes are first edited via a pathway, their stage is changed, and another empty episode is created to be used next time: https://github.com/odonto/odonto/blob/v0.32/odonto/pathways.py#L117 Meanwhile the button in the UI says something like "Open a new FP17" (Or Treatment Line) in your case. |
@davidmiller it seems I am having more trouble building this than I initially expected. Would it be an option to collaborate with Open Health Care to develop a solution that fits our need? I am open to discuss this over a different medium as well. |
Apart from the one paragraph in the docs/guides I cannot find anything about creating new episodes from the front-end. I am in the dark on how to implement this functionality (e.g. adding a new episode to an existing patient, without just doing it in the admin console). When I create a "normal" pathway, and add the patient id at the end of the URL, a new patient is created anyway.
Possibly related to this #1537
The text was updated successfully, but these errors were encountered: