All files / react-app/src/features/forms/post-submission/respond-to-rai index.tsx

78.57% Statements 11/14
66.66% Branches 4/6
50% Functions 3/6
78.57% Lines 11/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119          72x 1x                                                               72x 2x 2x   2x   2x       1x       1x                                                                 72x 1x                                                                
import { useGetItem } from "@/api";
import { ActionForm, LoadingSpinner, PackageSection } from "@/components";
import { formSchemas } from "@/formSchemas";
import { Navigate, useParams } from "react-router";
 
export const RespondToRaiMedicaid = () => {
  const { authority, id } = useParams();
  return (
    <ActionForm
      schema={formSchemas["respond-to-rai-medicaid"]}
      title={`${authority} Formal RAI Response Details`}
      fields={() => <PackageSection />}
      defaultValues={{ id, authority }}
      attachments={{
        faqLink: "/faq/medicaid-spa-rai-attachments",
      }}
      promptPreSubmission={{
        acceptButtonText: "Yes, Submit",
        header: "Do you want to submit your official formal RAI response?",
        body: "By clicking Yes, Submit, you are submitting your official formal RAI Response to start the 90 day clock review process.",
      }}
      documentPollerArgs={{
        property: "id",
        documentChecker: (check) => check.recordExists,
      }}
      breadcrumbText="Respond to Formal RAI"
      preSubmissionMessage="Once you submit this form, a confirmation email is sent to you and to CMS.
      CMS will use this content to review your package, and you will not be able
      to edit this form. If CMS needs any additional information, they will
      follow up by email."
      bannerPostSubmission={{
        header: "RAI response submitted",
        body: `The RAI response for ${id} has been submitted.`,
        variant: "success",
      }}
    />
  );
};
export const RespondToRaiWaiver = () => {
  const { authority, id } = useParams();
  const authorityText = authority === "1915(c)" ? "1915(c) Appendix K" : authority;
 
  const { data: record, isLoading } = useGetItem(id);
 
  if (isLoading) {
    return <LoadingSpinner />;
  }
 
  Iif (!record) {
    return <Navigate to="/dashboard" />;
  }
 
  const { actionType } = record._source;
 
  return (
    <ActionForm
      schema={formSchemas["respond-to-rai-waiver"]}
      title={`${authorityText} Waiver Formal RAI Response Details`}
      fields={() => <PackageSection />}
      defaultValues={{ id, authority, actionType }}
      attachments={{
        faqLink: "/faq/waiverb-rai-attachments",
      }}
      promptPreSubmission={{
        acceptButtonText: "Yes, Submit",
        header: "Do you want to submit your official formal RAI response?",
        body: "By clicking Yes, Submit, you are submitting your official formal RAI Response to start the 90 day clock review process.",
      }}
      documentPollerArgs={{
        property: "id",
        documentChecker: (check) => check.recordExists,
      }}
      breadcrumbText="Respond to Formal RAI"
      preSubmissionMessage="Once you submit this form, a confirmation email is sent to you and to CMS.
      CMS will use this content to review your package, and you will not be able
      to edit this form. If CMS needs any additional information, they will
      follow up by email."
      bannerPostSubmission={{
        header: "RAI response submitted",
        body: `The RAI response for ${id} has been submitted.`,
        variant: "success",
      }}
    />
  );
};
export const RespondToRaiChip = () => {
  const { authority, id } = useParams();
  return (
    <ActionForm
      schema={formSchemas["respond-to-rai-chip"]}
      title={`${authority} Formal RAI Response Details`}
      fields={() => <PackageSection />}
      defaultValues={{ id, authority }}
      attachments={{
        faqLink: "/faq/chip-spa-rai-attachments",
      }}
      promptPreSubmission={{
        acceptButtonText: "Yes, Submit",
        header: "Do you want to submit your official formal RAI response?",
        body: "By clicking Yes, Submit, you are submitting your official formal RAI Response to restart the SPA review process and a new 90th day will be identified.",
      }}
      documentPollerArgs={{
        property: "id",
        documentChecker: (check) => check.recordExists,
      }}
      breadcrumbText="Respond to Formal RAI"
      preSubmissionMessage="Once you submit this form, a confirmation email is sent to you and to CMS.
      CMS will use this content to review your package, and you will not be able
      to edit this form. If CMS needs any additional information, they will
      follow up by email."
      bannerPostSubmission={{
        header: "RAI response submitted",
        body: `The RAI response for ${id} has been submitted.`,
        variant: "success",
      }}
    />
  );
};