Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into platform/brick/14603-convert-st…
Browse files Browse the repository at this point in the history
…ep-update
  • Loading branch information
brick-green committed Sep 6, 2024
2 parents 6ff43ce + 7f93cf9 commit 2ca50e3
Show file tree
Hide file tree
Showing 214 changed files with 902 additions and 26,030 deletions.
9 changes: 4 additions & 5 deletions .environment/frontend/run-frontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ function modified_check() {
cd "$DIR/../../frontend-react";
FRONTEND_DIR=$(pwd);

if [ ! -f "$HOOK_FILE" ]; then
echo "$FRONTEND_DIR/$HOOK_FILE does not exist. Please make sure you run yarn first."
exit 1
fi

modified_check
if [[ ${isModified} == 1 ]]; then
if [ ! -f "$HOOK_FILE" ]; then
echo "$FRONTEND_DIR/$HOOK_FILE does not exist. Please make sure you run yarn first."
exit 1
fi
"./$HOOK_FILE"
fi
RC=$?
Expand Down
3 changes: 3 additions & 0 deletions .environment/gitleaks/gitleaks-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ title = "PRIME ReportStream Gitleaks Configuration"
'authority\", \"extension\"', # FHIR extension URL also shows up in normal FHIR test data
'ApiKeyCredential\(\"flexion\"',
'authType: \"two-legged\"',
'\"apiKey\"',
'api-key\" to \"oracle123\"',
'Authorization-Type: \"username/password\"',
'cdctiautomated_sa'
]
paths = [
'.terraform/modules/',
Expand Down
17 changes: 15 additions & 2 deletions .github/ISSUE_TEMPLATE/up-receiver-migration-validate-test-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
name: UP Migrating Receiver - Validate Test Data
about: This is the fourth step in migrating a STLT to the UP
title: "[name of STLT] - UP Migration - Validate Test Data"
labels: onboarding-ops, receiver
labels: onboarding-ops, receiver, engineering, needs-refinement
assignees: ''

---
[STLT] = name of STLT

### User Story:
As a developer, I want the [STLT] to validate test messages in staging, so that they can receive data in the format they expect.
Expand All @@ -27,4 +28,16 @@ As a developer, I want the [STLT] to validate test messages in staging, so that

### Acceptance Criteria
- [ ] Created and sent data using Simple Report
- [ ] Confirmed with STLT that data passes validation
- [ ] Confirmed with STLT that data passes validation
- [ ] When finished, tag Mikaelah, Chris, and Glenn in a slack post stating:
> [STLT] "Testing in Staging" is complete and will be moving on to "Monitor in Production"
>
> Connection Type: [REST, SFTP, SOAP, etc]
>
> Conditions tested: [List of Conditions]
>
> Positives set up to receive: [List of Conditions]
>
> Negatives set up to receive: [List of Conditions]
>
> Format receiving: [HL7 or FHIR]
4 changes: 2 additions & 2 deletions .github/workflows/build_hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
./gradlew :prime-router:primeCLI --args='validate-yaml --type Organizations --file settings/organizations.yml --dir settings/STLTs'
./gradlew :prime-router:primeCLI --args='validate-yaml --type FhirToFhirTransform --dir src/main/resources/metadata/fhir_transforms'
./gradlew :prime-router:primeCLI --args='validate-yaml --type FhirToHL7Mapping --dir src/main/resources/metadata/hl7_mapping'
./gradlew :prime-router:primeCLI --args='validate-yaml --type HL7ToFhirMappingMessageTemplate --dir metadata/HL7/catchall/hl7/message metadata/HL7/v251-elr/hl7/message'
./gradlew :prime-router:primeCLI --args='validate-yaml --type HL7ToFhirMappingResourceTemplate --dir metadata/HL7 --exclude-dir metadata/HL7/catchall/hl7/message metadata/HL7/v251-elr/hl7/message metadata/HL7/v251-elr/hl7/codesystem metadata/HL7/catchall/hl7/codesystem --exclude-file metadata/HL7/catchall/fhir/resourcemapping.yml metadata/HL7/v251-elr/fhir/resourcemapping.yml metadata/HL7/catchall/hl7/resource/Common.yml metadata/HL7/v251-elr/hl7/resource/Common.yml'
./gradlew :prime-router:primeCLI --args='validate-yaml --type HL7ToFhirMappingMessageTemplate --dir metadata/HL7/catchall/hl7/message'
./gradlew :prime-router:primeCLI --args='validate-yaml --type HL7ToFhirMappingResourceTemplate --dir metadata/HL7 --exclude-dir metadata/HL7/catchall/hl7/message metadata/HL7/catchall/hl7/codesystem --exclude-file metadata/HL7/catchall/fhir/resourcemapping.yml metadata/HL7/catchall/hl7/resource/Common.yml'
- name: Check for Uncommited Schema Docs
id: check_changes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/frontend_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
cache-dependency-path: frontend-react/yarn.lock

- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
path: frontend-react/e2e-data
pattern: frontend-e2e-data--shard-*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_to_github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ jobs:
fetch-depth: 0
- name: Download router artifact
if: ${{ needs.wf_vars.outputs.enable_builds == 'true' }}
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: prime-router-build-${{ needs.wf_vars.outputs.version }}
path: archives/
- name: Download frontend artifact
if: ${{ needs.wf_vars.outputs.enable_builds == 'true' }}
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: static-website-react-${{ needs.wf_vars.outputs.version }}
path: archives/
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ hs_err_pid*
**/build/**
**/log/**
**/dependency-reduced-pom.xml
**/version.json

# Frontend build output
**/node_modules/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ test.describe(
await dailyDataPage.page.locator(".usa-table tbody").waitFor({ state: "visible" });
});

