Skip to content

Commit

Permalink
Stores task when a task resource is passed in the appContext
Browse files Browse the repository at this point in the history
  • Loading branch information
dvargaslantana committed Jan 12, 2024
1 parent 27c7972 commit c5bc6e1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/QuestionnaireForm/QuestionnaireForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import shortid from "shortid";
import _ from "lodash";
import ConfigData from "../../config.json";
import ReactDOM from 'react-dom'
import {createTask} from "../../util/taskCreation";

import retrieveQuestions, { buildNextQuestionRequest } from "../../util/retrieveQuestions";

Expand Down Expand Up @@ -1052,6 +1053,7 @@ export default class QuestionnaireForm extends Component {
if (status == "in-progress") {
const showPopup = !this.isAdaptiveForm() || this.isAdaptiveFormWithoutItem();
this.storeQuestionnaireResponseToEhr(qr, showPopup);
createTask(JSON.parse(this.appContext.task), this.props.smart);
this.popupClear("Partially completed form (QuestionnaireResponse) saved to EHR", "OK", true);
if(showPopup) {
this.popupLaunch();
Expand Down Expand Up @@ -1123,6 +1125,10 @@ export default class QuestionnaireForm extends Component {
this.generateAndStoreDocumentReference(qr, priorAuthBundle);
this.storeQuestionnaireResponseToEhr(qr, false);

//If the app context contains a Task, save it
//TODO: Handle when a task updates or is already saved
createTask(JSON.parse(this.appContext.task), this.props.smart);

const priorAuthClaim = {
resourceType: "Claim",
status: "active",
Expand Down

0 comments on commit c5bc6e1

Please sign in to comment.