Setup the resources for provisioning Clinical Trials search
Перейти к файлу
yochai lehman 8f3eb8a568 find clinical trials for sars-cov-2 2020-07-06 14:09:31 +03:00
.vscode fix upload of luis models with utf8 2020-02-28 18:02:38 +02:00
arm-templates yochai/enable_ARRAffinity 2020-06-25 11:19:31 +03:00
bot-templates fixing minor bugs 2020-06-22 16:53:04 +03:00
functional-tests yochai/add_ecog_to_func_testing 2020-07-01 19:44:28 +03:00
images 1) stop primary structuring aci on deploy to avoid 2 ACIs running at same time 2020-05-03 19:18:51 +03:00
lu find clinical trials for sars-cov-2 2020-07-06 14:09:31 +03:00
scripts yochai/add_func_test_app 2020-06-21 13:15:07 +03:00
.gitattributes Initialize Docs repository: https://github.com/microsoft/ClinicalTrialsBlueprint of branch master 2020-02-13 08:56:58 +00:00
.gitignore Initial commit 2020-01-22 18:04:08 +00:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2020-01-22 10:04:11 -08:00
LICENSE Initial LICENSE commit 2020-01-22 10:04:13 -08:00
LICENSE-CODE Initialize Docs repository: https://github.com/microsoft/ClinicalTrialsBlueprint of branch master 2020-02-13 08:56:58 +00:00
README.md yochai/add_func_test_app 2020-06-21 13:15:07 +03:00
SECURITY.md Initial SECURITY.md commit 2020-01-22 10:04:15 -08:00
ThirdPartyNotices.md Initialize Docs repository: https://github.com/microsoft/ClinicalTrialsBlueprint of branch master 2020-02-13 08:56:58 +00:00

README.md

Clinical Trials Matching Service Blueprint

Requirements

Clone this repository to your local drive

git clone https://github.com/microsoft/ClinicalTrialsBlueprint
cd ClinicalTrialsBlueprint

Install the Azure PowerShell module

Connect to Azure Subscription

Login-AzAccount
$account = Set-AzContext -Subscription <Your Subscription Name>

Fill Parameters

Assign a name for the matching service

$ctmServiceName = "<ctm matching service>"

also fill the parameter files with missing parameters and chosen service same as $ctmServiceName

.\arm-templates\azuredeploy-fhir.parameters.json
.\arm-templates\azuredeploy-logicapps.parameters.json
.\arm-templates\azuredeploy-ctm.parameters.json

Setup the FHIR Server

Create a Resource group for the FHIR server. It must be in a separate resource group from other resources in the blueprint becuase we are creating a Windows service plan

$fhirRg = New-AzResourceGroup -Name <fhir server group name> -Location eastus

Create the FHIR server deployment. You will to provide a admin password for the SQL server

New-AzResourceGroupDeployment -ResourceGroupName $fhirRg.ResourceGroupName `
                              -TemplateFile .\arm-templates\azuredeploy-fhir.json `
                              -TemplateParameterFile .\arm-templates\azuredeploy-fhir.parameters.json 
                              

Create secondary FHIR server

New-AzResourceGroupDeployment -ResourceGroupName $fhirRg.ResourceGroupName `
                              -TemplateFile .\arm-templates\azuredeploy-fhir.json `
                              -TemplateParameterFile .\arm-templates\azuredeploy-fhir.parameters.json `
                              -isSecondary $true

Verify that the FHIR Server is running

$metadataUrl = "https://$ctmServiceName-fhir.azurewebsites.net/metadata" 
$metadata = Invoke-WebRequest -Uri $metadataUrl
$metadata.RawContent

It will take a minute or so for the server to respond the first time.

Setup the Matching service

Create Resource Group that will contain all the resources required for the blueprint resources

$ctmRg = New-AzResourceGroup -Name <service Name> -Location eastus

Create Logic Applications to manage automatic restructuring

$logicAppsOutput = New-AzResourceGroupDeployment -ResourceGroupName $ctmRg.ResourceGroupName `
                  -TemplateFile .\arm-templates\azuredeploy-logicapps.json `
                  -TemplateParameterFile .\arm-templates\azuredeploy-logicapps.parameters.json `
                  -accountId (Get-AzContext).Account.Id

