Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "10510: remove support for relative pathing and schema setting normalization" #13597

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions prime-router/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -95,26 +95,6 @@ val reportsApiEndpointHost = (
?: "localhost"
)

// This storage account key is not a secret, just a dummy value.
val devAzureConnectString =
"DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=" +
"Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=" +
"http://localhost:10000/devstoreaccount1;QueueEndpoint=http://localhost:10001/devstoreaccount1;"

val env = mutableMapOf<String, Any>(
"AzureWebJobsStorage" to devAzureConnectString,
"AzureBlobDownloadRetryCount" to 5,
"PartnerStorage" to devAzureConnectString,
"POSTGRES_USER" to dbUser,
"POSTGRES_PASSWORD" to dbPassword,
"POSTGRES_URL" to dbUrl,
"PRIME_ENVIRONMENT" to "local",
"VAULT_API_ADDR" to "http://localhost:8200",
"SFTP_HOST_OVERRIDE" to "localhost",
"SFTP_PORT_OVERRIDE" to "2222",
"RS_OKTA_baseUrl" to "reportstream.oktapreview.com"
)

val jooqSourceDir = "build/generated-src/jooq/src/main/java"
val jooqPackageName = "gov.cdc.prime.router.azure.db"

Expand Down Expand Up @@ -417,7 +397,6 @@ tasks.register<JavaExec>("primeCLI") {
environment["POSTGRES_PASSWORD"] = dbPassword
environment[KEY_PRIME_RS_API_ENDPOINT_HOST] = reportsApiEndpointHost
addVaultValuesToEnv(environment)
environment(env)

// Use arguments passed by another task in the project.extra["cliArgs"] property.
doFirst {
Expand Down Expand Up @@ -601,6 +580,26 @@ tasks.azureFunctionsRun {
dependsOn("composeUp")
dependsOn("uploadSwaggerUI").mustRunAfter("composeUp")

// This storage account key is not a secret, just a dummy value.
val devAzureConnectString =
"DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=" +
"Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=" +
"http://localhost:10000/devstoreaccount1;QueueEndpoint=http://localhost:10001/devstoreaccount1;"

val env = mutableMapOf<String, Any>(
"AzureWebJobsStorage" to devAzureConnectString,
"AzureBlobDownloadRetryCount" to 5,
"PartnerStorage" to devAzureConnectString,
"POSTGRES_USER" to dbUser,
"POSTGRES_PASSWORD" to dbPassword,
"POSTGRES_URL" to dbUrl,
"PRIME_ENVIRONMENT" to "local",
"VAULT_API_ADDR" to "http://localhost:8200",
"SFTP_HOST_OVERRIDE" to "localhost",
"SFTP_PORT_OVERRIDE" to "2222",
"RS_OKTA_baseUrl" to "reportstream.oktapreview.com"
)

// Load the vault variables
addVaultValuesToEnv(env)

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
24 changes: 12 additions & 12 deletions prime-router/settings/organizations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,19 @@
organizationName: ignore
topic: full-elr
customerStatus: active
schemaName: classpath:/metadata/fhir_transforms/senders/original-pipeline-transforms.yml
schemaName: metadata/fhir_transforms/senders/original-pipeline-transforms
format: HL7
- name: dev-simple-report # Use this to test full-elr
organizationName: ignore
topic: full-elr
customerStatus: active
schemaName: classpath:/metadata/fhir_transforms/senders/SimpleReport/simple-report-sender-transform.yml
schemaName: metadata/fhir_transforms/senders/SimpleReport/simple-report-sender-transform
format: FHIR
- name: ignore-etor-ti # Use this to test etor-ti
organizationName: ignore
topic: etor-ti
customerStatus: active
schemaName: classpath:/metadata/fhir_transforms/senders/original-pipeline-transforms.yml
schemaName: metadata/fhir_transforms/senders/original-pipeline-transforms
format: HL7
- name: ignore-elr-elims # Use this to test elr-elims
organizationName: ignore
Expand All @@ -127,13 +127,13 @@
organizationName: ignore
topic: full-elr
customerStatus: active
schemaName: classpath:/metadata/fhir_transforms/senders/HCI/hci-sender-transform.yml
schemaName: metadata/fhir_transforms/senders/HCI/hci-sender-transform
format: HL7
- name: ignore-fhir # Use this to test fhir
organizationName: ignore
topic: full-elr
customerStatus: active
schemaName: classpath:/metadata/fhir_transforms/senders/SimpleReport/simple-report-sender-transform.yml
schemaName: metadata/fhir_transforms/senders/SimpleReport/simple-report-sender-transform
format: FHIR
- name: ignore-strac # Use this to test sending strac data
organizationName: ignore
Expand Down Expand Up @@ -226,7 +226,7 @@
numberPerDay: 1440 # Every minute
initialTime: 00:00
translation: !<HL7>
schemaName: "classpath:/metadata/hl7_mapping/receivers/STLTs/CO/CO.yml"
schemaName: "metadata/hl7_mapping/receivers/STLTs/CO/CO"
useTestProcessingMode: false
useBatchHeaders: true
type: "HL7"
Expand Down Expand Up @@ -255,7 +255,7 @@
numberPerDay: 1440 # Every minute
initialTime: 00:00
translation: !<HL7>
schemaName: "classpath:/metadata/hl7_mapping/receivers/STLTs/CO/CO.yml"
schemaName: "metadata/hl7_mapping/receivers/STLTs/CO/CO"
useTestProcessingMode: false
useBatchHeaders: true
type: "HL7"
Expand All @@ -280,7 +280,7 @@
numberPerDay: 1440 # Every minute
initialTime: 00:00
translation: !<HL7>
schemaName: "classpath:/metadata/hl7_mapping/ORU_R01/ORU_R01-base.yml"
schemaName: "metadata/hl7_mapping/ORU_R01/ORU_R01-base"
useBatchHeaders: true
type: "HL7"
transport:
Expand Down Expand Up @@ -987,7 +987,7 @@
numberPerDay: 1440 # Every minute
initialTime: 00:00
translation: !<HL7>
schemaName: "classpath:/metadata/hl7_mapping/receivers/STLTs/CA/CA-receiver-transform.yml"
schemaName: "metadata/hl7_mapping/receivers/STLTs/CA/CA-receiver-transform"
useTestProcessingMode: false
useBatchHeaders: true
type: "HL7"
Expand Down Expand Up @@ -1015,7 +1015,7 @@
numberPerDay: 1440 # Every minute
initialTime: 00:00
translation: !<HL7>
schemaName: "classpath:/metadata/hl7_mapping/ORU_R01/RADx_MARS/RADx_MARS-base.yml"
schemaName: "metadata/hl7_mapping/ORU_R01/RADx_MARS/RADx_MARS-base"
useTestProcessingMode: false
useBatchHeaders: true
type: "HL7"
Expand All @@ -1040,7 +1040,7 @@
numberPerDay: 1440 # Every minute
initialTime: 00:00
translation: !<HL7>
schemaName: "classpath:/metadata/hl7_mapping/ORU_R01/RADx_MARS/RADx_MARS-base-deidentified.yml"
schemaName: "metadata/hl7_mapping/ORU_R01/RADx_MARS/RADx_MARS-base-deidentified"
useTestProcessingMode: false
useBatchHeaders: true
type: "HL7"
Expand All @@ -1066,7 +1066,7 @@
numberPerDay: 1440 # Every minute
initialTime: 00:00
translation: !<HL7>
schemaName: "classpath:/metadata/hl7_mapping/ORU_R01/ORU_R01-base.yml"
schemaName: "metadata/hl7_mapping/ORU_R01/ORU_R01-base"
useTestProcessingMode: false
useBatchHeaders: false
type: "HL7"
Expand Down
4 changes: 1 addition & 3 deletions prime-router/src/main/kotlin/Receiver.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package gov.cdc.prime.router

import com.fasterxml.jackson.annotation.JsonIgnore
import gov.cdc.prime.router.azure.BlobAccess
import gov.cdc.prime.router.common.DateUtilities
import gov.cdc.prime.router.fhirengine.translation.hl7.FhirToHl7Converter
import gov.cdc.prime.router.fhirengine.translation.hl7.SchemaException
Expand Down Expand Up @@ -255,8 +254,7 @@ open class Receiver(
if (translation is CustomConfiguration) {
if (this.topic.isUniversalPipeline) {
try {
// This is already scheduled for deletion in https://github.com/CDCgov/prime-reportstream/pull/13313
FhirToHl7Converter(translation.schemaName, BlobAccess.defaultBlobMetadata)
FhirToHl7Converter(translation.schemaName)
} catch (e: SchemaException) {
return e.message
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import com.microsoft.azure.functions.annotation.FunctionName
import com.microsoft.azure.functions.annotation.StorageAccount
import gov.cdc.prime.router.common.Environment
import gov.cdc.prime.router.fhirengine.translation.TranslationSchemaManager
import org.apache.logging.log4j.kotlin.Logging

/**
* Functions in this class are part of the workflow to sync translation schemas between azure blob stores. There exists
* one for each kind of schema (FHIR->FHIR, FHIR->HL7) and each function is triggered when a validating.txt blob is
* added to the respective directory.
*/
class ValidateSchemasFunctions : Logging {
class ValidateSchemasFunctions {

private val translationSchemaManager = TranslationSchemaManager()

Expand Down Expand Up @@ -45,7 +44,7 @@ class ValidateSchemasFunctions : Logging {
fun validateFHIRToHL7Schemas(
@BlobTrigger(
name = "validatingFile",
path = "metadata/hl7_mapping/validating.txt"
path = "metadata/hl7_mappings/validating.txt"
) @Suppress("UNUSED_PARAMETER") content: Array<Byte>,
) {
val blobConnectionString = Environment.get().blobEnvVar
Expand Down Expand Up @@ -77,10 +76,8 @@ class ValidateSchemasFunctions : Logging {
val validationState = translationSchemaManager.retrieveValidationState(schemaType, blobContainerMetadata)
if (results.all { it.passes }) {
translationSchemaManager.handleValidationSuccess(schemaType, validationState, blobContainerMetadata)
logger.info("Successfully validated schema changes.")
} else {
translationSchemaManager.handleValidationFailure(schemaType, validationState, blobContainerMetadata)
logger.error("Schemas did not pass validation and changes were rolled back.")
}
}
}
Loading