oracle-Data for vertical printing

Source: Internet
Author: User

--a data sheet for storing the re-rating
CREATE TABLE ZZPFapache2
(
Zz_datetime date,--time
Zz_zongfen INTEGER,--Total
Zz_shiwanglui INTEGER,--mortality
Zz_bingrenid VARCHAR2 (50),--Patient ID
Zz_h1f1 INTEGER,--1th row 1 points
ZZ_H1M1 VARCHAR2 (40),
Zz_h1f2 INTEGER,--1th row 2 points
ZZ_H1M2 VARCHAR2 (40),
Zz_h2f1 INTEGER,--2nd row 1 points
ZZ_H2M1 VARCHAR2 (40),
Zz_h2f2 INTEGER,--2nd row 2 points
ZZ_H2M2 VARCHAR2 (40),
Zz_h2f3 INTEGER,--2nd row 3 points
ZZ_H2M3 VARCHAR2 (40),
Zz_h3f1 INTEGER,--3rd row 1 points
ZZ_H3M1 VARCHAR2 (40),
Zz_h3f2 INTEGER,--3rd row 2 points
zz_h3m2 VARCHAR2 (40),
Zz_h3f3 INTEGER,--3rd row 3 points
ZZ_H3M3 VARCHAR2 (40),
Zz_h4f1 INTEGER,--4th row 1 points
ZZ_H4M1 VARCHAR2 (40),
Zz_h4f2 INTEGER,--4th row 2 points
zz_h4m2 VARCHAR2 (40),
Zz_h4f3 INTEGER,--4th row 3 points
ZZ_H4M3 VARCHAR2 (40),
Zz_h5f1 INTEGER,--5th row 1 points
ZZ_H5M1 VARCHAR2 (40),
Zz_h5f2 INTEGER,--5th row 2 points
zz_h5m2 VARCHAR2 (40),
Zz_h5f3 INTEGER,--5th row 3 points
ZZ_H5M3 VARCHAR2 (40),
Zz_h6f1 INTEGER,--6th row 1 points
ZZ_H6M1 VARCHAR2 (40),
Zz_h6f2 INTEGER,--6th row 2 points
ZZ_H6M2 VARCHAR2 (40),
Zz_h7f1 INTEGER,--7th row 1 points
ZZ_H7M1 VARCHAR2 (40),
Zz_h7f2 INTEGER,--6th row 2 points
zz_h7m2 VARCHAR2 (40),
Zz_h8f1 INTEGER,--8th row 1 points
ZZ_H8M1 VARCHAR2 (40),
Zz_h8f2 INTEGER,--8th row 2 points
zz_h8m2 VARCHAR2 (40),
Zz_f1 INTEGER,--check 1th points
Zz_f2 INTEGER,--check 2nd points
Zz_f3 INTEGER,--Check 3rd points
Zz_f4 INTEGER,--Check 4th points
Zz_f5 INTEGER,--Check 5th points
Zz_guserid VARCHAR2 (40),
Zz_gusername VARCHAR2 (40)
)
Tablespace Ts_imis
Pctfree 10
Initrans 1
Maxtrans 255
Storage
(
Initial 64K
Minextents 1
Maxextents Unlimited
);

