create table facilitylevel(
 facility            bpchar ,
 comment             bpchar ,
 tel                 bpchar ,
 fax                 bpchar ,
 address             bpchar ,
 dept                bpchar ,
 responsible_person  bpchar ,
 web_address         bpchar ,
 mail                bpchar 
);


insert into facilitylevel values 
('2007 RSNA',
'pgctn 2007 RSNA version',
'111-2222-3333',
'444-5555-6666',
'RSNA',
'pgctn',
'organizer',
'http://your-website.net',
'your@mail.address'
);

create table reportlevel(
 stuinsuid     bpchar ,
 report        bpchar ,
 summary       bpchar ,
 drname        bpchar ,
 diagtime      bpchar ,
 refimage      oid    ,
 clinicalinfo  bpchar ,
 dept          bpchar ,
 imagediag     bpchar ,
 tequnitian    bpchar ,
 discount      bpchar ,
 comment       bpchar ,
 stutim2       bpchar ,
 print         bpchar ,
 refimage2     oid    ,
 refimage3     oid    ,
 refimage4     oid    ,
 refimage5     oid    ,
 refimage6     oid    ,
 orderimage    oid    ,
 bookmark      bpchar ,
 patparentrep  bpchar ,
 orderdr       bpchar ,
 ruid          bpchar ,
 analysis1     oid    ,
 analysis2     oid    ,
 analysis3     oid    ,
 analysis4     oid    ,
 analysis5     oid    ,
 analysis6     oid    ,
 ward          bpchar ,
 refimage7     oid    ,
 refimage8     oid    ,
 refimage9     oid    ,
 refimage10    oid    
);

create table link_level(
 ruid         bpchar ,
 discription  bpchar ,
 url          bpchar ,
 engine       bpchar ,
 comment      bpchar 
);



grant all on reportlevel to apache;
grant all on facilitylevel to apache;
grant all on link_level to apache;

grant all on patient to apache;
grant all on study to apache;
grant all on series to apache;
grant all on files to apache;
grant all on instance to apache;
