Last active
October 12, 2021 12:43
-
-
Save schultbr/858a0a8ab606f31f1f60c968b7cb0806 to your computer and use it in GitHub Desktop.
Sample Single Read Workflow
This file contains hidden or 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
Sample Single Read Workflow | |
Submission | |
Signoff Submission Form -> QC | |
QC | |
Signoff QC Form - Query -> Submission | |
Signoff QC Form - Approve -> Read | |
Read | |
Signoff Reader Form -> Complete | |
This State | |
Complete |
This file contains hidden or 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
function returnHeader(state) { | |
return $("h1", | |
{style: {color: "darkBlue"}}, | |
`The current state is: ${state}`); | |
} | |
function returnButtons(state, model){ | |
if(state === "Submission"){ | |
return $('button', {style: {position: "relative", left: 50, top: 30}, | |
onClick: function(){ model.emit("Signoff Submission Form") }}, | |
"Signoff"); | |
} | |
else if(state === "QC"){ | |
return $('div', | |
$('button', {style: {position: "relative", left: 20, top: 30}, | |
onClick: function(){ model.emit("Signoff QC Form - Query") }}, | |
"Signoff - Query"), | |
$('button', {style: {position: "relative", left: 100, top: 30}, | |
onClick: function(){ model.emit("Signoff QC Form - Approve"); readCount = 0; eligibleReadResultCount = 0; notEligibleReadResultCount = 0; }}, | |
"Signoff - Approve")); | |
} | |
else if(state.startsWith("Read")){ | |
return $('button', {style: {position: "relative", left: 50, top: 30}, | |
onClick: function(){ model.emit("Signoff Reader Form") }}, | |
"Signoff"); | |
} | |
else { | |
return $('div', | |
$('span', {style: {color: "darkBlue"}}, `Visit workflow is complete!!`), | |
); | |
} | |
} | |
function render(model){ | |
let current_state_name = model.active_states[0].name; | |
return $('div', | |
returnHeader(current_state_name), | |
returnButtons(current_state_name, model) | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment