Created
February 19, 2020 10:48
-
-
Save shreybatra/41c359d6718a23d2a8d81a09aeecda0e to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const patientSelectionMachine = Machine({ | |
id: "patientSelector", | |
initial: "pickPatients", | |
states: { | |
pickPatients: { | |
on: { | |
FROM_MEASURE: "measure", | |
FROM_ADT: "activity", | |
FROM_CSV: "customCsv" | |
} | |
}, | |
activity: { on: { ABC: "exit" } }, | |
measure: {}, | |
customCsv: {}, | |
exit: {} | |
} | |
}); | |
const strategyMachine = Machine({ | |
id: "Strategy", | |
initial: "startExecution", | |
states: { | |
startExecution: { | |
on: { | |
HAVE_SCHEDULE: "scheduleCheck", | |
DONT_HAVE_SCHEDULE: "patientSelection" | |
} | |
}, | |
scheduleCheck: { | |
on: { TRUE: "patientSelection", FALSE: "nextStrategy" } | |
}, | |
nextStrategy: { | |
on: { | |
HAVE_NEXT_STRATEGY: "startExecution", | |
NO_STRATEGY: "exit" | |
} | |
}, | |
patientSelection: { on: { COMPLETE: "exit" }, ...patientSelectionMachine }, | |
exit: {} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment