From c96e9640c9f0dd0b30267e8cd02db8085c542f6e Mon Sep 17 00:00:00 2001 From: Samuel ORTION Date: Sun, 18 Sep 2022 13:38:43 +0200 Subject: [PATCH] First Medicine request successful on API-Plateform auto generated doc --- api/data/bdpm/.gitkeep | 0 api/data/database.links.txt | 8 + api/data/utils/fill_database.php | 20 ++ api/data/utils/get_database.sh | 12 + api/migrations/.gitignore | 1 + api/src/Entity/MedicineAdministrationWay.php | 50 ++++ api/src/Entity/MedicineHolder.php | 67 +++++ api/src/Entity/MedicineSpeciality.php | 295 +++++++++++++++++++ 8 files changed, 453 insertions(+) create mode 100644 api/data/bdpm/.gitkeep create mode 100644 api/data/database.links.txt create mode 100644 api/data/utils/fill_database.php create mode 100755 api/data/utils/get_database.sh create mode 100644 api/src/Entity/MedicineAdministrationWay.php create mode 100644 api/src/Entity/MedicineHolder.php create mode 100644 api/src/Entity/MedicineSpeciality.php diff --git a/api/data/bdpm/.gitkeep b/api/data/bdpm/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/api/data/database.links.txt b/api/data/database.links.txt new file mode 100644 index 0000000..5fd8d04 --- /dev/null +++ b/api/data/database.links.txt @@ -0,0 +1,8 @@ +CIS_bdpm.txt +CIS_CIP_bdpm.txt +CIS_COMPO_bdpm.txt +CIS_HAS_SMR_bdpm.txt +CIS_HAS_ASMR_bdpm.txt +HAS_LiensPageCT_bdpm.txt +CIS_CPD_bdpm.txt +CIS_InfoImportantes.txt \ No newline at end of file diff --git a/api/data/utils/fill_database.php b/api/data/utils/fill_database.php new file mode 100644 index 0000000..455e86e --- /dev/null +++ b/api/data/utils/fill_database.php @@ -0,0 +1,20 @@ +id; + } + + public function getCIS(): ?string + { + return $this->CIS; + } + + public function getAdministrationWay(): ?string + { + return $this->administration_way; + } +} diff --git a/api/src/Entity/MedicineHolder.php b/api/src/Entity/MedicineHolder.php new file mode 100644 index 0000000..fa16052 --- /dev/null +++ b/api/src/Entity/MedicineHolder.php @@ -0,0 +1,67 @@ +id; + } + + public function getCIS(): ?string + { + return $this->CIS; + } + + public function getName(): ?string + { + return $this->name; + } + + + public function setCIS(string $CIS): self + { + $this->CIS = $CIS; + + return $this; + } + + public function setName(string $name): self + { + $this->name = $name; + + return $this; + } + + public function __toString(): string + { + return $this->name; + } +} diff --git a/api/src/Entity/MedicineSpeciality.php b/api/src/Entity/MedicineSpeciality.php new file mode 100644 index 0000000..399fca2 --- /dev/null +++ b/api/src/Entity/MedicineSpeciality.php @@ -0,0 +1,295 @@ + 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; + } +}