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
15 changes: 9 additions & 6 deletions app/Console/Commands/AddDataProviderNetwork.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ class AddDataProviderNetwork extends Command
*
* @var string
*/
protected $description = 'Data Provider Network for import, based on file "../storage/migration_files/data_provider_networkv3.csv"';
protected $description = 'Data Provider Network for import, based on file "../storage/migration_files/data_provider_networkv3-Introduction.csv"';

private $csvData = [];

public function __construct()
{
parent::__construct();
$this->readMigrationFile(storage_path() . '/migration_files/data_provider_networkv3.csv');
$this->readMigrationFile(storage_path() . '/migration_files/data_provider_networkv3-Introduction.csv');
}

/**
* Execute the console command.
*/
public function handle()
{
$askDataProviderNetwork = $this->ask('Data Provider Network for import, based on file "../storage/migration_files/data_provider_networkv3.csv"? [default value all]', 'all');
$askDataProviderNetwork = $this->ask('Data Provider Network for import, based on file "../storage/migration_files/data_provider_networkv3-Introduction.csv"? [default value all]', 'all');
$askInitDataProviderNetwork = $this->ask('Do you want to initialize the database for "Data Provider Network"? yes/no [default value no]', 'no');

if ($askInitDataProviderNetwork === 'yes') {
Expand All @@ -50,8 +50,9 @@ public function handle()
foreach ($csvData as $item) {
$teamName = strtoupper(trim($item['Data provider/Team']));
$dataProviderName = strtoupper(trim($item['Data provider network']));
$dataProviderSummary = htmlentities(trim($item['Summary']));

$return = $this->dataProviderNetworkTeam($dataProviderName, $teamName);
$return = $this->dataProviderNetworkTeam($dataProviderName, $teamName, $dataProviderSummary);
if (!$return) {
continue;
}
Expand All @@ -64,21 +65,22 @@ public function handle()
foreach ($csvData as $item) {
$teamName = strtoupper(trim($item['Data provider/Team']));
$dataProviderName = strtoupper(trim($item['Data provider network']));
$dataProviderSummary = strtoupper(trim($item['Summary']));

if ($inputDataProviderName !== $dataProviderName) {
echo 'Found Data Provider Network name ' . $dataProviderName . '. skipping ...' . PHP_EOL;
continue;
}

$return = $this->dataProviderNetworkTeam($dataProviderName, $teamName);
$return = $this->dataProviderNetworkTeam($dataProviderName, $teamName, $dataProviderSummary);
if (!$return) {
continue;
}
}
}
}

private function dataProviderNetworkTeam(string $dataProviderNetworkName, string $teamName): bool
private function dataProviderNetworkTeam(string $dataProviderNetworkName, string $teamName, string $dataProviderSummary = null): bool
{
// check in teams
$team = Team::where('name', $teamName)->first();
Expand All @@ -94,6 +96,7 @@ private function dataProviderNetworkTeam(string $dataProviderNetworkName, string
'name' => $dataProviderNetworkName,
'enabled' => 1,
'img_url' => null,
'summary' => $dataProviderSummary,
]);

echo 'Data Provider network with name ' . $dataProviderNetworkName . ' was created.' . PHP_EOL;
Expand Down
12 changes: 12 additions & 0 deletions storage/migration_files/data_provider_networkv3-Introduction.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Data provider network,Data provider/Team,Summary
SNSDE,Wessex SDE,The NHS Research Secure Data Environment (SDE) Network is made up of 12 SDEs who provide secure access to healthcare data for research and innovation.
SNSDE,NHS England,The NHS Research Secure Data Environment (SDE) Network is made up of 12 SDEs who provide secure access to healthcare data for research and innovation.
SNSDE,KMS SDE,The NHS Research Secure Data Environment (SDE) Network is made up of 12 SDEs who provide secure access to healthcare data for research and innovation.
Scottish Safe Haven Network,Public Health Scotland,"The Scottish Safe Haven Network (SSHN), which began operations in 2014, is responsible for managing access to NHS Scotland data for secondary use that benefits the public. Coordinated by Research Data Scotland, the network is made up of four accredited re"
Scottish Safe Haven Network,DataLoch,"The Scottish Safe Haven Network (SSHN), which began operations in 2014, is responsible for managing access to NHS Scotland data for secondary use that benefits the public. Coordinated by Research Data Scotland, the network is made up of four accredited re"
Scottish Safe Haven Network,Health Informatics Centre (HIC),"The Scottish Safe Haven Network (SSHN), which began operations in 2014, is responsible for managing access to NHS Scotland data for secondary use that benefits the public. Coordinated by Research Data Scotland, the network is made up of four accredited re"
Scottish Safe Haven Network,West of Scotland Safe Haven,"The Scottish Safe Haven Network (SSHN), which began operations in 2014, is responsible for managing access to NHS Scotland data for secondary use that benefits the public. Coordinated by Research Data Scotland, the network is made up of four accredited re"
Scottish Safe Haven Network,Grampian Data Safe Haven (DaSH),"The Scottish Safe Haven Network (SSHN), which began operations in 2014, is responsible for managing access to NHS Scotland data for secondary use that benefits the public. Coordinated by Research Data Scotland, the network is made up of four accredited re"
Secure eResearch Platform (SeRP),DPUK DATA Portal,SAIL (saildatabank.com) operates on SeRPUK (serp.ac.uk) as one of many tenancies. SeRP provides appropriate technology stacks in line with the tenancy requirements to support research projects executed within ownership and governance tenancies. SeRP curre
Secure eResearch Platform (SeRP),BREATHE,SAIL (saildatabank.com) operates on SeRPUK (serp.ac.uk) as one of many tenancies. SeRP provides appropriate technology stacks in line with the tenancy requirements to support research projects executed within ownership and governance tenancies. SeRP curre
Secure eResearch Platform (SeRP),UK Longitudinal Linkage Collaboration (UK LLC),SAIL (saildatabank.com) operates on SeRPUK (serp.ac.uk) as one of many tenancies. SeRP provides appropriate technology stacks in line with the tenancy requirements to support research projects executed within ownership and governance tenancies. SeRP curre