test("downloads the file", async ({ dailyDataPage }) => {
test.skip("downloads the file", async ({ dailyDataPage }) => {
await setDate(dailyDataPage.page, "#start-date", 14);
await setDate(dailyDataPage.page, "#end-date", 0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import {
import { tableColumnDateTimeInRange, tableDataCellValue, TEST_ORG_IGNORE } from "../../../helpers/utils";
import { endDate, setDate, startDate } from "../../../pages/authenticated/daily-data";
import * as submissionHistory from "../../../pages/authenticated/submission-history";
import { openReportIdDetailPage, SubmissionHistoryPage } from "../../../pages/authenticated/submission-history";
import {
openReportIdDetailPage,
SubmissionHistoryPage,
URL_SUBMISSION_HISTORY,
} from "../../../pages/authenticated/submission-history";
import { test as baseTest } from "../../../test";

export interface SubmissionHistoryPageFixtures {
Expand Down Expand Up @@ -53,10 +57,6 @@ test.describe(
test.describe("admin user", () => {
test.use({ storageState: "e2e/.auth/admin.json" });

test.beforeAll(({ browserName }) => {
test.skip(browserName !== "chromium");
});

test.describe(`${TEST_ORG_IGNORE} org`, () => {
test("nav contains the 'Submission History' option", async ({ submissionHistoryPage }) => {
const navItems = submissionHistoryPage.page.locator(".usa-nav li");
Expand Down Expand Up @@ -119,22 +119,35 @@ test.describe(
});

test.describe("on 'Filter'", () => {
test("with 'From' date, 'To' date", async ({ submissionHistoryPage }) => {
const fromDate = await setDate(submissionHistoryPage.page, "#start-date", 180);
/**
* TODO: Fix. From/To fields appear to reset (and table data is unchanged)
* after clicking filter
*/
// eslint-disable-next-line playwright/no-skipped-test
test.skip("with 'From' date, 'To' date", async ({ submissionHistoryPage }) => {
const fromDate = await setDate(submissionHistoryPage.page, "#start-date", 7);
const toDate = await setDate(submissionHistoryPage.page, "#end-date", 0);

// Apply button is enabled
await submissionHistoryPage.filterButton.click();
await submissionHistoryPage.page.locator(".usa-table tbody").waitFor({ state: "visible" });

// Check that table data contains the dates/times that were selected
const areDatesInRange = await tableColumnDateTimeInRange(
submissionHistoryPage.page,
1,
fromDate,
toDate,
const responsePromise = await submissionHistoryPage.page.waitForResponse(
(res) => res.status() === 200 && res.url().includes(URL_SUBMISSION_HISTORY),
);
expect(areDatesInRange).toBe(true);

if (responsePromise) {
// Check that table data contains the dates/times that were selected
const areDatesInRange = await tableColumnDateTimeInRange(
submissionHistoryPage.page,
1,
fromDate,
toDate,
);

// eslint-disable-next-line playwright/no-conditional-expect
expect(areDatesInRange).toBe(true);
} else {
console.error("Request not received within the timeout period");
}
});

test("on 'clear' resets the dates", async ({ submissionHistoryPage }) => {
Expand Down
18 changes: 8 additions & 10 deletions frontend-react/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,28 @@ export default defineConfig({
{ name: "setup", testMatch: /\w+\.setup\.ts$/ },
// We have a suite of tests that are ONLY checking links so to
// save bandwidth, we only need to utilize a single browser
{
name: "chromium-only",
use: { browserName: "chromium" },
// currently only uses public pages, uncomment when not the case
// dependencies: ["setup"],
testMatch: "spec/chromium-only/*.spec.ts",
},
{
name: "chromium",
use: { browserName: "chromium" },
dependencies: ["setup"],
testMatch: "spec/all/**/*.spec.ts",
testMatch: [
"spec/all/*.spec.ts",
"spec/all/**/*.spec.ts",
"spec/chromium-only/*.spec.ts",
"spec/chromium-only/**/*.spec.ts",
],
},
{
name: "firefox",
use: { browserName: "firefox" },
dependencies: ["setup"],
testMatch: "spec/all/**/*.spec.ts",
testMatch: ["spec/all/*.spec.ts", "spec/all/**/*.spec.ts"],
},
{
name: "webkit",
use: { browserName: "webkit" },
dependencies: ["setup"],
testMatch: "spec/all/**/*.spec.ts",
testMatch: ["spec/all/*.spec.ts", "spec/all/**/*.spec.ts"],
},
],
webServer: {
Expand Down
1 change: 1 addition & 0 deletions operations/app/terraform/modules/function_app/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ locals {
"RS_OKTA_authkey" = var.RS_OKTA_authKey
"RS_OKTA_ClientId" = var.RS_OKTA_clientId
"ETOR_TI_baseurl" = var.etor_ti_base_url
"cdctiautomated" = var.cdctiautomated_sa
# Manage client secrets via a Key Vault
"CREDENTIAL_STORAGE_METHOD" = "AZURE"
"CREDENTIAL_KEY_VAULT_NAME" = var.client_config_key_vault_name
Expand Down
3 changes: 3 additions & 0 deletions operations/app/terraform/modules/function_app/~inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ variable "RS_OKTA_authKey" {}
variable "RS_OKTA_clientId" {}
variable "RS_OKTA_scope" {}
variable "etor_ti_base_url" {}
variable "cdctiautomated_sa" {
default = ""
}

variable "subnets" {
description = "A set of all available subnet combinations"
Expand Down
6 changes: 6 additions & 0 deletions operations/app/terraform/vars/staging/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,10 @@ data "azurerm_key_vault_secret" "RS_OKTA_authKey" {
name = "functionapp-RS-OKTA-authkey"
key_vault_id = data.azurerm_key_vault.app_config.id

}

data "azurerm_key_vault_secret" "cdctiautomated_sa" {
name = "functionapp-cdctiautomated"
key_vault_id = data.azurerm_key_vault.app_config.id

}
1 change: 1 addition & 0 deletions operations/app/terraform/vars/staging/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ module "function_app" {
RS_OKTA_clientId = data.azurerm_key_vault_secret.RS_OKTA_clientId.value
RS_OKTA_authKey = data.azurerm_key_vault_secret.RS_OKTA_authKey.value
etor_ti_base_url = local.init.etor_ti_base_url
cdctiautomated_sa = data.azurerm_key_vault_secret.cdctiautomated_sa.value
}

module "front_door" {
Expand Down
16 changes: 16 additions & 0 deletions prime-router/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import org.apache.commons.io.FilenameUtils
import org.apache.tools.ant.filters.ReplaceTokens
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jooq.meta.jaxb.ForcedType
import java.io.ByteArrayOutputStream
import java.io.FileInputStream
import java.nio.charset.StandardCharsets
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.Properties
Expand Down Expand Up @@ -498,9 +500,22 @@ tasks.azureFunctionsPackage {
finalizedBy("copyAzureScripts")
}

tasks.register("generateVersionFile") {
doLast {
val stdout = ByteArrayOutputStream()
exec {
commandLine("git", "rev-parse", "--short", "HEAD")
standardOutput = stdout
}
val currentCommit = stdout.toString(StandardCharsets.UTF_8).trim()
File("./version.json").writeText("{\"commitId\": \"$currentCommit\"}")
}
}

val azureResourcesTmpDir = File(buildDir, "$azureFunctionsDir-resources/$azureAppName")
val azureResourcesFinalDir = File(buildDir, "$azureFunctionsDir/$azureAppName")
tasks.register<Copy>("gatherAzureResources") {
dependsOn("generateVersionFile")
from("./")
into(azureResourcesTmpDir)
include("metadata/**/*.yml")
Expand All @@ -510,6 +525,7 @@ tasks.register<Copy>("gatherAzureResources") {
include("metadata/**/*.csv")
include("settings/**/*.yml")
include("assets/**/*__inline.html")
include("version.json")
}

tasks.register("copyAzureResources") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ v251. That presents the opportunity for reuse.

1. Review existing data type mappings located in `prime-router/metadata/HL7/datatypes/` for reuse
2. Add folder to `prime-router/metadata/HL7/` with a name indicating the new conformance profile
3. Copy folder `fhir` from `prime-router/metadata/HL7/v251-elr` and add to your new mapping folder.
3. Copy folder `fhir` from `prime-router/metadata/HL7/catchall` and add to your new mapping folder.
4. Create folder `hl7` in your new mapping folder with the following sub-folders:
- "message" - **required** - within that, add a yml file named with the HL7 message type (ex ORU_R01, ORM_O01,
ADT_A01, etc.)
Expand Down
Loading

0 comments on commit 2ca50e3

Please sign in to comment.