Store PID and FALLNR
This commit is contained in:
parent
c211129c97
commit
196317a62c
6
.idea/symfony2.xml
Normal file
6
.idea/symfony2.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Symfony2PluginSettings">
|
||||||
|
<option name="pluginEnabled" value="true" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
28
migrations/Version20261026160000.php
Normal file
28
migrations/Version20261026160000.php
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
final class Version20261026160000 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Store patient and case identifiers from imported CSV files.';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE contacts ADD pid VARCHAR(255) DEFAULT NULL');
|
||||||
|
$this->addSql('ALTER TABLE contacts ADD fallnr VARCHAR(255) DEFAULT NULL');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE contacts DROP pid');
|
||||||
|
$this->addSql('ALTER TABLE contacts DROP fallnr');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -222,6 +222,10 @@ final class CleanMobileCommand extends Command
|
||||||
// Create a Contact entity for DB insertion
|
// Create a Contact entity for DB insertion
|
||||||
$contact = new Contacts();
|
$contact = new Contacts();
|
||||||
$contact->setPhoneNumber($row['HANDY_E164']);
|
$contact->setPhoneNumber($row['HANDY_E164']);
|
||||||
|
$pid = trim($row['PID'] ?? '');
|
||||||
|
$fallnr = trim($row['FALLNR'] ?? '');
|
||||||
|
$contact->setPid($pid === '' ? null : $pid);
|
||||||
|
$contact->setFallnr($fallnr === '' ? null : $fallnr);
|
||||||
$today = new \DateTime('today');
|
$today = new \DateTime('today');
|
||||||
$dueDate = ($today)->setTime(12, 0, 0);
|
$dueDate = ($today)->setTime(12, 0, 0);
|
||||||
$contact->setDueDate($dueDate);
|
$contact->setDueDate($dueDate);
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,12 @@ class Contacts
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
private ?string $phone_number = null;
|
private ?string $phone_number = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
|
private ?string $pid = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
|
private ?string $fallnr = null;
|
||||||
|
|
||||||
#[ORM\Column(nullable: true)]
|
#[ORM\Column(nullable: true)]
|
||||||
private ?\DateTime $due_date = null;
|
private ?\DateTime $due_date = null;
|
||||||
|
|
||||||
|
|
@ -100,6 +106,30 @@ class Contacts
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPid(): ?string
|
||||||
|
{
|
||||||
|
return $this->pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPid(?string $pid): static
|
||||||
|
{
|
||||||
|
$this->pid = $pid;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFallnr(): ?string
|
||||||
|
{
|
||||||
|
return $this->fallnr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setFallnr(?string $fallnr): static
|
||||||
|
{
|
||||||
|
$this->fallnr = $fallnr;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDueDate(): ?\DateTime
|
public function getDueDate(): ?\DateTime
|
||||||
{
|
{
|
||||||
return $this->due_date;
|
return $this->due_date;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user