296 lines
6.7 KiB
PHP
296 lines
6.7 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
use ApiPlatform\Metadata\ApiProperty;
|
|
use ApiPlatform\Metadata\Link;
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* A medicine speciality.
|
|
*
|
|
* Medicine that is in the commercial distribution or that has been in commercial distribution since less than three years.
|
|
*
|
|
* From CIS_bdpm.txt
|
|
* @see https://base-donnees-publique.medicaments.gouv.fr/telechargement.php
|
|
*/
|
|
#[ORM\Entity]
|
|
#[ApiResource]
|
|
// #[ApiResource(
|
|
// uriTemplate: '/medicine/'
|
|
// )]
|
|
// #[ApiResource(
|
|
// uriTemplate: '/medicine/{CIS}',
|
|
// uriVariables: [
|
|
// 'CIS' => new Link(fromClass: MedicineSpeciality::class, fromProperty: 'CIS'),
|
|
// ]
|
|
// )]
|
|
// #[ApiResource(
|
|
// uriTemplate: '/medicine/{CIS}/holder',
|
|
// uriVariables: [
|
|
// 'CIS' => new Link(fromClass: MedicineSpeciality::class, fromProperty: 'CIS'),
|
|
// ]
|
|
// )]
|
|
// #[ApiResource(
|
|
// uriTemplate: '/medicine/{CIS}/holder/{id}',
|
|
// uriVariables: [
|
|
// 'CIS' => new Link(fromClass: MedicineSpeciality::class, fromProperty: 'CIS'),
|
|
// 'id' => new Link(fromClass: MedicineHolder::class, fromProperty: 'id'),
|
|
// ]
|
|
// )]
|
|
// #[ApiResource(
|
|
// uriTemplate: '/medicine/{CIS}/way',
|
|
// uriVariables: [
|
|
// 'CIS' => new Link(fromClass: MedicineSpeciality::class, fromProperty: 'CIS'),
|
|
// ]
|
|
// )]
|
|
// #[ApiResource(
|
|
// uriTemplate: '/medicine/{CIS}/way/{id}',
|
|
// uriVariables: [
|
|
// 'CIS' => new Link(fromClass: MedicineSpeciality::class, fromProperty: 'CIS'),
|
|
// 'id' => new Link(fromClass: MedicineAdministrationWay::class, fromProperty: 'id'),
|
|
// ]
|
|
// )]
|
|
class MedicineSpeciality
|
|
{
|
|
|
|
#[ORM\Id, ORM\Column,ORM\GeneratedValue]
|
|
private ?int $id = null;
|
|
|
|
/**
|
|
* This CIS (Code Identifiant de Spécialité) id is the unique identifier of the medicine.
|
|
*/
|
|
#[ORM\Column]
|
|
#[ApiProperty(identifier: true)]
|
|
private ?int $CIS = null;
|
|
|
|
/**
|
|
* Name of the medicine.
|
|
*/
|
|
#[ORM\Column]
|
|
private ?string $denomination = null;
|
|
|
|
/**
|
|
* Pharmaceutical form of the medicine.
|
|
*
|
|
*
|
|
*/
|
|
#[ORM\Column]
|
|
private ?string $form = null;
|
|
|
|
/**
|
|
* Ways of drug administration of the medicine.
|
|
* @var medicineAdministrationWay[] Available administration routes for this medicine.
|
|
*/
|
|
#[ORM\OneToMany(mappedBy: 'medicine', targetEntity: MedicineAdministrationWay::class)]
|
|
public iterable $ways;
|
|
|
|
/**
|
|
* Administrative state of medicine's market authorization (AMM).
|
|
*/
|
|
#[ORM\Column]
|
|
private ?string $market_auth_status = null;
|
|
|
|
/**
|
|
* Type of medicine market authorization process
|
|
*/
|
|
#[ORM\Column]
|
|
private ?string $market_auth_process_type = null;
|
|
|
|
/**
|
|
* Date of medicine market authorization (AMM - * Autorisation de Mise sur le Marché)
|
|
*/
|
|
#[ORM\Column(type: 'date')]
|
|
private ?\DateTimeInterface $market_auth_date = null;
|
|
|
|
/**
|
|
* Market status
|
|
*
|
|
* State of medicine commercialization.
|
|
*/
|
|
#[ORM\Column]
|
|
private ?string $market_status = null;
|
|
|
|
/**
|
|
* Bdm status
|
|
*
|
|
* either "alerte", "warning disponibilité"
|
|
*/
|
|
#[ORM\Column]
|
|
private ?string $bdm_status = null;
|
|
|
|
/**
|
|
* European authorization code
|
|
*/
|
|
#[ORM\Column]
|
|
private ?int $european_auth_code = null;
|
|
|
|
/**
|
|
* Holders(s)
|
|
*
|
|
* @var MedicineHolder[] Holders of the medicine market authorization (AMM)
|
|
*/
|
|
#[ORM\OneToMany(mappedBy: 'medicine', targetEntity: MedicineHolder::class, cascade: ['persist', 'remove'])]
|
|
public iterable $holders;
|
|
|
|
/**
|
|
* Enforced surveillance
|
|
*
|
|
* either 'Oui' or 'Non'
|
|
*/
|
|
#[ORM\Column]
|
|
private ?string $enforced_surveillance = null;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->holders = new ArrayCollection();
|
|
$this->ways = new ArrayCollection();
|
|
}
|
|
|
|
public function getCIS(): ?int
|
|
{
|
|
return $this->CIS;
|
|
}
|
|
|
|
public function getDenomination(): ?string
|
|
{
|
|
return $this->denomination;
|
|
}
|
|
|
|
public function getForm(): ?string
|
|
{
|
|
return $this->form;
|
|
}
|
|
|
|
public function getMarketAuthStatus(): ?string
|
|
{
|
|
return $this->market_auth_status;
|
|
}
|
|
|
|
public function getMarketAuthProcessType(): ?string
|
|
{
|
|
return $this->market_auth_process_type;
|
|
}
|
|
|
|
public function getMarketAuthDate(): ?\DateTimeInterface
|
|
{
|
|
return $this->market_auth_date;
|
|
}
|
|
|
|
public function getMarketStatus(): ?string
|
|
{
|
|
return $this->market_status;
|
|
}
|
|
|
|
public function getBdmStatus(): ?string
|
|
{
|
|
return $this->bdm_status;
|
|
}
|
|
|
|
public function getEuropeanAuthCode(): ?int
|
|
{
|
|
return $this->european_auth_code;
|
|
}
|
|
|
|
public function getEnforcedSurveillance(): ?string
|
|
{
|
|
return $this->enforced_surveillance;
|
|
}
|
|
|
|
public function getWays(): iterable
|
|
{
|
|
return $this->ways;
|
|
}
|
|
|
|
public function getHolders(): iterable
|
|
{
|
|
return $this->holders;
|
|
}
|
|
|
|
public function setCIS(?int $CIS): self
|
|
{
|
|
$this->CIS = $CIS;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function setDenomination(?string $denomination): self
|
|
{
|
|
$this->denomination = $denomination;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function setForm(?string $form): self
|
|
{
|
|
$this->form = $form;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function setMarketAuthStatus(?string $market_auth_status): self
|
|
{
|
|
$this->market_auth_status = $market_auth_status;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function setMarketAuthProcessType(?string $market_auth_process_type): self
|
|
{
|
|
$this->market_auth_process_type = $market_auth_process_type;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function setMarketAuthDate(?\DateTimeInterface $market_auth_date): self
|
|
{
|
|
$this->market_auth_date = $market_auth_date;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function setMarketStatus(?string $market_status): self
|
|
{
|
|
$this->market_status = $market_status;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function setBdmStatus(?string $bdm_status): self
|
|
{
|
|
$this->bdm_status = $bdm_status;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function setEuropeanAuthCode(?int $european_auth_code): self
|
|
{
|
|
$this->european_auth_code = $european_auth_code;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function setEnforcedSurveillance(?string $enforced_surveillance): self
|
|
{
|
|
$this->enforced_surveillance = $enforced_surveillance;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function setWays(iterable $ways): self
|
|
{
|
|
$this->ways = $ways;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function setHolders(iterable $holders): self
|
|
{
|
|
$this->holders = $holders;
|
|
|
|
return $this;
|
|
}
|
|
}
|