
SELECT * FROM prestataire WHERE libelle LIKE '%IMAGERIE%'


SELECT * FROM p_prestationactes WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM p_acte WHERE codeActe='AC0000808'
-- Depense genérale

SELECT 
prt.*
FROM p_prestationactes prt INNER JOIN p_facture B ON (B.id=prt.idfacture)
INNER JOIN police P ON  (B.idPolice = P.id)
INNER JOIN beneficiaire Be ON ( Be.id=prt.idBeneficiaire )
INNER JOIN gc_assureur G ON  (P.codeGcAssureur = G.codeGcAssureur)
INNER JOIN prestataire p  ON (prt.codePrestataire=p.codePrestataire)
INNER JOIN  p_feuillemaladie F ON (F.numeroFeuilleMaladie=B.numeroFeuilleMaladie)
WHERE (LEFT(B.dateSysteme,10) BETWEEN '2022-10-01' AND '2022-10-20' )
AND G.id!='45' AND P.idClient!='49'  AND (B.codeSociete="vitalis")
-- AND B.idPolice=229 AND prt.montantApayer>0 
-- AND prt.numeroBeneficiaire="0076001502"
-- AND B.numeroFeuilleMaladie= 42072
AND B.codePrestataire  IN ('CE0166')  --  558 522 492*/


SELECT numeroFeuilleMaladie,id,idfacture FROM p_prestationactes WHERE numeroFeuilleMaladie BETWEEN 42068 AND 42072

SELECT * FROM p_feuillemaladie WHERE codePrestataire  IN ('CE0166')  AND (LEFT(dateSysteme,10) BETWEEN '2022-10-01' AND '2022-10-20' )

SELECT * FROM p_facture WHERE numeroFeuilleMaladie BETWEEN 42068 AND 42072

SELECT * FROM p_demandeententeprealablepha WHERE numeroBeneficiaire='0076001503';



-- SELECTION 

SELECT * FROM p_prestationactes WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM p_feuillemaladie WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM p_facture WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM p_demandeententeprealable WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM p_demandeententeprealablepha WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM `p_optique` WHERE numeroFeuilleMaladie IN (61548,61544);


SELECT * FROM  `p_detailprescription` WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM  `p_prescriptionseance` WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM  `p_prescription` WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM  `p_examen` WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM  `p_prestationexamens` WHERE numeroFeuilleMaladie IN (61548,61544);



-- SUPPRESSION


DELETE FROM  `p_facture` WHERE numeroFeuilleMaladie IN (61548,61544);

-- DELETE FROM p_prestationoptiques WHERE numeroFeuilleMaladie=60386;
-- DELETE FROM p_detailoptique WHERE numeroBonOptique=859;
-- DELETE FROM p_demandeententeprealableopt WHERE numeroBonOptique=859;


--  mise a jour actes



SELECT * FROM p_prestationactes WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM p_feuillemaladie WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM p_facture WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM p_demandeententeprealable WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM p_demandeententeprealablepha WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM `p_optique` WHERE numeroFeuilleMaladie IN (61548,61544);


SELECT * FROM  `p_detailprescription` WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM  `p_prescriptionseance` WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM  `p_prescription` WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM  `p_examen` WHERE numeroFeuilleMaladie IN (61548,61544);

SELECT * FROM  `p_prestationexamens` WHERE numeroFeuilleMaladie IN (61548,61544);




