Note: We no longer publish the latest version of our code here. We primarily use a kumc-bmi github organization. The heron ETL repository, in particular, is not public. Peers in the informatics community should see MultiSiteDev for details on requesting access.

source: heron_load/patient_nums/create_deid_patient_mapping.sql @ 0:42ad7288920a

heron-michigan tip
Last change on this file since 0:42ad7288920a was 0:42ad7288920a, checked in by Matt Hoag <mhoag@…>, 6 years ago

Merge with demo_concepts_3800

File size: 1.0 KB
Line 
1/*****************
2 * Script 2 - DEID
3 *****************
4 * Create the patient mapping table that will be used to update the patient
5 * sets in the blueherondata.qt_patient_set_collection table on the deid
6 * database.
7 *
8 * This script makes no user visible changes.
9 */
10
11--Insure the script is being run against the deid production databse
12select 0 as CONNECTED from BLUEHERONDATA.QT_PATIENT_SET_COLLECTION where 0 = 1;
13
14WHENEVER SQLERROR CONTINUE;
15TRUNCATE TABLE ONLY_NEEDED_MAPPINGS;
16DROP TABLE ONLY_NEEDED_MAPPINGS;
17WHENEVER SQLERROR exit;
18
19CREATE TABLE ONLY_NEEDED_MAPPINGS
20 (PATIENT_SET_COLL_ID NUMBER(10,0) NOT NULL ENABLE,
21  RESULT_INSTANCE_ID NUMBER(5,0),
22  SET_INDEX NUMBER(10,0),
23  PATIENT_NUM NUMBER(10,0),
24  BACKUP_ID NUMBER(*,0) NOT NULL ENABLE,
25  QUERY_INSTANCE_ID NUMBER(5,0),
26  CURRENT_PATIENT_NUM NUMBER(38,0),
27  CPNUM_MOD NUMBER,
28  max_current_patient_num number,
29CONSTRAINT ONLY_NEEDED_MAPPINGS_PK PRIMARY KEY (PATIENT_SET_COLL_ID));
30
31--Continue to Script 3: insert_deid_patient_mapping.sql on the id database
Note: See TracBrowser for help on using the repository browser.