Commits

Michael Blagg authored ee096a47cd9 Merge
Merge remote-tracking branch 'origin/feature/CR-95-96-miba-mirror-table-issues' into feature/CR-95-96-miba-mirror-table-issues
No tags

compose/database/changesets/create-test_result-table.sql

Modified
1 1 -- liquibase formatted sql
2 2 -- changeset mbl@nine.dk:create-test_result-table
3 3
4 4 create or replace table test_result
5 5 (
6 - test_identifier varchar(15) primary key not null comment 'Unik identifier af prøvesvaret',
7 - batch_no varchar(15) not null comment 'Batch job identifier',
6 + test_identifier bigint primary key not null comment 'Unik identifier af prøvesvaret',
8 7 person_identifier char(10) not null comment 'CPR-nummer',
9 8 type_of_test varchar(15) not null comment 'Description of the type of test that was conducted, e.g. RT-PCR or rapid antigen test.
10 9 In the case of a rapid antigen tests, the form should provide details on the manufacturer and commercial name of the test used',
11 - test_name varchar(50) not null comment 'Commercial or brand name of the RT-PCR or rapid antigen test. Pt. kun for AG-test',
12 - test_manufacturer varchar(50) not null comment 'Manufacturer of the RT-PCR or rapid antigen test. Kun for AG-test',
13 - timestamp_sample datetime not null comment 'Date when the sample for the test was collected',
14 - timestamp_result datetime not null comment 'Date when the test was determined',
15 - result_of_the_test boolean not null comment 'Negative (false) or positive (true)',
16 - testing_centre_or_facility varchar(50) not null comment 'Name/code of testing centre, facility or a health authority responsible for the testing event. Kun for AG-test',
17 - timestamp_last_update datetime not null comment 'Date when the test was last updated (in KIDS)',
10 + test_name varchar(100) not null comment 'Commercial or brand name of the RT-PCR or rapid antigen test. Pt. kun for AG-test',
11 + test_manufacturer varchar(100) not null comment 'Manufacturer of the RT-PCR or rapid antigen test. Kun for AG-test',
12 + timestamp_sample timestamp not null comment 'Date when the sample for the test was collected',
13 + timestamp_result timestamp not null comment 'Date when the test was determined',
14 + result_of_the_test varchar(15) not null comment 'Negative (false) or positive (true)',
15 + testing_centre_or_facility varchar(100) not null comment 'Name/code of testing centre, facility or a health authority responsible for the testing event. Kun for AG-test',
16 + timestamp_last_update timestamp not null comment 'Date when the test was last updated (in KIDS)',
18 17 sletteflag bit not null comment 'Markering af logisk sletning, digi2: 0 for ikke-slettet og 1 for slettet'
19 18 );
20 19
21 -create or replace unique index test_identifier on test_result (test_identifier);
20 +create or replace index ix__test_result_cpr on test_result (person_identifier);
21 +create or replace index ix__test_result_delete on test_result (timestamp_result, result_of_the_test);

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut