Message from: minalen_828
Select
cdm_number || ’ - ’ || cdm_desc,
substr(to_char(service_date), 1 , 4 ) || ’ Q’ ||
to_char(to_date(to_char(service_date),
‘YYYYMMDD’ ), ‘Q’ ),
substr(to_char(service_date), 1 , 4 ) || ‘-’ ||
substr(to_char(service_date), 5 , 2 ), dept_num ||
’ - ’ || dept_desc,
DECODE(ordering_phys, 0 , attending_phys, ordering_phys) || ’ - ’ ||
DECODE(ordering_phys,
0 , attending_phys_name, phys1.physician_name),
DECODE(pat.referring_phys, 0 , ‘0 - NONE’ , pat.referring_phys || ’
- ’ || phys2.physician_name), DECODE(pat.admit_source,
NULL , ‘NONE’ ,pat.admit_source || ’ - ’ ||
pat.admit_source_desc),
DECODE(ext.referral_institution, NULL , ‘0 - NONE’
,ext.referral_institution || ’ - ’ || r.ref_inst_desc), hospital_service
||
’ - ’ || hospital_service_desc,
DECODE(prim_ins_code, NULL , ‘NONE’ , prim_ins_code || ’ - ’ ||
prim_ins_desc), substr(pat.zip_code,
1 , 5 ),
DECODE(pat.patient_category, ‘I’ , ‘Inpatient’ ,
‘O’ , ‘Outpatient’ ,
‘E’ , ‘Emergency’ ,
‘N’ , ‘Outpat Zero Charges’ , ‘A’ , ‘Ambulatory’
)
cpt4_code,
cins.cais_fin_class || ’ - ’ || fin.fin_class_desc,
sum (quantity),
sum (amount)
FROM uh_charges chg,
uh_physicians phys1,
uh_physicians phys2,
uh_patient_account pat,
uh_pat_acct_ext ext,
uh_refer_inst r,
uh_cais_ins cins,
uh_financial_classes fin
WHERE service_date between 20100101 and 20101231 AND
pat.patient_account_number = chg.patient_account_number AND
pat.patient_account_number = ext.patient_account_number AND
ext.referral_institution = r.ref_inst_code (+) AND
pat.prim_ins_code = cins.cais_ins_code (+) AND
cins.cais_fin_class = fin.fin_class_code (+) AND
chg.ordering_phys = phys1.physician_number (+) AND
pat.referring_phys = phys2.physician_number (+) AND
cdm_number >= 10000000
GROUP BY cdm_number || ’ - ’ || cdm_desc,
substr(to_char(service_date), 1 , 4 ) || ’ Q’ ||
to_char(to_date(to_char(service_date),
‘YYYYMMDD’ ), ‘Q’ ),
substr(to_char(service_date), 1 , 4 ) || ‘-’ ||
substr(to_char(service_date), 5 , 2 ), dept_num ||
’ - ’ || dept_desc,
DECODE(ordering_phys, 0 , attending_phys, ordering_phys) || ’ - ’ ||
DECODE(ordering_phys,
0 , attending_phys_name, phys1.physician_name),
DECODE(pat.referring_phys, 0 , ‘0 - NONE’ , pat.referring_phys || ’
- ’ || phys2.physician_name),DECODE(pat.admit_source,
NULL , ‘NONE’ ,pat.admit_source || ’ - ’ ||
pat.admit_source_desc),
DECODE(ext.referral_institution, NULL , ‘0 - NONE’
,ext.referral_institution || ’ - ’ || r.ref_inst_desc), hospital_service
||
’ - ’ || hospital_service_desc,
DECODE(prim_ins_code, NULL , ‘NONE’ , prim_ins_code || ’ - ’ ||
prim_ins_desc),substr(pat.zip_code,
1 , 5 ) ,
DECODE(pat.patient_category, ‘I’ , ‘Inpatient’ ,
‘O’ , ‘Outpatient’ ,
‘E’ , ‘Emergency’ ,
‘N’ , ‘Outpat Zero Charges’ , ‘A’ , ‘Ambulatory’
),
cpt4_code,
cins.cais_fin_class || ’ - ’ || fin.fin_class_desc
ORDER BY cdm_number || ’ - ’ || cdm_desc
Historical Messages
Author: minalen_828
Date: Fri Jun 10 08:06:47 PDT 2011
Select
cdm_number || ’ - ’ || cdm_desc,
substr(to_char(service_date), 1 , 4 ) || ’ Q’ ||
to_char(to_date(to_char(service_date),
‘YYYYMMDD’ ), ‘Q’ ),
substr(to_char(service_date), 1 , 4 ) || ‘-’ ||
substr(to_char(service_date), 5 , 2 ), dept_num ||
’ - ’ || dept_desc,
DECODE(ordering_phys, 0 , attending_phys, ordering_phys) || ’ - ’ ||
DECODE(ordering_phys,
0 , attending_phys_name, phys1.physician_name),
DECODE(pat.referring_phys, 0 , ‘0 - NONE’ , pat.referring_phys || ’
- ’ || phys2.physician_name), DECODE(pat.admit_source,
NULL , ‘NONE’ ,pat.admit_source || ’ - ’ ||
pat.admit_source_desc),
DECODE(ext.referral_institution, NULL , ‘0 - NONE’
,ext.referral_institution || ’ - ’ || r.ref_inst_desc), hospital_service
||
’ - ’ || hospital_service_desc,
DECODE(prim_ins_code, NULL , ‘NONE’ , prim_ins_code || ’ - ’ ||
prim_ins_desc), substr(pat.zip_code,
1 , 5 ),
DECODE(pat.patient_category, ‘I’ , ‘Inpatient’ ,
‘O’ , ‘Outpatient’ ,
‘E’ , ‘Emergency’ ,
‘N’ , ‘Outpat Zero Charges’ , ‘A’ , ‘Ambulatory’
)
cpt4_code,
cins.cais_fin_class || ’ - ’ || fin.fin_class_desc,
sum (quantity),
sum (amount)
FROM uh_charges chg,
uh_physicians phys1,
uh_physicians phys2,
uh_patient_account pat,
uh_pat_acct_ext ext,
uh_refer_inst r,
uh_cais_ins cins,
uh_financial_classes fin
WHERE service_date between 20100101 and 20101231 AND
pat.patient_account_number = chg.patient_account_number AND
pat.patient_account_number = ext.patient_account_number AND
ext.referral_institution = r.ref_inst_code (+) AND
pat.prim_ins_code = cins.cais_ins_code (+) AND
cins.cais_fin_class = fin.fin_class_code (+) AND
chg.ordering_phys = phys1.physician_number (+) AND
pat.referring_phys = phys2.physician_number (+) AND
cdm_number >= 10000000
GROUP BY cdm_number || ’ - ’ || cdm_desc,
substr(to_char(service_date), 1 , 4 ) || ’ Q’ ||
to_char(to_date(to_char(service_date),
‘YYYYMMDD’ ), ‘Q’ ),
substr(to_char(service_date), 1 , 4 ) || ‘-’ ||
substr(to_char(service_date), 5 , 2 ), dept_num ||
’ - ’ || dept_desc,
DECODE(ordering_phys, 0 , attending_phys, ordering_phys) || ’ - ’ ||
DECODE(ordering_phys,
0 , attending_phys_name, phys1.physician_name),
DECODE(pat.referring_phys, 0 , ‘0 - NONE’ , pat.referring_phys || ’
- ’ || phys2.physician_name),DECODE(pat.admit_source,
NULL , ‘NONE’ ,pat.admit_source || ’ - ’ ||
pat.admit_source_desc),
DECODE(ext.referral_institution, NULL , ‘0 - NONE’
,ext.referral_institution || ’ - ’ || r.ref_inst_desc), hospital_service
||
’ - ’ || hospital_service_desc,
DECODE(prim_ins_code, NULL , ‘NONE’ , prim_ins_code || ’ - ’ ||
prim_ins_desc),substr(pat.zip_code,
1 , 5 ) ,
DECODE(pat.patient_category, ‘I’ , ‘Inpatient’ ,
‘O’ , ‘Outpatient’ ,
‘E’ , ‘Emergency’ ,
‘N’ , ‘Outpat Zero Charges’ , ‘A’ , ‘Ambulatory’
),
cpt4_code,
cins.cais_fin_class || ’ - ’ || fin.fin_class_desc
ORDER BY cdm_number || ’ - ’ || cdm_desc
__
Author: Jeff Smith
Date: Fri Jun 10 07:53:06 PDT 2011
Show us your code.
__
Author: minalen_828
Date: Fri Jun 10 07:53:06 PDT 2011
Message from: minalen_828 I’m a new user to Toad and want to use some of the
better features that PL/SQL doesn’t give me. I have Pl/SQL code that
executes in Pl?sql developer -But when I open in Toad it throws all kind of
errors (ORA-00907). It’s becuase it’s converting || statements to CONCAT
satements and inserting all kinds of parenthesis ( into the code. I’m on
Oracle 10g Is there a setting in Toad so it doesn’t do any conversion ?
Thanks in advance _______________________________________ Historical Messages
Author: minalen_828 Date: Fri Jun 10 07:53:06 PDT 2011 I’m a new user to
Toad and want to use some of the better features that PL/SQL doesn’t give
me. I have Pl/SQL code that executes in Pl?sql developer -But when I open in
Toad it throws all kind of errors (ORA-00907). It’s becuase it’s
converting || statements to CONCAT satements and inserting all kinds of
parenthesis ( into the code. I’m on Oracle 10g Is there a setting in Toad so
it doesn’t do any conversion ? Thanks in advance __
__