25.3.3 Modeling the Medical Procedure Lifecycle

Model status-driven business logic with a workflow that waits for procedure status or schedule changes.

The Woods Clinic business process for patient procedures closely aligns with these statuses. More specifically, it involves the steps back office staff take when a procedure changes statuses. From talking to Woods Clinic staff, you learn when a patient's medical procedure is:
  • Scheduled – staff send an email to the patient
  • Completed – staff prepare a draft invoice to review with the insurance provider
  • Invoiced – staff email the invoice to the client for payment
  • Paid – staff consider the procedure's lifecycle complete.

You can use a workflow with a Wait activity as shown below to automate this medical procedure lifecycle. Notice the Wait activity has the Static ID unique identifier of status_or_date_changed and that it has left the Timeout Type unset. This makes the workflow wait indefinitely until your application logic signals it to continue.

At that time, it can populate a workflow variable V_WHAT_CHANGED with the value:
  • STATUS – if the medical procedure status has changed, or
  • SCHEDULE – if its schedule has changed.

The Switch activities can use the value of the V_WHAT_CHANGED variable and Additional Data columns like STATUS, DOCTOR, and PROCEDURE_DATE of the associated FRC_MEDICAL_PROCEDURES row to perform appropriate business logic. Most of the paths in the workflow connect back to the Wait activity to await further data changes. However, when STATUS reflects the final "Paid" status, the workflow ends.

Figure 25-113 Procedure Lifecycle Workflow Coordinates Application Logic



Using this approach, you can automate the previously manual steps in the medical procedure lifecycle so that now, when a medical procedure's status becomes:
  • Scheduled – your workflow emails the patient
  • Completed – your workflow prepares the draft invoice as a pixel-perfect PDF document
  • Invoiced – your workflow emails the invoice as an attachment to the client for payment
  • Paid – your workflow marks the procedure as complete.