ajout fixtures et styles
This commit is contained in:
parent
b21f2bc04b
commit
421b71ca11
|
@ -22,6 +22,7 @@
|
|||
/node_modules/
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
/public/build/
|
||||
###< symfony/webpack-encore-bundle ###
|
||||
/.cache/
|
||||
/.composer/
|
||||
|
|
38
README.md
38
README.md
|
@ -2,27 +2,57 @@
|
|||
|
||||
Projet du HH année 2022
|
||||
|
||||
Le principe de cette application est de faire une assitance à l'étiquetage des poches et tube de sang lors d'un don.
|
||||
|
||||
## Utilisation
|
||||
## Situation actuelle
|
||||
|
||||
1) le donneur se voit donner un un formulaire à l'accueil avant de voir le médecin.
|
||||
ce formulaire comporte les données d'identité du donneur ainsi qu'un numéro de don sous la forme d'un code barre.
|
||||
Attachées à ce formulaire se trouve deux bandes de code barre identiques.
|
||||
|
||||
2) Le donneur voit le médecin qui va indiquer le nombre de tubes et de poches qui devront être prélevés, notament au niveau des tubes qui permettront de faire des contrôles selon l'historique du patient.
|
||||
|
||||
Le médecin inscrit sur le formulaire d'entrée ces indications, en plus d'une indication sur InLog
|
||||
|
||||
3) Le donneur se présente auprès de l'infirmière muni du formulaire, elle se base sur les indications fournies pour choisir le lot de poches ainsi que le nombre de tubes nécessaire.
|
||||
Les lots de poches peuvent être de 3, 4 ou 5 poches.
|
||||
Les tubes ont des couleurs différentes et peuvent aller jusqu'à 8 tubes pour un prélèvement.
|
||||
|
||||
Théoriquement, l'infirmière doit , au fur et à mesure des prélèvements, coller un code barre sur les poches et tubes.
|
||||
|
||||
Cependant, aucune aide ou vérification n'est en place, et c'est uniquement l'organisation de l'infirmière qui permet d'avoir des lots finaux cohérents.
|
||||
Or, l'infirmière peut avoir 3 patients simultanés, et parfois, des malaises peuvent se produire. Dans ces conditions, il est difficile d'obtenir un taux de réussite de 100%.
|
||||
|
||||
Certaines erreurs peuvent arrivées, et sont remarquées plus tard dans la chaîne de collecte, cependant les efforts fournis après la trouvaille d'une erreur sont important et couteux.
|
||||
|
||||
## Principe de l'application
|
||||
|
||||
Mettre en place un système dynamique qui rappelle à chaque action de scan d'étiquette l'étape en cours et la progression du prélevement, ainsi que l'identité du donneur.
|
||||
|
||||
## Monter l'environnement
|
||||
A la racine du projet
|
||||
```
|
||||
monter l'environnement (construction de l'image, des assets et de la base de données vide, monter le conteneur)
|
||||
make up
|
||||
|
||||
descendre le conteneur
|
||||
make down
|
||||
|
||||
descendre le conteneur et supprimer l'image correspondante
|
||||
make purge
|
||||
```
|
||||
|
||||
## Modification du style
|
||||
|
||||
faire
|
||||
depuis la racine, aller dans le conteneur
|
||||
```
|
||||
docker compose exec ethik_tag bash
|
||||
```
|
||||
|
||||
puis
|
||||
compiler les assets
|
||||
|
||||
```
|
||||
yarn encore dev
|
||||
ou yarn encore prod (pour minifier)
|
||||
ou yarn encore dev --watch (détecte les changments et recompile automatiquement)
|
||||
```
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
// any CSS you import will output into a single css file (app.css in this case)
|
||||
import 'jquery';
|
||||
|
||||
// start the Stimulus application
|
||||
import GetEvent from './js/getCodeBarre';
|
||||
import './bootstrap';
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
import 'fontawesome-free/js/solid.min';
|
|
@ -0,0 +1 @@
|
|||
@import "~fontawesome-free/css/all.css";
|
|
@ -1,4 +1,4 @@
|
|||
@import './header', './footer', './sidebar', 'common/login', 'add-flash', 'front';
|
||||
@import './header', './footer', './sidebar', 'common/login', 'common/fonts', 'add-flash', 'front';
|
||||
@import './global';
|
||||
@import '~bootstrap/scss/bootstrap';
|
||||
@import '~bootstrap/scss/bootstrap-utilities';
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo $(whoami)
|
||||
echo $(pwd)
|
||||
sleep 5
|
||||
yarn install
|
||||
yarn encore dev
|
||||
bin/console d:s:u -f --complete
|
||||
bin/console d:f:l -n
|
||||
|
||||
|
||||
|
||||
/usr/bin/supervisord -c /etc/supervisor/supervisor.ini
|
|
@ -28,6 +28,11 @@ services:
|
|||
- mariadb
|
||||
###> doctrine/doctrine-bundle ###
|
||||
|
||||
adminer:
|
||||
image: adminer:latest
|
||||
ports:
|
||||
- 8082:8080
|
||||
|
||||
volumes:
|
||||
###> doctrine/doctrine-bundle ###
|
||||
mariadb_data:
|
||||
|
|
|
@ -28,6 +28,10 @@ services:
|
|||
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
|
||||
# - ./docker/db/data:/var/lib/postgresql/data:rw
|
||||
###< doctrine/doctrine-bundle ###
|
||||
adminer:
|
||||
image: adminer:latest
|
||||
ports:
|
||||
- 8082:8080
|
||||
|
||||
volumes:
|
||||
###> doctrine/doctrine-bundle ###
|
||||
|
|
|
@ -22,9 +22,10 @@
|
|||
"build": "encore production --progress"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-free": "^6.2.1",
|
||||
"@popperjs/core": "^2.11.6",
|
||||
"bootstrap": "^5.2.2",
|
||||
"jQuery": "^1.7.4",
|
||||
"fortawesome": "^0.0.1-security",
|
||||
"jquery": "^3.6.1",
|
||||
"tom-select": "^2.2.2"
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -11,9 +11,6 @@
|
|||
"js": [
|
||||
"/build/runtime.js",
|
||||
"/build/adminStyle.js"
|
||||
],
|
||||
"css": [
|
||||
"/build/adminStyle.css"
|
||||
]
|
||||
},
|
||||
"frontStyle": {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
"build/app.js": "/build/app.js",
|
||||
"build/adminStyle.css": "/build/adminStyle.css",
|
||||
"build/adminStyle.js": "/build/adminStyle.js",
|
||||
"build/frontStyle.css": "/build/frontStyle.css",
|
||||
"build/frontStyle.js": "/build/frontStyle.js",
|
||||
|
|
|
@ -2,9 +2,11 @@
|
|||
namespace App\Controller\Admin;
|
||||
|
||||
use App\Repository\UserRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use App\Repository\DonCatRepository;
|
||||
use App\Repository\PatientRepository;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
|
||||
/**
|
||||
* Class AdminController
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
class AppFixtures extends Fixture
|
||||
{
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
// $product = new Product();
|
||||
// $manager->persist($product);
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\DmuCat;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
|
||||
class CatDmuFixtures extends Fixture
|
||||
{
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$dmuCat1 = (new DmuCat())
|
||||
->setCodeBarre('123456FF')
|
||||
->setPocheNumber(3)
|
||||
;
|
||||
$manager->persist($dmuCat1);
|
||||
|
||||
$dmuCat2 = (new DmuCat())
|
||||
->setCodeBarre('123456BB')
|
||||
->setPocheNumber(4)
|
||||
;
|
||||
$manager->persist($dmuCat2);
|
||||
|
||||
$dmuCat3 = (new DmuCat())
|
||||
->setCodeBarre('123456BB')
|
||||
->setPocheNumber(5)
|
||||
;
|
||||
$manager->persist($dmuCat3);
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\DonCat;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
|
||||
class DonCatFixtures extends Fixture
|
||||
{
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$donCat1 = (new DonCat())->setName('cat1');
|
||||
$manager->persist($donCat1);
|
||||
$donCat2 = (new DonCat())->setName('cat2');
|
||||
$manager->persist($donCat2);
|
||||
$donCat3 = (new DonCat())->setName('cat3');
|
||||
$manager->persist($donCat3);
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\Don;
|
||||
use App\Repository\DonCatRepository;
|
||||
use App\Repository\PatientRepository;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
|
||||
class DonFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
protected PatientRepository $patientRepository;
|
||||
protected DonCatRepository $donCatRepository;
|
||||
public function __construct(PatientRepository $patientRepository, DonCatRepository $donCatRepository)
|
||||
{
|
||||
$this->patientRepository = $patientRepository;
|
||||
$this->donCatRepository = $donCatRepository;
|
||||
}
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$donneur = $this->patientRepository->findBy([], ['lastname'=>'ASC'], 1)[0];
|
||||
$donCat = $this->donCatRepository->findBy([], ['name'=>'ASC'], 1)[0];
|
||||
$donneur = (new Don())
|
||||
->setCodeBarre('12345678912')
|
||||
->setDonCat($donCat)
|
||||
->setNbreTube(5)
|
||||
->setDonneur($donneur)
|
||||
;
|
||||
$manager->persist($donneur);
|
||||
$manager->flush();
|
||||
}
|
||||
|
||||
|
||||
public function getDependencies()
|
||||
{
|
||||
return [
|
||||
DonCatFixtures::class,
|
||||
PatientFixtures::class
|
||||
];
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use DateTime;
|
||||
use App\Entity\Patient;
|
||||
use App\Repository\PatientRepository;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
|
||||
class PatientFixtures extends Fixture
|
||||
{
|
||||
protected PatientRepository $patientRepository;
|
||||
public function __construct(PatientRepository $patientRepository)
|
||||
{
|
||||
$this->patientRepository = $patientRepository;
|
||||
}
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$donneur = (new Patient())
|
||||
->setLastname('Durand')
|
||||
->setFirstname('Pierre')
|
||||
->setBirthdate(new DateTime('01-01-1990'))
|
||||
->setDonneurNumber('123456')
|
||||
;
|
||||
$manager->persist($donneur);
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\Tube;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
|
||||
class TubesFixtures extends Fixture
|
||||
{
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$tube1 = (new Tube())
|
||||
->setReference('tube1')
|
||||
->setColorCss('#fb2930')
|
||||
->setColorName('rouge')
|
||||
->setAnalyse('??')
|
||||
;
|
||||
$manager->persist($tube1);
|
||||
|
||||
$tube2 = (new Tube())
|
||||
->setReference('tube2')
|
||||
->setColorCss('#f7acb0')
|
||||
->setColorName('rose')
|
||||
->setAnalyse('??')
|
||||
;
|
||||
$manager->persist($tube2);
|
||||
|
||||
$tube3 = (new Tube())
|
||||
->setReference('tube3')
|
||||
->setColorCss('#01cdfe')
|
||||
->setColorName('bleu')
|
||||
->setAnalyse('??')
|
||||
;
|
||||
$manager->persist($tube3);
|
||||
|
||||
$tube4 = (new Tube())
|
||||
->setReference('tube 4')
|
||||
->setColorCss('#e34234')
|
||||
->setColorName('orange')
|
||||
->setAnalyse('??')
|
||||
;
|
||||
$manager->persist($tube4);
|
||||
|
||||
$tube5 = (new Tube())
|
||||
->setReference('tube 5')
|
||||
->setColorCss('#e47ff0')
|
||||
->setColorName('violet')
|
||||
->setAnalyse('??')
|
||||
;
|
||||
$manager->persist($tube5);
|
||||
|
||||
$tube6 = (new Tube())
|
||||
->setReference('tube 6')
|
||||
->setColorCss('#e7b210')
|
||||
->setColorName('jaune')
|
||||
->setAnalyse('??')
|
||||
;
|
||||
$manager->persist($tube6);
|
||||
|
||||
$tube7 = (new Tube())
|
||||
->setReference('tube 7')
|
||||
->setColorCss('#c4bad0')
|
||||
->setColorName('gris')
|
||||
->setAnalyse('??')
|
||||
;
|
||||
$manager->persist($tube7);
|
||||
|
||||
$tube8 = (new Tube())
|
||||
->setReference('tube 8')
|
||||
->setColorCss('#333333')
|
||||
->setColorName('noir')
|
||||
->setAnalyse('??')
|
||||
;
|
||||
$manager->persist($tube8);
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
|
@ -7,6 +7,8 @@ use Doctrine\Common\Collections\ArrayCollection;
|
|||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
|
||||
#[ORM\Entity(repositoryClass: PatientRepository::class)]
|
||||
class Patient
|
||||
|
@ -17,6 +19,7 @@ class Patient
|
|||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 100)]
|
||||
#[Assert\Regex('/[A-Z][a-z]{0,99}/')]
|
||||
private ?string $lastname = null;
|
||||
|
||||
#[ORM\Column(length: 100)]
|
||||
|
|
|
@ -14,7 +14,9 @@ class PatientType extends AbstractType
|
|||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('lastname')
|
||||
->add('lastname', TextType::class, [
|
||||
'label'=> 'Nom'
|
||||
])
|
||||
->add('firstname')
|
||||
->add('birthdate', DateType::class, [
|
||||
'years' => range(intval(date('Y')) - 10, 1920),
|
||||
|
|
|
@ -43,5 +43,7 @@
|
|||
</div>
|
||||
{% include 'admin/layouts/footer.html.twig' %}
|
||||
</div>
|
||||
{{ encore_entry_script_tags('app') }}
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -21,8 +21,10 @@ Encore
|
|||
* and one CSS file (e.g. app.css) if your JavaScript imports CSS.
|
||||
*/
|
||||
.addEntry('app', './assets/app.js')
|
||||
.addEntry('app', './assets/js/_fontawesome.js')
|
||||
.addEntry('adminStyle', './assets/styles/main.scss')
|
||||
.addEntry('frontStyle', './assets/styles/front/front.scss')
|
||||
.addEntry('frontStyle', './assets/styles/common/_fontawesome.scss')
|
||||
|
||||
|
||||
|
||||
|
|
15
yarn.lock
15
yarn.lock
|
@ -908,6 +908,11 @@
|
|||
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
|
||||
integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==
|
||||
|
||||
"@fortawesome/fontawesome-free@^6.2.1":
|
||||
version "6.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-6.2.1.tgz#344baf6ff9eaad7a73cff067d8c56bfc11ae5304"
|
||||
integrity sha512-viouXhegu/TjkvYQoiRZK3aax69dGXxgEjpvZW81wIJdxm5Fnvp3VVIP4VHKqX4SvFw6qpmkILkD4RJWAdrt7A==
|
||||
|
||||
"@hotwired/stimulus-webpack-helpers@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@hotwired/stimulus-webpack-helpers/-/stimulus-webpack-helpers-1.0.1.tgz#4cd74487adeca576c9865ac2b9fe5cb20cef16dd"
|
||||
|
@ -2374,6 +2379,11 @@ follow-redirects@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13"
|
||||
integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==
|
||||
|
||||
fortawesome@^0.0.1-security:
|
||||
version "0.0.1-security"
|
||||
resolved "https://registry.yarnpkg.com/fortawesome/-/fortawesome-0.0.1-security.tgz#1c85341f2fa14e1adb28ccfaecfa7ef63796e6fa"
|
||||
integrity sha512-o/pwn9ZSnveFLYP0d5IejSwz0rpGMDQsBaYVvR8WXSvnxILIwh7IUJK0P90QMF4cnIyouVF2BGrz0LEVSyzimA==
|
||||
|
||||
forwarded@0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811"
|
||||
|
@ -2750,11 +2760,6 @@ isobject@^3.0.1:
|
|||
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
|
||||
integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==
|
||||
|
||||
jQuery@^1.7.4:
|
||||
version "1.7.4"
|
||||
resolved "https://registry.yarnpkg.com/jQuery/-/jQuery-1.7.4.tgz#f32dc5c85a7044ee864b4443b9ee45f9478ba137"
|
||||
integrity sha512-hf/hWBnkFhu4FzP96tBjZNPF9qTcUaOKFA8hpVJX0Cb/892JefRzoVGCe/vkmry/pOhZiK6VnQvnuV8CoHf1rA==
|
||||
|
||||
jest-util@^29.2.0:
|
||||
version "29.2.0"
|
||||
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.2.0.tgz#797935697e83a5722aeba401ed6cd01264295566"
|
||||
|
|
Loading…
Reference in New Issue