Open resource group in azure portal and authorize 2 API connections (arm and office365)

arm azure arm authorize

Create Primary Clinical Trials Matching service Azure resources

$matchingOutput = New-AzResourceGroupDeployment -ResourceGroupName $ctmRg.ResourceGroupName `
                  -TemplateFile .\arm-templates\azuredeploy-ctm.json `
                  -TemplateParameterFile .\arm-templates\azuredeploy-ctm.parameters.json 

Stopping primary structuring instance

. .\scripts\structuring.ps1
Stop-CtmStructuring -resourceGroupName $ctmRg.ResourceGroupName -containerGroupName $matchingOutput.Outputs.structuringName.Value

Create Secondary Clinical Trials Matching service that will be used as the primary service is being serviced. You need only to pass isSecondary parameter as true

$matchingSecondaryOutput = New-AzResourceGroupDeployment -ResourceGroupName $ctmRg.ResourceGroupName `
                          -TemplateFile .\arm-templates\azuredeploy-ctm.json `
                          -TemplateParameterFile .\arm-templates\azuredeploy-ctm.parameters.json `
                          -isSecondary $true 
                

Check that the TextAnalytics for Healthcare service is running and ready

$taReadyUrl = $matchingOutput.Outputs.gatewayEndpoint.Value + "/ta4h/ready"
$taReadyResponse = Invoke-WebRequest -Uri $taReadyUrl
$taReadyResponse.RawContent

Check that the Query Engine Service is running

$queryUrl = $matchingOutput.Outputs.gatewayEndpoint.Value + "/qe"
$queryResponse = Invoke-WebRequest -Uri $queryUrl
$queryResponse.RawContent

Check that the Disqualification Engine Service is running

$disqualificationUrl = $matchingOutput.Outputs.gatewayEndpoint.Value + "/disq"
$disqualificationResponse = Invoke-WebRequest -Uri $disqualificationUrl
$disqualificationResponse.RawContent

Restrict Access to service

. .\scripts\restrictAccess.ps1
Add-CTMRestrictIPs -resourceGroupName $ctmRg.ResourceGroupName -serviceName $ctmServiceName `
                   -fhirResoureGroupName $fhirRg.ResourceGroupName 

Setup the Healthcare Bot Service

Assign the Healthcare Bot service name

$botServiceName = "<healthcare bot service>"
$secondaryBotServiceName = "<secondary healthcare bot service>"

Load the marketplace script

. .\scripts\marketplace.ps1

Create the Healthcare primary and secondary bots Azure Marketplace SaaS Application

$saasSubscriptionId =  New-HbsSaaSApplication -name $botServiceName -planId free
$secondarySaaSSubscriptionId =  New-HbsSaaSApplication -name $secondaryBotServiceName -planId free

You can also see all your existing SaaS applications by running this command.

Get-HbsSaaSApplication

Deploy a primary Healthcare Bot resources for the Marketplace SaaS application you just created or already had before.

.\scripts\azuredeploy-healthcarebot.ps1 -ResourceGroup $ctmRg.ResourceGroupName `
                -saasSubscriptionId $saasSubscriptionId  -serviceName $botServiceName `
                -botLocation US -matchingOutput $matchingOutput 

You can now deploy a secondary Healthcare bot by running this command

.\scripts\azuredeploy-healthcarebot.ps1 -ResourceGroup $ctmRg.ResourceGroupName `
                -saasSubscriptionId $secondarySaaSSubscriptionId  `
                -serviceName $secondaryBotServiceName `
                -botLocation US -matchingOutput $matchingSecondaryOutput 

Configuration Change

When it's necessary to change the configuration of the matching services, Update the parameters file

.\arm-templates\azuredeploy-ctm.parameters.json

With the wanted configuration and run the following

. .\scripts\config-change.ps1
ChangeConfig -resourceGroupName <resource group name> -serviceName <service name>

Notice that, a configuration change will not be permited if a Structuring process is running.