|
|
return: text
|
|
|
lang: plpgsql
|
|
|
src: |
|
|
|
DECLARE
|
|
|
|
|
|
|
|
|
|
|
|
result TEXT;
|
|
|
BEGIN
|
|
|
UPDATE pmsi.t_actes SET
|
|
|
racine_id = t_actes_7.oid,
|
|
|
racine_code = t_actes_7.code,
|
|
|
racine_texte = t_actes_7.texte
|
|
|
FROM pmsi.t_actes t_actes_7
|
|
|
WHERE substr(t_actes.code,1,7) = t_actes_7.code AND
|
|
|
length(t_actes.code) >= 7 AND
|
|
|
(
|
|
|
t_actes.racine_id IS DISTINCT FROM t_actes_7.oid OR
|
|
|
t_actes.racine_code IS DISTINCT FROM t_actes_7.code OR
|
|
|
t_actes.racine_texte IS DISTINCT FROM t_actes_7.texte
|
|
|
)
|
|
|
;
|
|
|
|
|
|
UPDATE pmsi.t_actes SET
|
|
|
racine_id = oid,
|
|
|
racine_code = code,
|
|
|
racine_texte = texte
|
|
|
WHERE COALESCE(t_actes.racine_id,0) = 0 AND
|
|
|
(
|
|
|
t_actes.racine_id IS DISTINCT FROM oid OR
|
|
|
t_actes.racine_code IS DISTINCT FROM code OR
|
|
|
t_actes.racine_texte IS DISTINCT FROM texte
|
|
|
)
|
|
|
;
|
|
|
|
|
|
UPDATE pmsi.t_actes SET
|
|
|
type = t_actes_7.type,
|
|
|
sexe = t_actes_7.sexe,
|
|
|
classant = t_actes_7.classant,
|
|
|
marqueur = t_actes_7.marqueur,
|
|
|
icr = t_actes_7.icr,
|
|
|
icr_1 = t_actes_7.icr_1,
|
|
|
icr_4 = t_actes_7.icr_4,
|
|
|
ccam_regroupement_id_1 = t_actes_7.ccam_regroupement_id_1,
|
|
|
ccam_regroupement_id_4 = t_actes_7.ccam_regroupement_id_4,
|
|
|
geste_marqueur_id = t_actes_7.geste_marqueur_id,
|
|
|
geste_marqueur_regional_id = t_actes_7.geste_marqueur_regional_id,
|
|
|
geste_marqueur_groupe_id = t_actes_7.geste_marqueur_groupe_id,
|
|
|
geste_marqueur_etablissement_id = t_actes_7.geste_marqueur_etablissement_id,
|
|
|
icr_prive_atih_1 = t_actes_7.icr_prive_atih_1,
|
|
|
icr_prive_atih_4 = t_actes_7.icr_prive_atih_4,
|
|
|
icr_public_atih_1 = t_actes_7.icr_public_atih_1,
|
|
|
icr_public_atih_4 = t_actes_7.icr_public_atih_4,
|
|
|
chapitre_1_id = t_actes_7.chapitre_1_id,
|
|
|
chapitre_1_code = t_actes_7.chapitre_1_code,
|
|
|
chapitre_1_texte = t_actes_7.chapitre_1_texte,
|
|
|
chapitre_2_id = t_actes_7.chapitre_2_id,
|
|
|
chapitre_2_code = t_actes_7.chapitre_2_code,
|
|
|
chapitre_2_texte = t_actes_7.chapitre_2_texte,
|
|
|
chapitre_3_id = t_actes_7.chapitre_3_id,
|
|
|
chapitre_3_code = t_actes_7.chapitre_3_code,
|
|
|
chapitre_3_texte = t_actes_7.chapitre_3_texte,
|
|
|
chapitre_4_id = t_actes_7.chapitre_4_id,
|
|
|
chapitre_4_code = t_actes_7.chapitre_4_code,
|
|
|
chapitre_4_texte = t_actes_7.chapitre_4_texte,
|
|
|
type_id = t_actes_7.type_id,
|
|
|
type_code = t_actes_7.type_code,
|
|
|
type_texte = t_actes_7.type_texte,
|
|
|
topographie_1_id = t_actes_7.topographie_1_id,
|
|
|
topographie_1_code = t_actes_7.topographie_1_code,
|
|
|
topographie_1_texte = t_actes_7.topographie_1_texte,
|
|
|
topographie_2_id = t_actes_7.topographie_2_id,
|
|
|
topographie_2_code = t_actes_7.topographie_2_code,
|
|
|
topographie_2_texte = t_actes_7.topographie_2_texte,
|
|
|
action_id = t_actes_7.action_id,
|
|
|
action_code = t_actes_7.action_code,
|
|
|
action_texte = t_actes_7.action_texte,
|
|
|
technique_id = t_actes_7.technique_id,
|
|
|
technique_code = t_actes_7.technique_code,
|
|
|
technique_texte = t_actes_7.technique_texte,
|
|
|
icr_conso_public_atih_1 = t_actes_7.icr_conso_public_atih_1,
|
|
|
icr_rea_public_atih_1 = t_actes_7. icr_rea_public_atih_1 ,
|
|
|
icr_p_prive_atih_1 = t_actes_7.icr_p_prive_atih_1,
|
|
|
icr_conso_prive_atih_1 = t_actes_7.icr_conso_prive_atih_1,
|
|
|
icr_rea_prive_atih_1 = t_actes_7.icr_rea_prive_atih_1,
|
|
|
icr_p_public_atih_1 = t_actes_7.icr_p_public_atih_1,
|
|
|
tarif_1 = t_actes_7.tarif_1,
|
|
|
tarif_4 = t_actes_7.tarif_4,
|
|
|
tarif_5 = t_actes_7.tarif_5
|
|
|
FROM pmsi.t_actes t_actes_7
|
|
|
WHERE t_actes.racine_id = t_actes_7.oid AND
|
|
|
t_actes.racine_id <> t_actes.oid AND
|
|
|
(
|
|
|
t_actes.type IS DISTINCT FROM t_actes_7.type OR
|
|
|
t_actes.sexe IS DISTINCT FROM t_actes_7.sexe OR
|
|
|
t_actes.classant IS DISTINCT FROM t_actes_7.classant OR
|
|
|
t_actes.marqueur IS DISTINCT FROM t_actes_7.marqueur OR
|
|
|
t_actes.icr IS DISTINCT FROM t_actes_7.icr OR
|
|
|
t_actes.icr_1 IS DISTINCT FROM t_actes_7.icr_1 OR
|
|
|
t_actes.icr_4 IS DISTINCT FROM t_actes_7.icr_4 OR
|
|
|
t_actes.ccam_regroupement_id_1 IS DISTINCT FROM t_actes_7.ccam_regroupement_id_1 OR
|
|
|
t_actes.ccam_regroupement_id_4 IS DISTINCT FROM t_actes_7.ccam_regroupement_id_4 OR
|
|
|
t_actes.geste_marqueur_id IS DISTINCT FROM t_actes_7.geste_marqueur_id OR
|
|
|
t_actes.geste_marqueur_regional_id IS DISTINCT FROM t_actes_7.geste_marqueur_regional_id OR
|
|
|
t_actes.geste_marqueur_groupe_id IS DISTINCT FROM t_actes_7.geste_marqueur_groupe_id OR
|
|
|
t_actes.geste_marqueur_etablissement_id IS DISTINCT FROM t_actes_7.geste_marqueur_etablissement_id OR
|
|
|
t_actes.icr_prive_atih_1 IS DISTINCT FROM t_actes_7.icr_prive_atih_1 OR
|
|
|
t_actes.icr_prive_atih_4 IS DISTINCT FROM t_actes_7.icr_prive_atih_4 OR
|
|
|
t_actes.icr_public_atih_1 IS DISTINCT FROM t_actes_7.icr_public_atih_1 OR
|
|
|
t_actes.icr_public_atih_4 IS DISTINCT FROM t_actes_7.icr_public_atih_4 OR
|
|
|
t_actes.chapitre_1_id IS DISTINCT FROM t_actes_7.chapitre_1_id OR
|
|
|
t_actes.chapitre_1_code IS DISTINCT FROM t_actes_7.chapitre_1_code OR
|
|
|
t_actes.chapitre_1_texte IS DISTINCT FROM t_actes_7.chapitre_1_texte OR
|
|
|
t_actes.chapitre_2_id IS DISTINCT FROM t_actes_7.chapitre_2_id OR
|
|
|
t_actes.chapitre_2_code IS DISTINCT FROM t_actes_7.chapitre_2_code OR
|
|
|
t_actes.chapitre_2_texte IS DISTINCT FROM t_actes_7.chapitre_2_texte OR
|
|
|
t_actes.chapitre_3_id IS DISTINCT FROM t_actes_7.chapitre_3_id OR
|
|
|
t_actes.chapitre_3_code IS DISTINCT FROM t_actes_7.chapitre_3_code OR
|
|
|
t_actes.chapitre_3_texte IS DISTINCT FROM t_actes_7.chapitre_3_texte OR
|
|
|
t_actes.chapitre_4_id IS DISTINCT FROM t_actes_7.chapitre_4_id OR
|
|
|
t_actes.chapitre_4_code IS DISTINCT FROM t_actes_7.chapitre_4_code OR
|
|
|
t_actes.chapitre_4_texte IS DISTINCT FROM t_actes_7.chapitre_4_texte OR
|
|
|
t_actes.type_id IS DISTINCT FROM t_actes_7.type_id OR
|
|
|
t_actes.type_code IS DISTINCT FROM t_actes_7.type_code OR
|
|
|
t_actes.type_texte IS DISTINCT FROM t_actes_7.type_texte OR
|
|
|
t_actes.topographie_1_id IS DISTINCT FROM t_actes_7.topographie_1_id OR
|
|
|
t_actes.topographie_1_code IS DISTINCT FROM t_actes_7.topographie_1_code OR
|
|
|
t_actes.topographie_1_texte IS DISTINCT FROM t_actes_7.topographie_1_texte OR
|
|
|
t_actes.topographie_2_id IS DISTINCT FROM t_actes_7.topographie_2_id OR
|
|
|
t_actes.topographie_2_code IS DISTINCT FROM t_actes_7.topographie_2_code OR
|
|
|
t_actes.topographie_2_texte IS DISTINCT FROM t_actes_7.topographie_2_texte OR
|
|
|
t_actes.action_id IS DISTINCT FROM t_actes_7.action_id OR
|
|
|
t_actes.action_code IS DISTINCT FROM t_actes_7.action_code OR
|
|
|
t_actes.action_texte IS DISTINCT FROM t_actes_7.action_texte OR
|
|
|
t_actes.technique_id IS DISTINCT FROM t_actes_7.technique_id OR
|
|
|
t_actes.technique_code IS DISTINCT FROM t_actes_7.technique_code OR
|
|
|
t_actes.technique_texte IS DISTINCT FROM t_actes_7.technique_texte OR
|
|
|
t_actes.icr_conso_public_atih_1 IS DISTINCT FROM t_actes_7.icr_conso_public_atih_1 OR
|
|
|
t_actes.icr_rea_public_atih_1 IS DISTINCT FROM t_actes_7. icr_rea_public_atih_1 OR
|
|
|
t_actes.icr_p_prive_atih_1 IS DISTINCT FROM t_actes_7.icr_p_prive_atih_1 OR
|
|
|
t_actes.icr_conso_prive_atih_1 IS DISTINCT FROM t_actes_7.icr_conso_prive_atih_1 OR
|
|
|
t_actes.icr_rea_prive_atih_1 IS DISTINCT FROM t_actes_7.icr_rea_prive_atih_1 OR
|
|
|
t_actes.icr_p_public_atih_1 IS DISTINCT FROM t_actes_7.icr_p_public_atih_1 OR
|
|
|
t_actes.tarif_1 IS DISTINCT FROM t_actes_7.tarif_1 OR
|
|
|
t_actes.tarif_4 IS DISTINCT FROM t_actes_7.tarif_4 OR
|
|
|
t_actes.tarif_5 IS DISTINCT FROM t_actes_7.tarif_5
|
|
|
)
|
|
|
;
|
|
|
|
|
|
DELETE FROM pmsi.t_actes_c WHERE oid NOT IN (SELECT oid FROM pmsi.v_actes_3)
|
|
|
;
|
|
|
|
|
|
UPDATE pmsi.t_actes_c SET
|
|
|
code = v_actes_3.code,
|
|
|
texte = v_actes_3.texte,
|
|
|
texte_court = v_actes_3.texte_court,
|
|
|
nomenclature = v_actes_3.nomenclature,
|
|
|
type = v_actes_3.type,
|
|
|
sexe = v_actes_3.sexe ,
|
|
|
classant = v_actes_3.classant,
|
|
|
marqueur = v_actes_3.marqueur,
|
|
|
icr = v_actes_3.icr,
|
|
|
icr_1 = v_actes_3.icr_1,
|
|
|
icr_4 = v_actes_3.icr_4,
|
|
|
tarif_1 = v_actes_3.tarif_1,
|
|
|
tarif_4 = v_actes_3.tarif_4,
|
|
|
tarif_5 = v_actes_3.tarif_5,
|
|
|
ccam_regroupement_id_1 = v_actes_3.ccam_regroupement_id_1,
|
|
|
ccam_regroupement_code_1 = v_actes_3.ccam_regroupement_code_1,
|
|
|
ccam_regroupement_texte_1 = v_actes_3.ccam_regroupement_texte_1,
|
|
|
ccam_regroupement_id_4 = v_actes_3.ccam_regroupement_id_4,
|
|
|
ccam_regroupement_code_4 = v_actes_3.ccam_regroupement_code_4,
|
|
|
ccam_regroupement_texte_4 = v_actes_3.ccam_regroupement_texte_4,
|
|
|
geste_marqueur_id = v_actes_3.geste_marqueur_id,
|
|
|
geste_marqueur_code = v_actes_3.geste_marqueur_code,
|
|
|
geste_marqueur_texte = v_actes_3.geste_marqueur_texte,
|
|
|
geste_marqueur_regional_id = v_actes_3.geste_marqueur_regional_id,
|
|
|
geste_marqueur_groupe_id = v_actes_3.geste_marqueur_groupe_id,
|
|
|
geste_marqueur_etablissement_id = v_actes_3.geste_marqueur_etablissement_id,
|
|
|
geste_marqueur_age_min = v_actes_3.geste_marqueur_age_min,
|
|
|
geste_marqueur_age_max = v_actes_3.geste_marqueur_age_max,
|
|
|
icr_prive_atih_1 = v_actes_3.icr_prive_atih_1,
|
|
|
icr_prive_atih_4 = v_actes_3.icr_prive_atih_4 ,
|
|
|
icr_public_atih_1 = v_actes_3.icr_public_atih_1,
|
|
|
icr_public_atih_4 = v_actes_3.icr_public_atih_4,
|
|
|
chapitre_1_id=v_actes_3.ccam_chapitre_1_id,
|
|
|
chapitre_1_code=v_actes_3.ccam_chapitre_1_code,
|
|
|
chapitre_1_texte=v_actes_3.ccam_chapitre_1_texte,
|
|
|
chapitre_2_id=v_actes_3.ccam_chapitre_2_id,
|
|
|
chapitre_2_code=v_actes_3.ccam_chapitre_2_code,
|
|
|
chapitre_2_texte=v_actes_3.ccam_chapitre_2_texte,
|
|
|
|
|
|
chapitre_3_id=v_actes_3.ccam_chapitre_3_id,
|
|
|
chapitre_3_code=v_actes_3.ccam_chapitre_3_code,
|
|
|
chapitre_3_texte=v_actes_3.ccam_chapitre_3_texte,
|
|
|
chapitre_4_id=v_actes_3.ccam_chapitre_4_id,
|
|
|
chapitre_4_code=v_actes_3.ccam_chapitre_4_code,
|
|
|
chapitre_4_texte=v_actes_3.ccam_chapitre_4_texte,
|
|
|
type_id=v_actes_3.ccam_type_id,
|
|
|
type_code=v_actes_3.ccam_type_code,
|
|
|
type_texte=v_actes_3.ccam_type_texte,
|
|
|
topographie_1_id=v_actes_3.ccam_topographie_1_id,
|
|
|
topographie_1_code=v_actes_3.ccam_topographie_1_code,
|
|
|
topographie_1_texte=v_actes_3.ccam_topographie_1_texte,
|
|
|
topographie_2_id=v_actes_3.ccam_topographie_2_id,
|
|
|
topographie_2_code=v_actes_3.ccam_topographie_2_code,
|
|
|
topographie_2_texte=v_actes_3.ccam_topographie_2_texte,
|
|
|
action_id=v_actes_3.ccam_action_id,
|
|
|
action_code=v_actes_3.ccam_action_code,
|
|
|
action_texte=v_actes_3.ccam_action_texte,
|
|
|
technique_id=v_actes_3.ccam_technique_id,
|
|
|
technique_code=v_actes_3.ccam_technique_code,
|
|
|
technique_texte=v_actes_3.ccam_technique_texte,
|
|
|
icr_conso_public_atih_1=v_actes_3.icr_conso_public_atih_1,
|
|
|
icr_rea_public_atih_1=v_actes_3.icr_rea_public_atih_1,
|
|
|
icr_p_prive_atih_1=v_actes_3.icr_p_prive_atih_1,
|
|
|
icr_conso_prive_atih_1=v_actes_3.icr_conso_prive_atih_1,
|
|
|
icr_rea_prive_atih_1=v_actes_3.icr_rea_prive_atih_1,
|
|
|
icr_p_public_atih_1=v_actes_3.icr_p_public_atih_1,
|
|
|
date_debut_validite = v_actes_3.date_debut_validite,
|
|
|
date_fin_validite = v_actes_3.date_fin_validite,
|
|
|
racine_id = v_actes_3.racine_id,
|
|
|
racine_code = v_actes_3.racine_code,
|
|
|
racine_texte = v_actes_3.racine_texte
|
|
|
FROM pmsi.v_actes_3
|
|
|
WHERE t_actes_c.oid = v_actes_3.oid
|
|
|
AND
|
|
|
(
|
|
|
t_actes_c.code IS DISTINCT FROM v_actes_3.code OR t_actes_c.texte IS DISTINCT FROM v_actes_3.texte OR t_actes_c.texte_court IS DISTINCT FROM v_actes_3.texte_court OR t_actes_c.nomenclature IS DISTINCT FROM v_actes_3.nomenclature OR t_actes_c.type IS DISTINCT FROM v_actes_3.type OR
|
|
|
t_actes_c.sexe IS DISTINCT FROM v_actes_3.sexe OR t_actes_c.classant IS DISTINCT FROM v_actes_3.classant OR t_actes_c.marqueur IS DISTINCT FROM v_actes_3.marqueur OR
|
|
|
t_actes_c.icr IS DISTINCT FROM v_actes_3.icr OR t_actes_c.icr_1 IS DISTINCT FROM v_actes_3.icr_1 OR t_actes_c.icr_4 IS DISTINCT FROM v_actes_3.icr_4 OR
|
|
|
t_actes_c.tarif_1 IS DISTINCT FROM v_actes_3.tarif_1 OR t_actes_c.tarif_4 IS DISTINCT FROM v_actes_3.tarif_4 OR t_actes_c.tarif_5 IS DISTINCT FROM v_actes_3.tarif_5 OR
|
|
|
t_actes_c.ccam_regroupement_id_1 IS DISTINCT FROM v_actes_3.ccam_regroupement_id_1 OR t_actes_c.ccam_regroupement_code_1 IS DISTINCT FROM v_actes_3.ccam_regroupement_code_1 OR t_actes_c.ccam_regroupement_texte_1 IS DISTINCT FROM v_actes_3.ccam_regroupement_texte_1 OR
|
|
|
t_actes_c.ccam_regroupement_id_4 IS DISTINCT FROM v_actes_3.ccam_regroupement_id_4 OR t_actes_c.ccam_regroupement_code_4 IS DISTINCT FROM v_actes_3.ccam_regroupement_code_4 OR t_actes_c.ccam_regroupement_texte_4 IS DISTINCT FROM v_actes_3.ccam_regroupement_texte_4 OR
|
|
|
t_actes_c.geste_marqueur_id IS DISTINCT FROM v_actes_3.geste_marqueur_id OR t_actes_c.geste_marqueur_code IS DISTINCT FROM v_actes_3.geste_marqueur_code OR t_actes_c.geste_marqueur_texte IS DISTINCT FROM v_actes_3.geste_marqueur_texte OR
|
|
|
t_actes_c.geste_marqueur_regional_id IS DISTINCT FROM v_actes_3.geste_marqueur_regional_id OR t_actes_c.geste_marqueur_groupe_id IS DISTINCT FROM v_actes_3.geste_marqueur_groupe_id OR t_actes_c.geste_marqueur_etablissement_id IS DISTINCT FROM v_actes_3.geste_marqueur_etablissement_id OR
|
|
|
t_actes_c.geste_marqueur_age_min IS DISTINCT FROM v_actes_3.geste_marqueur_age_min OR t_actes_c.geste_marqueur_age_max IS DISTINCT FROM v_actes_3.geste_marqueur_age_max OR
|
|
|
t_actes_c.icr_prive_atih_1 IS DISTINCT FROM v_actes_3.icr_prive_atih_1 OR t_actes_c.icr_prive_atih_4 IS DISTINCT FROM v_actes_3.icr_prive_atih_4 OR t_actes_c. icr_public_atih_1 IS DISTINCT FROM v_actes_3.icr_public_atih_1 OR t_actes_c.icr_public_atih_4 IS DISTINCT FROM v_actes_3.icr_public_atih_4 OR
|
|
|
t_actes_c.chapitre_1_id IS DISTINCT FROM v_actes_3.ccam_chapitre_1_id OR
|
|
|
t_actes_c.chapitre_1_code IS DISTINCT FROM v_actes_3.ccam_chapitre_1_code OR
|
|
|
t_actes_c.chapitre_1_texte IS DISTINCT FROM v_actes_3.ccam_chapitre_1_texte OR
|
|
|
t_actes_c.chapitre_2_id IS DISTINCT FROM v_actes_3.ccam_chapitre_2_id OR
|
|
|
t_actes_c.chapitre_2_code IS DISTINCT FROM v_actes_3.ccam_chapitre_2_code OR
|
|
|
t_actes_c.chapitre_2_texte IS DISTINCT FROM v_actes_3.ccam_chapitre_2_texte OR
|
|
|
t_actes_c.chapitre_3_id IS DISTINCT FROM v_actes_3.ccam_chapitre_3_id OR
|
|
|
t_actes_c.chapitre_3_code IS DISTINCT FROM v_actes_3.ccam_chapitre_3_code OR
|
|
|
t_actes_c.chapitre_3_texte IS DISTINCT FROM v_actes_3.ccam_chapitre_3_texte OR
|
|
|
t_actes_c.chapitre_4_id IS DISTINCT FROM v_actes_3.ccam_chapitre_4_id OR
|
|
|
t_actes_c.chapitre_4_code IS DISTINCT FROM v_actes_3.ccam_chapitre_4_code OR
|
|
|
t_actes_c.chapitre_4_texte IS DISTINCT FROM v_actes_3.ccam_chapitre_4_texte OR
|
|
|
t_actes_c.type_id IS DISTINCT FROM v_actes_3.ccam_type_id OR
|
|
|
t_actes_c.type_code IS DISTINCT FROM v_actes_3.ccam_type_code OR
|
|
|
t_actes_c.type_texte IS DISTINCT FROM v_actes_3.ccam_type_texte OR
|
|
|
t_actes_c.topographie_1_id IS DISTINCT FROM v_actes_3.ccam_topographie_1_id OR
|
|
|
t_actes_c.topographie_1_code IS DISTINCT FROM v_actes_3.ccam_topographie_1_code OR
|
|
|
t_actes_c.topographie_1_texte IS DISTINCT FROM v_actes_3.ccam_topographie_1_texte OR
|
|
|
t_actes_c.topographie_2_id IS DISTINCT FROM v_actes_3.ccam_topographie_2_id OR
|
|
|
t_actes_c.topographie_2_code IS DISTINCT FROM v_actes_3.ccam_topographie_2_code OR
|
|
|
t_actes_c.topographie_2_texte IS DISTINCT FROM v_actes_3.ccam_topographie_2_texte OR
|
|
|
t_actes_c.action_id IS DISTINCT FROM v_actes_3.ccam_action_id OR
|
|
|
t_actes_c.action_code IS DISTINCT FROM v_actes_3.ccam_action_code OR
|
|
|
t_actes_c.action_texte IS DISTINCT FROM v_actes_3.ccam_action_texte OR
|
|
|
t_actes_c.technique_id IS DISTINCT FROM v_actes_3.ccam_technique_id OR
|
|
|
t_actes_c.technique_code IS DISTINCT FROM v_actes_3.ccam_technique_code OR
|
|
|
t_actes_c.technique_texte IS DISTINCT FROM v_actes_3.ccam_technique_texte OR
|
|
|
t_actes_c.icr_conso_public_atih_1 IS DISTINCT FROM v_actes_3.icr_conso_public_atih_1 OR
|
|
|
t_actes_c.icr_rea_public_atih_1 IS DISTINCT FROM v_actes_3.icr_rea_public_atih_1 OR
|
|
|
t_actes_c.icr_p_prive_atih_1 IS DISTINCT FROM v_actes_3.icr_p_prive_atih_1 OR
|
|
|
t_actes_c.icr_conso_prive_atih_1 IS DISTINCT FROM v_actes_3.icr_conso_prive_atih_1 OR
|
|
|
t_actes_c.icr_rea_prive_atih_1 IS DISTINCT FROM v_actes_3.icr_rea_prive_atih_1 OR
|
|
|
t_actes_c.icr_p_public_atih_1 IS DISTINCT FROM v_actes_3.icr_p_public_atih_1 OR
|
|
|
t_actes_c.date_debut_validite IS DISTINCT FROM v_actes_3.date_debut_validite OR
|
|
|
t_actes_c.date_fin_validite IS DISTINCT FROM v_actes_3.date_fin_validite OR
|
|
|
t_actes_c.racine_id IS DISTINCT FROM v_actes_3.racine_id OR
|
|
|
t_actes_c.racine_code IS DISTINCT FROM v_actes_3.racine_code OR
|
|
|
t_actes_c.racine_texte IS DISTINCT FROM v_actes_3.racine_texte
|
|
|
)
|
|
|
;
|
|
|
|
|
|
INSERT INTO pmsi.t_actes_c(
|
|
|
oid,
|
|
|
code,
|
|
|
texte,
|
|
|
texte_court,
|
|
|
nomenclature,
|
|
|
type,
|
|
|
sexe,
|
|
|
classant,
|
|
|
marqueur,
|
|
|
icr,
|
|
|
icr_1,
|
|
|
icr_4,
|
|
|
tarif_1,
|
|
|
tarif_4,
|
|
|
tarif_5,
|
|
|
icr_prive_atih_1,
|
|
|
icr_prive_atih_4,
|
|
|
icr_public_atih_1,
|
|
|
icr_public_atih_4,
|
|
|
ccam_regroupement_id_1,
|
|
|
ccam_regroupement_code_1,
|
|
|
ccam_regroupement_texte_1,
|
|
|
ccam_regroupement_id_4,
|
|
|
ccam_regroupement_code_4,
|
|
|
ccam_regroupement_texte_4,
|
|
|
geste_marqueur_id,
|
|
|
geste_marqueur_code,
|
|
|
geste_marqueur_texte,
|
|
|
geste_marqueur_age_min,
|
|
|
geste_marqueur_age_max,
|
|
|
geste_marqueur_regional_id,
|
|
|
geste_marqueur_groupe_id,
|
|
|
geste_marqueur_etablissement_id,
|
|
|
chapitre_1_id,
|
|
|
chapitre_1_code,
|
|
|
chapitre_1_texte,
|
|
|
chapitre_2_id,
|
|
|
chapitre_2_code,
|
|
|
chapitre_2_texte,
|
|
|
chapitre_3_id,
|
|
|
chapitre_3_code,
|
|
|
chapitre_3_texte,
|
|
|
chapitre_4_id,
|
|
|
chapitre_4_code,
|
|
|
chapitre_4_texte,
|
|
|
type_id,
|
|
|
type_code,
|
|
|
type_texte,
|
|
|
topographie_1_id,
|
|
|
topographie_1_code,
|
|
|
topographie_1_texte,
|
|
|
topographie_2_id,
|
|
|
topographie_2_code,
|
|
|
topographie_2_texte,
|
|
|
action_id,
|
|
|
action_code,
|
|
|
action_texte,
|
|
|
technique_id,
|
|
|
technique_code,
|
|
|
technique_texte,
|
|
|
icr_conso_public_atih_1,
|
|
|
icr_rea_public_atih_1,
|
|
|
icr_p_prive_atih_1,
|
|
|
icr_conso_prive_atih_1,
|
|
|
icr_rea_prive_atih_1,
|
|
|
icr_p_public_atih_1,
|
|
|
date_debut_validite,
|
|
|
date_fin_validite,
|
|
|
racine_id,
|
|
|
racine_code,
|
|
|
racine_texte
|
|
|
)
|
|
|
SELECT
|
|
|
oid,
|
|
|
code,
|
|
|
texte,
|
|
|
texte_court,
|
|
|
nomenclature,
|
|
|
type,
|
|
|
sexe,
|
|
|
classant,
|
|
|
marqueur,
|
|
|
icr,
|
|
|
icr_1,
|
|
|
icr_4,
|
|
|
tarif_1,
|
|
|
tarif_4,
|
|
|
tarif_5,
|
|
|
icr_prive_atih_1,
|
|
|
icr_prive_atih_4,
|
|
|
icr_public_atih_1,
|
|
|
icr_public_atih_4,
|
|
|
ccam_regroupement_id_1,
|
|
|
ccam_regroupement_code_1,
|
|
|
ccam_regroupement_texte_1,
|
|
|
ccam_regroupement_id_4,
|
|
|
ccam_regroupement_code_4,
|
|
|
ccam_regroupement_texte_4,
|
|
|
geste_marqueur_id,
|
|
|
geste_marqueur_code,
|
|
|
geste_marqueur_texte,
|
|
|
geste_marqueur_age_min,
|
|
|
geste_marqueur_age_max,
|
|
|
geste_marqueur_regional_id,
|
|
|
geste_marqueur_groupe_id,
|
|
|
geste_marqueur_etablissement_id,
|
|
|
ccam_chapitre_1_id,
|
|
|
ccam_chapitre_1_code,
|
|
|
ccam_chapitre_1_texte,
|
|
|
ccam_chapitre_2_id,
|
|
|
ccam_chapitre_2_code,
|
|
|
ccam_chapitre_2_texte,
|
|
|
ccam_chapitre_3_id,
|
|
|
ccam_chapitre_3_code,
|
|
|
ccam_chapitre_3_texte,
|
|
|
ccam_chapitre_4_id,
|
|
|
ccam_chapitre_4_code,
|
|
|
ccam_chapitre_4_texte,
|
|
|
ccam_type_id,
|
|
|
ccam_type_code,
|
|
|
ccam_type_texte,
|
|
|
ccam_topographie_1_id,
|
|
|
ccam_topographie_1_code,
|
|
|
ccam_topographie_1_texte,
|
|
|
ccam_topographie_2_id,
|
|
|
ccam_topographie_2_code,
|
|
|
ccam_topographie_2_texte,
|
|
|
ccam_action_id,
|
|
|
ccam_action_code,
|
|
|
ccam_action_texte,
|
|
|
ccam_technique_id,
|
|
|
ccam_technique_code,
|
|
|
ccam_technique_texte,
|
|
|
icr_conso_public_atih_1,
|
|
|
icr_rea_public_atih_1,
|
|
|
icr_p_prive_atih_1,
|
|
|
icr_conso_prive_atih_1,
|
|
|
icr_rea_prive_atih_1,
|
|
|
icr_p_public_atih_1,
|
|
|
date_debut_validite,
|
|
|
date_fin_validite,
|
|
|
racine_id,
|
|
|
racine_code,
|
|
|
racine_texte
|
|
|
FROM pmsi.v_actes_3 WHERE oid NOT IN (SELECT oid FROM pmsi.t_actes_c);
|
|
|
|
|
|
RETURN 'OK';
|
|
|
END;
|