--storage of severe scores vertical data View
Create or replace view ZZPFDY as
Select "Zz_bingrenid", "Zz_datetime", "SUBJECT1", "RESULT" from
(
Select 1 line,zz_bingrenid,zz_datetime, ' score ' SUBJECT1, zz_zongfen result from zzpfapache2
UNION ALL
Select 2 Line,zz_bingrenid,zz_datetime, ' death rate ' SUBJECT1, zz_shiwanglui result from zzpfapache2
UNION ALL
Select 3 Line,zz_bingrenid,zz_datetime, ' age ' SUBJECT1, zz_h1f1 result from zzpfapache2
UNION ALL
Select 4 Line,zz_bingrenid,zz_datetime, ' with severe chronic organ system dysfunction ' SUBJECT1,ZZ_H1F2 result from zzpfapache2
UNION ALL
Select 5 Line,zz_bingrenid,zz_datetime, ' Open Eyes ' SUBJECT1, zz_h2f1 result from zzpfapache2
UNION ALL
Select 6 Line,zz_bingrenid,zz_datetime, ' verbal reaction ' subject1,zz_h2f2 result from zzpfapache2
UNION ALL
Select 7 Line,zz_bingrenid,zz_datetime, ' motion response ' subject1,zz_h2f3 result from zzpfapache2
UNION ALL
Select 8 Line,zz_bingrenid,zz_datetime, ' body temperature ' subject1,zz_h3f1 result from zzpfapache2
UNION ALL
Select 9 line,zz_bingrenid,zz_datetime, ' mean blood pressure (mmHg) ' SUBJECT1, zz_h3f2 result from zzpfapache2
UNION ALL
Select Ten Line,zz_bingrenid,zz_datetime, ' heart rate (times/minute) ' SUBJECT1, zz_h3f3 result from zzpfapache2
UNION ALL
Select one Line,zz_bingrenid,zz_datetime, ' breath (Times/minutes) ' SUBJECT1, zz_h4f1 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' FIO2 ' subject1,zz_h4f2 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' serum HCO3 (no abgs) (mmol/l) ' subject1,zz_h4f3 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' serum na (mmol/l) ' subject1,zz_h5f1 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' serum K (mmol/l) ' subject1,zz_h5f2 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' arterial blood ph ' SUBJECT1, zz_h5f3 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' blood cell hematocrit (%) ' subject1,zz_h6f1 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' WBC (*1000/mm3) ' subject1,zz_h6f2 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' Pa02 (MmHg ... KPa) ' subject1,zz_h7f1 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' a-ad02 (MmHg ... KPa) ' Subject1,zz_h7f2 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' serum creatinine (mg/dl. MICROMOL/L) ' Subject1,zz_h8f1 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' acute renal failure ' subject1,zz_h8f2 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' functional non-immune impairment: liver ' subject1,zz_f1 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' functional non-immune damage: Cardiovascular ' subject1,zz_f2 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' functional non-immune damage: respiratory ' subject1,zz_f3 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' functional incomplete immune impairment: Kidney ' subject1,zz_f4 result from zzpfapache2
UNION ALL
Select Line,zz_bingrenid,zz_datetime, ' functional non-immune impairment: immunosuppression state ' subject1,zz_f5 result from zzpfapache2
) T
Order by Zz_datetime, line;


--Multiple columns when printing, so add a multi-column view
CREATE OR REPLACE VIEW ZZPFDY2 as
SELECT
A.subject1,
A.ZZ_DATETIME,A.N, A.zz_bingrenid, A.result,
B.N bn, B.zz_bingrenid Bp,b.zz_datetime bt, B.result as RESULT1,
C.N cn, C.zz_bingrenid Cp,c.zz_datetime CT, c.result as RESULT2,
D.N dn, d.zz_bingrenid dp,d.zz_datetime DT, d.result as RESULT3,
E.N en, E.zz_bingrenid ep,e.zz_datetime et, e.result as RESULT4,
F.N FN, F.zz_bingrenid fp,f.zz_datetime ft, F.result as Result5
From

(SELECT N, result, Zz_bingrenid,zz_datetime,subject1
From (SELECT ROWNUM N, result, zz_bingrenid,zz_datetime,subject1 from ZZPF
)
WHERE MOD (Floor ((N-1)/27), 6) = 0
A
(SELECT N, result, zz_bingrenid,zz_datetime
From (SELECT ROWNUM N, result,zz_bingrenid,zz_datetime from ZZPF
)
WHERE MOD (Floor ((N-1)/27), 6) = 1
B
(SELECT N, result, zz_bingrenid,zz_datetime
From (SELECT ROWNUM N, result, zz_bingrenid,zz_datetime from ZZPF
)
WHERE MOD (Floor ((N-1)/27), 6) = 2
C
(SELECT N, result, zz_bingrenid,zz_datetime
From (SELECT ROWNUM N, result, zz_bingrenid,zz_datetime from ZZPF
)
WHERE MOD (Floor ((N-1)/27), 6) = 3
D
(SELECT N, result, zz_bingrenid,zz_datetime
From (SELECT ROWNUM N, result, zz_bingrenid,zz_datetime from ZZPF
)
WHERE MOD (Floor ((N-1)/27), 6) = 4
E
(SELECT N, result, zz_bingrenid,zz_datetime
From (SELECT ROWNUM N, result, zz_bingrenid,zz_datetime from ZZPF
)
WHERE MOD (Floor ((N-1)/27), 6) = 5
) F

WHERE A.N + = B.N (+) and B.N + + = C.N (+) and
C.N + = D.N (+) and D.N + + = E.N (+) and
E.N + = F.N (+);

--Middle view of portrait and print view
Create or Replace View ZZPF as (SELECT * from Zzpfdy where zz_bingrenid= ' 1545187 ')

oracle-Data for vertical printing

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.