Skip to content
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

Separate DeliveryStatus value into multiple statuses? #210

Open
fwextensions opened this issue Aug 17, 2022 · 0 comments
Open

Separate DeliveryStatus value into multiple statuses? #210

fwextensions opened this issue Aug 17, 2022 · 0 comments
Labels
question Further information is requested

Comments

@fwextensions
Copy link
Collaborator

fwextensions commented Aug 17, 2022

There's a DeliveryStatus enum that tracks the state of the ringdown (whether it was sent or received) and the state of the patient (arrived or offloaded) and the unit (returned to service), as well as whether some of those states have been acknowledged by the hospital.

It's potentially confusing to have one value tracking the state of those different objects, and may be cleaner having them separated. For instance, if the acknowledgements are coming from people, they might arrive after the patient or unit has already changed state.

On the server, there's a PatientDelivery model that uses the DeliveryStatus values, and on the client there's a Ringdown model that uses a copy of those same values. So it's already confusing the status of delivering the patient and the status of the ringdown transmission.

There's also some code, like in RingdownCard that doesn't account for the acknowledged versions of the states, and would probably not show the right thing in those cases:

  const canBeDismissed =
    ringdown.currentDeliveryStatus === Ringdown.Status.OFFLOADED ||
    ringdown.currentDeliveryStatus === Ringdown.Status.CANCELLED ||
    ringdown.currentDeliveryStatus === Ringdown.Status.REDIRECTED;

  return (
    <div
      className={classNames('ringdown-card height-auto', className, {
        'ringdown-card--dismissable': canBeDismissed,
        'ringdown-card--expanded': isExpanded,
        'ringdown-card--cancelled': ringdown.currentDeliveryStatus === Ringdown.Status.CANCELLED,
        'ringdown-card--redirected': ringdown.currentDeliveryStatus === Ringdown.Status.REDIRECTED,
        'ringdown-card--offloaded': ringdown.currentDeliveryStatus === Ringdown.Status.OFFLOADED,
      })}
    >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant