Skip to content

Instantly share code, notes, and snippets.

@schultbr
Last active October 12, 2021 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schultbr/858a0a8ab606f31f1f60c968b7cb0806 to your computer and use it in GitHub Desktop.
Save schultbr/858a0a8ab606f31f1f60c968b7cb0806 to your computer and use it in GitHub Desktop.
Sample Single Read Workflow
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
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