Skip to content
Draft
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
116 changes: 116 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"dependencies": {
"@aws-sdk/client-s3": "^3.515.0",
"@axe-core/playwright": "^4.10.2",
"@azure/functions": "^4.7.2-preview",
"@mdx-js/loader": "^3.1.0",
"@mdx-js/react": "^3.1.0",
"@next/mdx": "^15.3.5",
Expand All @@ -43,9 +44,10 @@
"next": "^15.3.5",
"next-auth": "^5.0.0-beta.29",
"next-nprogress-bar": "^2.4.4",
"node-fetch": "^2.7.0",
"node-hl7-client": "^3.0.0",
"pg-promise": "^11.15.0",
"pg": "^8.16.3",
"pg-promise": "^11.15.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-highlight-words": "^0.21.0",
Expand All @@ -72,6 +74,7 @@
"@types/fhir": "^0.0.40",
"@types/jest-axe": "^3.5.9",
"@types/node": "^22.13.9",
"@types/node-fetch": "^2.6.13",
"@types/pg": "^8.15.5",
"@types/react": "19.1.6",
"@types/react-dom": "19.1.5",
Expand Down
2 changes: 1 addition & 1 deletion src/docs/deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ If using Microsoft Entra ID:

- Go to Azure Portal > Microsoft Entra ID > App registrations.
- Create a new registration.
- Set the redirect URI to: `https://your-query-connector-url/api/auth/callback/microsoft-entra`.
- Set the redirect URI to: `https://your-query-connector-url/api/auth/callback/microsoft-entra-id`.

2. **Configure API permissions**:

Expand Down
32 changes: 32 additions & 0 deletions terraform/implementation/app_function/config.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* The Terraform Azure backend requires a pre-existing Azure Storage Account and a container to store the state file. If you do not already
* have a pre-configured resource for this, we recommend setting one up manually.
*
* WARNING: Make sure you don't use the same resource group for your state storage and your DIBBs resources to avoid accidental deletion.
* DIBBs resources should be deployed in their own resource group.
*/
terraform {
backend "azurerm" {
resource_group_name = "qc-aca-rg" // TODO: Change this to match the resource group that contains your storage account for Terraform state storage.
storage_account_name = "qcacastorageaccount" // TODO: Change this to match the storage account that contains/will contain your Terraform state files.
container_name = "tfstate" // We recommend leaving this alone, to keep state files separate from the rest of your resources.
key = "dev/app_func/terraform.tfstate" // TODO: Change the prefix to match the environment you are working in.
}
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.116.0"
}
random = {
source = "hashicorp/random"
version = "3.7.2"
}
}
required_version = "~> 1.9.8"
}

provider "azurerm" {
features {}
skip_provider_registration = true
}

7 changes: 7 additions & 0 deletions terraform/implementation/app_function/dist/host.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.0.0, 5.0.0)"
}
}
2 changes: 2 additions & 0 deletions terraform/implementation/app_function/dist/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import "./src/functions/ProcessHL7/process-hl7";
import "./src/functions/PostHL7/post-hl7";
92 changes: 92 additions & 0 deletions terraform/implementation/app_function/dist/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions terraform/implementation/app_function/dist/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "app-func",
"version": "1.0.0",
"main": "src/functions/ProcessHL7/process-hl7.js",
"scripts": {
"compile": "tsc",
"build": "npm run compile",
"start": "func start"
},
"dependencies": {
"@azure/functions": "^4.0.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"typescript": "^5.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.postHL7 = postHL7;
/**
* Sends a raw HL7v2 message to the Query Connector API as text/plain.
* @param root0 - The parameters for the HL7 query.
* @param root0.endpoint - The endpoint URL of the Query Connector API.
* @param root0.queryId - The unique identifier for the query.
* @param root0.fhirServer - The FHIR server to associate with the query.
* @param root0.serviceToken - The service token for authentication.
* @param root0.hl7Message - The HL7v2 message to be sent.
* @returns A promise that resolves to the fetch response.
*/
async function postHL7({
endpoint,
queryId,
fhirServer,
serviceToken,
hl7Message,
}) {
const url = `${endpoint}?id=${encodeURIComponent(queryId)}&fhir_server=${encodeURIComponent(fhirServer)}&message_format=HL7`;
return fetch(url, {
method: "POST",
headers: {
"Content-Type": "text/plain",
Authorization: `Bearer ${serviceToken}`,
},
body: hl7Message,
});
}
Loading