This commit is contained in:
Ty Clifford
2026-07-03 17:42:16 -04:00
parent c1cb93083e
commit c5ec4f4c7e
18 changed files with 30 additions and 29 deletions
+6 -6
View File
@@ -1889,7 +1889,7 @@ function medicine_rows_with_use_summary(array $rows): array
function therapeutic_relationship_source_name(): string
{
return 'Neon therapeutic-use relationships';
return 'Medical Tracker therapeutic-use relationships';
}
function therapeutic_relationship_source_url(): string
@@ -2197,7 +2197,7 @@ function relationship_common_use(array $rules): string
function seed_medical_relationships(PDO $pdo, bool $force = false): void
{
$version = '2026-07-03-therapeutic-links-v5';
$version = '2026-07-03-therapeutic-links-v6';
$medicineCount = (int) db_value($pdo, 'SELECT COUNT(*) FROM medication_catalog');
$conditionCount = (int) db_value($pdo, 'SELECT COUNT(*) FROM medical_conditions');
$symptomCount = (int) db_value($pdo, 'SELECT COUNT(*) FROM medical_symptoms');
@@ -2247,8 +2247,8 @@ function seed_medical_relationships(PDO $pdo, bool $force = false): void
}
try {
$pdo->prepare('DELETE FROM medication_condition_links WHERE source_name = ?')->execute([$sourceName]);
$pdo->prepare('DELETE FROM medication_symptom_links WHERE source_name = ?')->execute([$sourceName]);
$pdo->prepare('DELETE FROM medication_condition_links WHERE source_name IN (?, ?)')->execute([$sourceName, 'Neon therapeutic-use relationships']);
$pdo->prepare('DELETE FROM medication_symptom_links WHERE source_name IN (?, ?)')->execute([$sourceName, 'Neon therapeutic-use relationships']);
foreach ($medicines as $medicine) {
$haystack = relationship_haystack($medicine);
@@ -3028,7 +3028,7 @@ function http_json(string $url, int $timeout = 20): ?array
'http' => [
'method' => 'GET',
'timeout' => $timeout,
'header' => "Accept: application/json\r\nUser-Agent: NeonMedicalTracker/1.0\r\n",
'header' => "Accept: application/json\r\nUser-Agent: MedicalTracker/1.0\r\n",
],
]);
$body = @file_get_contents($url, false, $context);
@@ -3041,7 +3041,7 @@ function http_json(string $url, int $timeout = 20): ?array
$command = escapeshellarg($curl)
. ' -fsSL --max-time ' . (int) $timeout
. ' -H ' . escapeshellarg('Accept: application/json')
. ' -A ' . escapeshellarg('NeonMedicalTracker/1.0')
. ' -A ' . escapeshellarg('MedicalTracker/1.0')
. ' ' . escapeshellarg($url)
. ' 2>/dev/null';
$body = shell_exec($command);