-- update app_configuration set value  = 'false' where variable = 'bp6_mode_enabled';
INSERT into tf_domain (id, keyword, name, description) VALUES (nextval('tf_domain_id_seq'), 'ITI-FR', 'IT-Infrastructure in France', 'IT-Infrastructure domain in France');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.1' , 'ADT^A01^ADT_A01');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.2' , 'ADT^A02^ADT_A02');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.3' , 'ADT^A03^ADT_A03');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.4' , 'ADT^A04^ADT_A01');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.5' , 'ADT^A05^ADT_A05');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.6' , 'ADT^A06^ADT_A06');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.7' , 'ADT^A07^ADT_A06');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.9' , 'ADT^A09^ADT_A09');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.10', 'ADT^A10^ADT_A09');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.11', 'ADT^A11^ADT_A09');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.12', 'ADT^A12^ADT_A12');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.13', 'ADT^A13^ADT_A01');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.14', 'ADT^A14^ADT_A05');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.15', 'ADT^A15^ADT_A15');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.16', 'ADT^A16^ADT_A16');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.17', 'ADT^A21^ADT_A21');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.18', 'ADT^A22^ADT_A21');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.20', 'ADT^A25^ADT_A21');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.21', 'ADT^A26^ADT_A21');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.22', 'ADT^A27^ADT_A21');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PDS'), (select id from tf_transaction where keyword = 'ITI-30'), '2.16.840.1.113883.2.8.3.1.23', 'ADT^A28^ADT_A05');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PDS'), (select id from tf_transaction where keyword = 'ITI-30'), '2.16.840.1.113883.2.8.3.1.24', 'ADT^A31^ADT_A05');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.25', 'ADT^A32^ADT_A21');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.26', 'ADT^A33^ADT_A21');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.28', 'ADT^A38^ADT_A38');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PDS'), (select id from tf_transaction where keyword = 'ITI-30'), '2.16.840.1.113883.2.8.3.1.30', 'ADT^A40^ADT_A39');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.31', 'ADT^A44^ADT_A43');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PDS'), (select id from tf_transaction where keyword = 'ITI-30'), '2.16.840.1.113883.2.8.3.1.32', 'ADT^A47^ADT_A30');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.33', 'ADT^A52^ADT_A52');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.34', 'ADT^A53^ADT_A52');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.35', 'ADT^A54^ADT_A54');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.36', 'ADT^A55^ADT_A52');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.37', 'ADT^Z80^ADT_A01');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.38', 'ADT^Z81^ADT_A01');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.39', 'ADT^Z82^ADT_A01');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.40', 'ADT^Z83^ADT_A01');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.41', 'ADT^Z84^ADT_A01');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.42', 'ADT^Z85^ADT_A01');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.43', 'ADT^Z86^ADT_A01');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.44', 'ADT^Z87^ADT_A01');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.45', 'ADT^Z88^ADT_A01');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.46', 'ADT^Z89^ADT_A01');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PES'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.47', 'ADT^Z99^ADT_A01');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PDC'), (select id from tf_transaction where keyword = 'ITI-30'), '2.16.840.1.113883.2.8.3.1.48', 'ACK^ALL^ACK');
INSERT INTO validation_parameters(id, validator_type, domain_id, actor_id, transaction_id, profile_oid, message_type) VALUES (nextval('ort_validation_parameters_id_seq'), 0, (select id from tf_domain where keyword = 'ITI-FR'), (select id from tf_actor where keyword = 'PEC'), (select id from tf_transaction where keyword = 'ITI-31'), '2.16.840.1.113883.2.8.3.1.49', 'ACK^ALL^ACK');

INSERT INTO pam_encounter_management_event (id, insert_trigger_event, cancel_trigger_event, update_trigger_event, event_name, page_id, available, selection) VALUES (nextval('pam_encounter_management_event_id_seq'), 'Z80', 'Z81', 'Z99', 'Change of medical ward', 'IHE', true, 1);
--INSERT INTO pam_encounter_management_event (id, insert_trigger_event, cancel_trigger_event, update_trigger_event, event_name, page_id, available, selection) VALUES (nextval('pam_encounter_management_event_id_seq'), 'Z82', 'Z83', 'Z99', 'Change of pending medical ward', 'IHE', true, 1);
INSERT INTO pam_encounter_management_event (id, insert_trigger_event, cancel_trigger_event, update_trigger_event, event_name, page_id, available, selection) VALUES (nextval('pam_encounter_management_event_id_seq'), 'Z84', 'Z85', 'Z99', 'Change of nursing ward', 'IHE', true, 1);
--INSERT INTO pam_encounter_management_event (id, insert_trigger_event, cancel_trigger_event, update_trigger_event, event_name, page_id, available, selection) VALUES (nextval('pam_encounter_management_event_id_seq'), 'Z86', 'Z87', 'Z99', 'Change of pending nursing ward', 'IHE', true, 1);
INSERT INTO pam_encounter_management_event (id, insert_trigger_event, cancel_trigger_event, update_trigger_event, event_name, page_id, available, selection) VALUES (nextval('pam_encounter_management_event_id_seq'), 'Z88', 'Z89', 'Z99', 'Change of conditions of the medico-administrative management', 'IHE', true, 1);

--INSERT INTO pam_simulator_feature (id, keyword, label, enabled) VALUES (nextval('pam_simulator_feature_id_seq'), 15, 'ITI-FR - 	French version of the ITI profiles', true);