1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
ALTER PROCEDURE TIERS_Patient_Ajout
(
-- identification patient
@strFK_TIERS_BT_Genres nvarchar(128),
@txtNom nvarchar(50),
@txtPrenom nvarchar(50),
@txtPin nchar(10),
@uniTiers uniqueidentifier=null OUTPUT
)
AS
SET NOCOUNT ON
SET @uniTiers = newid()
DECLARE @FK_TIERS_BT_Genres uniqueidentifier
SET @FK_TIERS_BT_Genres = convert(uniqueidentifier, @strFK_TIERS_BT_Genres)
-- Creation du tiers
INSERT INTO TIERS_MT_Tiers (TIERS_MT_Tiers,dteCreation)
VALUES (@uniTiers,getdate())
-- Creation de la personne physique
INSERT INTO TIERS_ST_PP (TIERS_ST_PP)
VALUES (@uniTiers)
-- Creation du patient
INSERT INTO TIERS_ST_Patients (TIERS_ST_Patients)
VALUES (@uniTiers)
-- Creation de l'identification patient
INSERT INTO TIERS_PP_Identification (TIERS_PP_Identification,FK_TIERS_BT_Genres,txtNom,txtPrenom,txtPin)
VALUES (@uniTiers,@FK_TIERS_BT_Genres,@txtNom,@txtPrenom,@txtPin)
RETURN |
Partager