Skip to content

Commit

Permalink
Change pipeline to only upload ELRs to FHIR server
Browse files Browse the repository at this point in the history
  • Loading branch information
nickclyde committed Oct 30, 2023
1 parent b33fdea commit 41374fb
Showing 1 changed file with 79 additions and 58 deletions.
137 changes: 79 additions & 58 deletions terraform/modules/data_factory/ingestion-pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,8 @@
}
},
{
"name": "upload_fhir_bundle",
"description": "Compute a hashed identifier that can be used for record linkage.",
"type": "WebActivity",
"name": "case_type_elr_if_condition",
"type": "IfCondition",
"dependsOn": [
{
"activity": "record_linkage",
Expand All @@ -531,66 +530,88 @@
]
}
],
"policy": {
"timeout": "0.12:00:00",
"retry": 3,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"url": "${ingestion_container_url}/fhir/transport/http/upload_bundle_to_fhir_server",
"method": "POST",
"body": {
"value": "{\n \"fhir_url\": \"${fhir_server_url}\",\n \"bundle\": @{activity('record_linkage').output.updated_bundle},\n \"cred_manager\": \"azure\"\n}",
"type": "Expression"
},
"authentication": {
"resource": "api://phdi-${environment}-ingestion",
"credential": {
"referenceName": "pipeline-runner-credential",
"type": "CredentialReference"
},
"type": "UserAssignedManagedIdentity"
}
}
},
{
"name": "log_fhir_upload_failure",
"description": "Write FHIR upload failures to storage.",
"type": "WebActivity",
"dependsOn": [
{
"activity": "upload_fhir_bundle",
"dependencyConditions": [
"Failed"
]
}
],
"policy": {
"timeout": "0.12:00:00",
"retry": 3,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"url": "${ingestion_container_url}/cloud/storage/write_blob_to_storage",
"method": "POST",
"body": {
"value": "{\n \"blob\": @{activity('upload_fhir_bundle').output.message},\n \"cloud_provider\": \"azure\",\n \"bucket_name\": \"${fhir_upload_failures_container_name}\",\n \"file_name\": \"@{concat(substring(pipeline().parameters.filename, 12, 4), pipeline().RunId, '_', substring(pipeline().parameters.filename, 16, sub(length(pipeline().parameters.filename),length(substring(pipeline().parameters.filename, 0, add(length('source_data/'), 4))))))}\"\n}",
"expression": {
"value": "@equals(pipeline().parameters.message_type, 'elr')",
"type": "Expression"
},
"authentication": {
"resource": "api://phdi-${environment}-ingestion",
"credential": {
"referenceName": "pipeline-runner-credential",
"type": "CredentialReference"
"ifTrueActivities": [
{
"name": "upload_fhir_bundle",
"description": "Compute a hashed identifier that can be used for record linkage.",
"type": "WebActivity",
"dependsOn": [
{
"activity": "record_linkage",
"dependencyConditions": [
"Succeeded"
]
}
],
"policy": {
"timeout": "0.12:00:00",
"retry": 3,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"url": "${ingestion_container_url}/fhir/transport/http/upload_bundle_to_fhir_server",
"method": "POST",
"body": {
"value": "{\n \"fhir_url\": \"${fhir_server_url}\",\n \"bundle\": @{activity('record_linkage').output.updated_bundle},\n \"cred_manager\": \"azure\"\n}",
"type": "Expression"
},
"authentication": {
"resource": "api://phdi-${environment}-ingestion",
"credential": {
"referenceName": "pipeline-runner-credential",
"type": "CredentialReference"
},
"type": "UserAssignedManagedIdentity"
}
}
},
"type": "UserAssignedManagedIdentity"
}
{
"name": "log_fhir_upload_failure",
"description": "Write FHIR upload failures to storage.",
"type": "WebActivity",
"dependsOn": [
{
"activity": "upload_fhir_bundle",
"dependencyConditions": [
"Failed"
]
}
],
"policy": {
"timeout": "0.12:00:00",
"retry": 3,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"url": "${ingestion_container_url}/cloud/storage/write_blob_to_storage",
"method": "POST",
"body": {
"value": "{\n \"blob\": @{activity('upload_fhir_bundle').output.message},\n \"cloud_provider\": \"azure\",\n \"bucket_name\": \"${fhir_upload_failures_container_name}\",\n \"file_name\": \"@{concat(substring(pipeline().parameters.filename, 12, 4), pipeline().RunId, '_', substring(pipeline().parameters.filename, 16, sub(length(pipeline().parameters.filename),length(substring(pipeline().parameters.filename, 0, add(length('source_data/'), 4))))))}\"\n}",
"type": "Expression"
},
"authentication": {
"resource": "api://phdi-${environment}-ingestion",
"credential": {
"referenceName": "pipeline-runner-credential",
"type": "CredentialReference"
},
"type": "UserAssignedManagedIdentity"
}
}
}
]
}
}
],
Expand Down

0 comments on commit 41374fb

Please sign in to comment.