jschill2628
Programmer
So I want to create a view. I have a table and based on the code type, and coverage it should pull up a severity associated with it.
Data:
CODE_TYPE CODE- CODE_DESC coverage
100081 A- No Error capacity to cause error MED
100081 B- Error No Harm did not reach patient MED
100081 C- Error No Harm reached patient MED
100081 D- Error No Harm reach pt MED
100081 E- Error Harm Temporary reqd intervention MED
100081 F- Error Harm Temporary req MED
100081 G- Error Harm contributed to MED
100081 H- Error Harm Req Intervention MED
100081 I- Error Death MED
100084 00-Near Miss ADR, BEH,LAB, EQUI, MAT, SURG, PCE, IVBP
100084 01 No Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 02-No Detectable Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 03-Minimal - Temporary Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 04-Minimal - Permanent Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 05-Moderate - Temporary Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 06-Moderate - Permanent Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 07-Severe - Temporary Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 08-Severe - Permanent Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 09-Death ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
98 05-None FALL
98 10-Minor FALL
98 15-Moderate FALL
98 20-Major FALL
98 25-Death FALL
SQL Query:
SELECT "IRSCODE"."CODE_TYPE", "IRSCODE"."CODE", "IRSCODE"."CODE_DESC", "IRSCODE"."CODE_MAJ"
FROM "Stars"."stars"."IRSCODE" "IRSCODE"
Selection Criteria:
If {IRSCODE.CODE_MAJ} = "FALL" then {IRSCODE.CODE_TYPE}= "98" else
If {IRSCODE.CODE_MAJ} = "MED" then {IRSCODE.CODE_TYPE}= "100081" else
If {IRSCODE.CODE_MAJ} = "****" then {IRSCODE.CODE_TYPE}= "100084"
What I want to do is to be able to create a view using the SQL Query, and then turn that view into a parameter, having the user select the coverage, and then the severity code and description would appear, based on the selected criteria.
I hope I explained this well, I am using Crystal XI.
Thanks
Data:
CODE_TYPE CODE- CODE_DESC coverage
100081 A- No Error capacity to cause error MED
100081 B- Error No Harm did not reach patient MED
100081 C- Error No Harm reached patient MED
100081 D- Error No Harm reach pt MED
100081 E- Error Harm Temporary reqd intervention MED
100081 F- Error Harm Temporary req MED
100081 G- Error Harm contributed to MED
100081 H- Error Harm Req Intervention MED
100081 I- Error Death MED
100084 00-Near Miss ADR, BEH,LAB, EQUI, MAT, SURG, PCE, IVBP
100084 01 No Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 02-No Detectable Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 03-Minimal - Temporary Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 04-Minimal - Permanent Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 05-Moderate - Temporary Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 06-Moderate - Permanent Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 07-Severe - Temporary Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 08-Severe - Permanent Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 09-Death ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
98 05-None FALL
98 10-Minor FALL
98 15-Moderate FALL
98 20-Major FALL
98 25-Death FALL
SQL Query:
SELECT "IRSCODE"."CODE_TYPE", "IRSCODE"."CODE", "IRSCODE"."CODE_DESC", "IRSCODE"."CODE_MAJ"
FROM "Stars"."stars"."IRSCODE" "IRSCODE"
Selection Criteria:
If {IRSCODE.CODE_MAJ} = "FALL" then {IRSCODE.CODE_TYPE}= "98" else
If {IRSCODE.CODE_MAJ} = "MED" then {IRSCODE.CODE_TYPE}= "100081" else
If {IRSCODE.CODE_MAJ} = "****" then {IRSCODE.CODE_TYPE}= "100084"
What I want to do is to be able to create a view using the SQL Query, and then turn that view into a parameter, having the user select the coverage, and then the severity code and description would appear, based on the selected criteria.
I hope I explained this well, I am using Crystal XI.
Thanks