Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
britt-mo committed Nov 18, 2024
2 parents e3f313c + 74a80a6 commit 8c388b8
Show file tree
Hide file tree
Showing 31 changed files with 490 additions and 145 deletions.
5 changes: 3 additions & 2 deletions .github/branch-name-validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -e

local_branch=${1}
[ -z "${1}" ] && local_branch=$(git rev-parse --abbrev-ref HEAD)

valid_branch='^[a-z][a-z0-9-]*$'

Expand All @@ -15,7 +16,7 @@ join_by() { local IFS='|'; echo "$*"; }
#creates glob match to check for reserved words used in branch names which would trigger failures
glob=$(join_by $(for i in ${reserved_words[@]}; do echo "^$i-|-$i$|-$i-|^$i$"; done;))

if [[ ! $local_branch =~ $valid_branch ]] || [[ $local_branch =~ $glob ]] || [[ ${#local_branch} -gt 64 ]]; then
if [[ ! $local_branch =~ $valid_branch ]] || [[ $local_branch =~ $glob ]] || [[ ${#local_branch} -gt 20 ]]; then
echo """
------------------------------------------------------------------------------------------------------------------------------
ERROR: Please read below
Expand All @@ -28,7 +29,7 @@ if [[ ! $local_branch =~ $valid_branch ]] || [[ $local_branch =~ $glob ]] || [[
Therefore, the branch name must be a valid service name. Branch name must be all lower case with no spaces and no underscores.
From Serverless:
A service name should only contain alphanumeric (case sensitive) and hyphens. It should start with an alphabetic character and shouldnt exceed 128 characters.
A service name should only contain alphanumeric (case sensitive) and hyphens. It should start with an alphabetic character and shouldnt exceed 20 characters.
For Github Actions support, please push your code to a new branch with a name that meets Serverless' service name requirements.
So, make a new branch with a name that begins with a letter and is made up of only letters, numbers, and hyphens... then delete this branch.
------------------------------------------------------------------------------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ jobs:
- name: Run Cypress Tests
uses: cypress-io/github-action@v6
with:
working-directory: tests/cypress
working-directory: tests
spec: |
e2e/*.cy.js
e2e/admin/*.cy.js
e2e/mcpar/*.cy.js
e2e/mlr/*.cy.js
cypress/e2e/*.cy.js
cypress/e2e/admin/*.cy.js
cypress/e2e/mcpar/*.cy.js
cypress/e2e/mlr/*.cy.js
browser: chrome
config: baseUrl=${{ needs.deploy.outputs.application_endpoint }}
wait-on: ${{ needs.deploy.outputs.application_endpoint }}
Expand Down Expand Up @@ -257,8 +257,8 @@ jobs:
- name: Check Project A11y
uses: cypress-io/github-action@v6
with:
working-directory: tests/cypress
spec: e2e/accessibility/*.cy.js
working-directory: tests
spec: cypress/e2e/accessibility/*.cy.js
browser: chrome
config: baseUrl=${{ needs.deploy.outputs.application_endpoint }}
wait-on: ${{ needs.deploy.outputs.application_endpoint }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Configure pre-commit to skip branch name validation
run: |
echo "SKIP=branch-name-validation" >> $GITHUB_ENV
- uses: pre-commit/[email protected]
- uses: actions/setup-node@v4
with:
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ tests_output
tests/cypress/videos
tests/cypress/screenshots
tests/cypress/downloads
tests/cypress/package-lock.json
package-lock.json
.vscode/
*._S3rver_cors.xml
services/database/local_buckets
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,10 @@ repos:
rev: v8.12.0
hooks:
- id: gitleaks
- repo: local
hooks:
- id: branch-name-validation
name: branch-name-validation
entry: .github/branch-name-validation.sh
language: script
pass_filenames: false
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"test": "tests"
},
"scripts": {
"test": "cd tests/cypress && npm test && cd -",
"test:ci": "cd tests/cypress && yarn run test:ci"
"test": "cd tests && npm test && cd -",
"test:ci": "cd tests && yarn run test:ci"
},
"repository": {
"type": "git",
Expand Down
122 changes: 113 additions & 9 deletions services/app-api/forms/naaar.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"name": "NAAAR Report Submission Form",
"basePath": "/naaar",
"version": "NAAAR_2024-08-06",
"entities": {},
"entities": {
"plans": { "required": true }
},
"routes": [
{
"name": "I. State and program information",
Expand Down Expand Up @@ -37,11 +39,10 @@
"type": "p",
"content": "According to the Paperwork Reduction Act of 1995, no persons are required to respond to a collection of information unless it displays a valid OMB control number. The valid OMB control number for this information collection is 0938-0920 (Expires: June 30, 2024). The time required to complete this information collection is estimated to average 6 hours per response, including the time to review instructions, search existing data resources, gather the data needed, and complete and review the information collection. If you have comments concerning the accuracy of the time estimate(s) or suggestions for improving this form, please write to: CMS, 7500 Security Boulevard, Attn: PRA Reports Clearance Officer, Mail Stop C4-26-05, Baltimore, Maryland 21244-1850"
}

]
},
"form": {
"id": "isiarc",
"id": "isiars",
"fields": [
{
"id": "contactName",
Expand All @@ -62,7 +63,7 @@
}
},
{
"id": "stateOrTerritory",
"id": "stateName",
"type": "text",
"validation": "textOptional",
"props": {
Expand All @@ -83,12 +84,115 @@
},
{
"id": "reportingScenario",
"type": "text",
"validation": "textOptional",
"type": "radio",
"validation": "radio",
"props": {
"label": "I.A.5 Reporting scenario (TODO)",
"hint": "TODO: Convert to radio",
"disabled": true
"label": "1.A.5 Reporting scenario",
"hint": [
{
"type": "p",
"content": "Enter the scenario under which the state is submitting this form to CMS. Under 42 C.F.R. § 438.207(c) - (d), the state must submit an assurance of compliance after reviewing documentation submitted by a plan under the following three scenarios:"
},
{
"type": "ul",
"children": [
{
"type": "li",
"content": "Scenario 1: At the time the plan enters into a contract with the state;"
},
{
"type": "li",
"content": "Scenario 2: On an annual basis;"
},
{
"type": "li",
"content": "Scenario 3: Any time there has been a significant change (as defined by the state) in the plan’s operations that would affect its adequacy of capacity and services, including (1) changes in the plan’s services, benefits, geographic service area, composition of or payments to its provider network, or (2) enrollment of a new population in the plan."
}
]
},
{
"type": "p",
"content": "States should complete one (1) form with information for applicable managed care plans and programs. For example, if the state submits this form under scenario 1 above, the state should submit this form only for the managed care plan (and the applicable managed care program) that entered into a new contract with the state. The state should not report on any other plans or programs under this scenario. As another example, if the state submits this form under scenario 2, the state should submit this form for all managed care plans and managed care programs."
}
],
"choices": [
{
"id": "g3B64XNZhZCZ017er2Y6hJ",
"label": "Scenario 1: New contract"
},
{
"id": "mlvX4umhgnU199rPmMJybc",
"label": "Scenario 2: Annual report"
},
{
"id": "l7XDjKKDrwryEe5YgDTTmP",
"label": "Scenario 3: Significant change - services"
},
{
"id": "7ZtsZ25K0romDSTAIStzzY",
"label": "Scenario 3: Significant change - benefits"
},
{
"id": "ObbAyoYB97trcbVN0OFQ2X",
"label": "Scenario 3: Significant change - geographic service area"
},
{
"id": "FC9hagL8vz3i0bFoHsJYEw",
"label": "Scenario 3: Significant change - composition of provider network"
},
{
"id": "ziLQDOD5TucgEHzmlzOEn6",
"label": "Scenario 3: Significant change - payments to provider network"
},
{
"id": "TDkPWZJai0kwHIp4zm1ZVy",
"label": "Scenario 3: Significant change - enrollment of new population"
},
{
"id": "IyPRlUA4k3bTkj5rF1E8zg",
"label": "Other, specify",
"children": [
{
"id": "reportingScenario-otherText",
"type": "textarea",
"validation": {
"type": "text",
"nested": true,
"parentFieldName": "reportingScenario"
},
"props": {
"label": "1.A.6 Reporting scenario - other ",
"hint": "If the state is submitting this form to CMS for any reason other than those specified in I.A.5, explain the reason."
}
}
]
}
]
}
}
]
}
},
{
"name": "Add Plans",
"path": "/naaar/state-and-program-information/add-plans",
"pageType": "standard",
"verbiage": {
"intro": {
"section": "I. State and program information",
"subsection": "Add plans",
"info": "Enter the name of each plan that participates in the program for which the state is reporting data."
}
},
"form": {
"id": "iap",
"fields": [
{
"id": "plans",
"type": "dynamic",
"validation": "dynamic",
"props": {
"label": "Plan name"
}
}
]
Expand Down
4 changes: 3 additions & 1 deletion services/app-api/handlers/reports/submit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
MCPARReportMetadata,
MLRReportMetadata,
UserRoles,
NAAARReportMetadata,
} from "../../utils/types";

export const submitReport = handler(async (event, _context) => {
Expand Down Expand Up @@ -65,7 +66,8 @@ export const submitReport = handler(async (event, _context) => {

const reportMetadata = response.Item as
| MLRReportMetadata
| MCPARReportMetadata;
| MCPARReportMetadata
| NAAARReportMetadata;
const { status, isComplete, fieldDataId, formTemplateId } = reportMetadata;

if (status === "Submitted") {
Expand Down
2 changes: 2 additions & 0 deletions services/app-api/utils/types/reportContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export interface ReportMetadataShape extends ReportKeys {
copyFieldDataSourceId?: string;
programIsPCCM?: Choice[];
previousRevisions: string[];
planTypeIncludedInProgram?: Choice[];
"planTypeIncludedInProgram-otherText"?: string;
novMcparRelease?: boolean;
}

Expand Down
10 changes: 10 additions & 0 deletions services/app-api/utils/types/reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,16 @@ export interface MCPARReportMetadata extends ReportMetadata {
novMcparRelease: boolean;
}

export interface NAAARReportMetadata extends ReportMetadata {
programName: string;
reportType: "NAAAR";
reportingPeriodStartDate: number;
reportingPeriodEndDate: number;
dueDate: number;
planTypeIncludedInProgram: Choice[];
"planTypeIncludedInProgram-otherText"?: string;
}

// HELPER FUNCTIONS

/**
Expand Down
4 changes: 3 additions & 1 deletion services/app-api/utils/validation/schemas.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as yup from "yup";
import { radioOptional } from "./completionSchemas";
import { radioOptional, textOptional } from "./completionSchemas";

export const metadataValidationSchema = yup.object().shape({
programName: yup.string(),
Expand All @@ -19,4 +19,6 @@ export const metadataValidationSchema = yup.object().shape({
submissionName: yup.string(),
completionStatus: yup.mixed(),
copyFieldDataSourceId: yup.string(),
planTypeIncludedInProgram: radioOptional(),
"planTypeIncludedInProgram-otherText": textOptional(),
});
8 changes: 4 additions & 4 deletions services/ui-src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@emotion/styled": "^11.12.0",
"@hookform/resolvers": "^2.9.11",
"@vitejs/plugin-react": "^4.3.2",
"aws-amplify": "^6.6.4",
"aws-amplify": "^6.6.5",
"date-fns": "^2.30.0",
"date-fns-tz": "^1.3.8",
"dompurify": "^2.5.7",
Expand All @@ -30,7 +30,7 @@
"html-react-parser": "^3.0.16",
"jest": "^28.0.0",
"jest-environment-jsdom": "^28.0.0",
"launchdarkly-react-client-sdk": "^3.2.0",
"launchdarkly-react-client-sdk": "^3.4.0",
"nth-check": "2.1.1",
"object-path": "^0.11.8",
"react": "^17.0.1",
Expand All @@ -41,9 +41,9 @@
"react-icons": "^4.3.1",
"react-router-dom": "6.27.0",
"react-uuid": "^1.0.3",
"sass": "^1.79.4",
"sass": "^1.80.7",
"vite": "^5.4.8",
"vite-tsconfig-paths": "^4.3.2",
"vite-tsconfig-paths": "^5.1.2",
"yup": "^0.32.11",
"zustand": "^4.5.3"
},
Expand Down
3 changes: 3 additions & 0 deletions services/ui-src/src/components/fields/DynamicField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,5 +332,8 @@ const sx = {
},
textField: {
width: "100%",
label: {
marginTop: "0",
},
},
};
Loading

0 comments on commit 8c388b8

Please sign in to comment.