File: CreateDIMTables.script

package info (click to toggle)
ctn 3.2.0~dfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,936 kB
  • sloc: ansic: 179,652; makefile: 7,007; java: 1,863; csh: 1,067; yacc: 523; sh: 424; cpp: 394; sql: 389; lex: 170
file content (137 lines) | stat: -rw-r--r-- 3,130 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
CREATE TABLE PatientLevel
	(
	PatNam		char(64)	not null,
	PatID		char(64) 	primary key,
	PatBirDat	int		not null,
	PatBirTim	real,
	PatSex		char(16)	not null,
	NumPatRelStu	int		not null,
	NumPatRelSer	int		not null,
	NumPatRelIma	int		not null,
	InsertDate	int		not null,
	InsertTime	real 		not null,
	Owner		char(16),
	GroupName	char(16),
	Priv		char(9)
	);

CREATE TABLE StudyLevel
	(
	StuDat		int		not null,
	StuTim		real		not null,
	AccNum		char(16)	not null,
	StuID		char(16)	not null,
	StuInsUID	char(64)	primary key,
	RefPhyNam	char(64)	not null,
	StuDes		char(64),
	PatAge		char(4),
	PatSiz		char(16),
	PatWei		char(16),
	NumStuRelSer	int		not null,
	NumStuRelIma	int		not null,
	InsertDate	int		not null,
	InsertTime	real		not null,
	Owner		char(16),
	GroupName	char(16),
	Priv		char(9),
	PatParent	char(64)	not null
	);

CREATE TABLE SeriesLevel
	(
	Mod		char(16)	not null,
	SerNum		char(12)	not null,
	SerInsUID	char(64)	primary key,
	ProNam		char(64),
	SerDes		char(64),
	BodParExa	char(16),
	ViePos		char(16),
	NumSerRelIma	int		not null,
	InsertDate	int		not null,
	InsertTime	real		not null,
	Owner		char(16),
	GroupName	char(16),
	Priv		char(9),
	StuParent	char(64)	not null
	);

CREATE TABLE ImageLevel
	(
	ImaNum		char(12)	not null,
	SOPInsUID	char(64)	primary key,
	SOPClaUID	char(64)	not null,
	SamPerPix	int		not null,
	PhoInt		char(16)	not null,
	Row		int		not null,
	Col		int		not null,
	BitAll		int		not null,
	BitSto		int		not null,
	PixRep		int		not null,
	PatOri		char(16),
	InsertDate	int		not null,
	InsertTime	real		not null,
	Owner		char(16),
	GroupName	char(16),
	Priv		char(9),
	SerParent	char(64)	not null
	);

CREATE TABLE InstanceTable
	(
	ImageUID	char(64)	not null,
	RespondingTitle char(16) 	,
	Medium         	char(32),
	Path           	char(255) 	not null,
	Size		int 		not null,
	Transfer	char(64) 	not null
	);


CREATE view PatientStudyView ( Pat_PatNam, Pat_PatID, Pat_PatBirDat,
	Pat_PatBirTim,
	Pat_PatSex, Pat_NumPatRelStu, Pat_NumPatRelSer, Pat_NumPatRelIma,
	Pat_InsertDate, Pat_InsertTime, Pat_Owner, Pat_GroupName,
	Pat_Priv, 
	Stu_StuDat, Stu_StuTim, Stu_AccNum, Stu_StuID,
	Stu_StuInsUID, Stu_RefPhyNam, Stu_StuDes, Stu_PatAge,
	Stu_PatSiz, Stu_PatWei, Stu_NumStuRelSer, Stu_NumStuRelIma,
	Stu_InsertDate, Stu_InsertTime, Stu_Owner, Stu_GroupName,
	Stu_Priv, Stu_PatParent
	)

	as select
	PatientLevel.PatNam,
	PatientLevel.PatID,
	PatientLevel.PatBirDat,
	PatientLevel.PatBirTim,
	PatientLevel.PatSex,
	PatientLevel.NumPatRelStu,
	PatientLevel.NumPatRelSer,
	PatientLevel.NumPatRelIma,
	PatientLevel.InsertDate,
	PatientLevel.InsertTime,
	PatientLevel.Owner,
	PatientLevel.GroupName,
	PatientLevel.Priv,

	StudyLevel.StuDat,
	StudyLevel.StuTim,
	StudyLevel.AccNum,
	StudyLevel.StuID,
	StudyLevel.StuInsUID,
	StudyLevel.RefPhyNam,
	StudyLevel.StuDes,
	StudyLevel.PatAge,
	StudyLevel.PatSiz,
	StudyLevel.PatWei,
	StudyLevel.NumStuRelSer,
	StudyLevel.NumStuRelIma,
	StudyLevel.InsertDate,
	StudyLevel.InsertTime,
	StudyLevel.Owner,
	StudyLevel.GroupName,
	StudyLevel.Priv,
	StudyLevel.PatParent

	from PatientLevel, StudyLevel where
	PatientLevel.PatID = StudyLevel.PatParent;