Greetings:
I am a user from a medical facility. I have been asked to write a report (Crystal 10) showing all physicians who consulted on cases where the DRG was 82. (DRG's enable specific forms of reimbursement to hospitals.) Also specific charges or 'activity codes' were included in the select clause. When I run the report each consultant 'repeats ' for as many activity codes as there are. For example, if there were 4 codes and 4 consultants I will have a total quantity of 16. I've tried grouping the consultants, inputting them on a subreport, but to no avail. I've checked my links and I believe they are OK. Please advise. The 4 views I have brought into the report are visit (basic patient info), activity (charges), pract_cons (Physician consult info), smd_consult_v (consult priority, consult date time, etc).
Here is my SQL Query:
SELECT DISTINCT "c_cmb_vst_v_20050303"."pt_id", "c_cmb_vst_v_20050303"."pt_name", "c_cmb_vst_v_20050303"."adm_date", "c_cmb_vst_v_20050303"."med_rec_no", "c_cmb_vst_v_20050303"."dsch_date", "c_cmb_vst_v_20050303"."drg_no", "c_cmb_actv_v_20050303"."actv_cd_desc", "c_cmb_actv_v_20050303"."actv_tot_qty", "c_cmb_vst_v_20050303"."drg_serv_line", "c_cmb_vst_v_20050303"."hosp_svc", "c_cmb_vst_v_20050303"."len_of_stay", "c_cmb_vst_v_20050303"."tot_chg_amt", "c_cmb_vst_v_20050303"."prim_pyr_cd", "c_cmb_actv_v_20050303"."actv_cd", "c_cmb_vst_v_20050303"."prim_pract_name", "c_cmb_vst_v_20050303"."orgz_cd", "c_cmb_vst_v_20050303"."vst_type_cd", "c_cmb_vst_v_20050303"."dsch_year", "c_pract_dim_cons_v"."pract_name", "c_smd_consult_v"."smd_consult_dtime", "c_smd_consult_v"."smd_consult_dr_prio"
FROM ("SMSPHdssp0r0"."smsdss"."c_cmb_vst_v_20050303" "c_cmb_vst_v_20050303" INNER JOIN "SMSPHdssp0r0"."smsdss"."c_cmb_actv_v_20050303" "c_cmb_actv_v_20050303" ON "c_cmb_vst_v_20050303"."vst_key"="c_cmb_actv_v_20050303"."vst_key") LEFT OUTER JOIN ("SMSPHdssp0r0"."smsdss"."c_pract_dim_cons_v" "c_pract_dim_cons_v" INNER JOIN "SMSPHdssp0r0"."smsdss"."c_smd_consult_v" "c_smd_consult_v" ON "c_pract_dim_cons_v"."pract_no"="c_smd_consult_v"."smd_consult_dr_no") ON ("c_cmb_vst_v_20050303"."pt_id"="c_smd_consult_v"."pt_id") AND ("c_cmb_vst_v_20050303"."orgz_cd"="c_smd_consult_v"."orgz_cd")
WHERE NOT ("c_cmb_vst_v_20050303"."drg_serv_line"='behavioral health' OR "c_cmb_vst_v_20050303"."drg_serv_line"='rehab' OR "c_cmb_vst_v_20050303"."drg_serv_line"='ungroupable') AND "c_cmb_vst_v_20050303"."hosp_svc"<>'hsp' AND "c_cmb_vst_v_20050303"."len_of_stay"<>0 AND "c_cmb_vst_v_20050303"."tot_chg_amt"<>0 AND NOT ("c_cmb_vst_v_20050303"."prim_pyr_cd"='j24' OR "c_cmb_vst_v_20050303"."prim_pyr_cd"='k01' OR "c_cmb_vst_v_20050303"."prim_pyr_cd"='n15') AND "c_cmb_vst_v_20050303"."vst_type_cd"='I' AND "c_cmb_vst_v_20050303"."drg_no"=82 AND ("c_cmb_actv_v_20050303"."actv_cd"='20431011' OR "c_cmb_actv_v_20050303"."actv_cd"='20431029' OR "c_cmb_actv_v_20050303"."actv_cd"='20431037' OR "c_cmb_actv_v_20050303"."actv_cd"='20431078' OR "c_cmb_actv_v_20050303"."actv_cd"='20431086' OR "c_cmb_actv_v_20050303"."actv_cd"='20431094' OR "c_cmb_actv_v_20050303"."actv_cd"='20431169' OR "c_cmb_actv_v_20050303"."actv_cd"='20431177' OR "c_cmb_actv_v_20050303"."actv_cd"='20431219' OR "c_cmb_actv_v_20050303"."actv_cd"='20431227' OR "c_cmb_actv_v_20050303"."actv_cd"='20431235' OR "c_cmb_actv_v_20050303"."actv_cd"='20431243' OR "c_cmb_actv_v_20050303"."actv_cd"='20431250' OR "c_cmb_actv_v_20050303"."actv_cd"='20431359' OR "c_cmb_actv_v_20050303"."actv_cd"='20431367' OR "c_cmb_actv_v_20050303"."actv_cd"='20431375' OR "c_cmb_actv_v_20050303"."actv_cd"='20431599' OR "c_cmb_actv_v_20050303"."actv_cd"='21700059' OR "c_cmb_actv_v_20050303"."actv_cd"='21700067' OR "c_cmb_actv_v_20050303"."actv_cd"='21700562' OR "c_cmb_actv_v_20050303"."actv_cd"='21700786' OR "c_cmb_actv_v_20050303"."actv_cd"='21701057') AND "c_cmb_vst_v_20050303"."orgz_cd"='P0B0' AND "c_cmb_vst_v_20050303"."dsch_year"=2005
ORDER BY "c_cmb_vst_v_20050303"."pt_id",
"c_smd_consult_v"."smd_consult_dr_prio"
Thanks, Maruja
I am a user from a medical facility. I have been asked to write a report (Crystal 10) showing all physicians who consulted on cases where the DRG was 82. (DRG's enable specific forms of reimbursement to hospitals.) Also specific charges or 'activity codes' were included in the select clause. When I run the report each consultant 'repeats ' for as many activity codes as there are. For example, if there were 4 codes and 4 consultants I will have a total quantity of 16. I've tried grouping the consultants, inputting them on a subreport, but to no avail. I've checked my links and I believe they are OK. Please advise. The 4 views I have brought into the report are visit (basic patient info), activity (charges), pract_cons (Physician consult info), smd_consult_v (consult priority, consult date time, etc).
Here is my SQL Query:
SELECT DISTINCT "c_cmb_vst_v_20050303"."pt_id", "c_cmb_vst_v_20050303"."pt_name", "c_cmb_vst_v_20050303"."adm_date", "c_cmb_vst_v_20050303"."med_rec_no", "c_cmb_vst_v_20050303"."dsch_date", "c_cmb_vst_v_20050303"."drg_no", "c_cmb_actv_v_20050303"."actv_cd_desc", "c_cmb_actv_v_20050303"."actv_tot_qty", "c_cmb_vst_v_20050303"."drg_serv_line", "c_cmb_vst_v_20050303"."hosp_svc", "c_cmb_vst_v_20050303"."len_of_stay", "c_cmb_vst_v_20050303"."tot_chg_amt", "c_cmb_vst_v_20050303"."prim_pyr_cd", "c_cmb_actv_v_20050303"."actv_cd", "c_cmb_vst_v_20050303"."prim_pract_name", "c_cmb_vst_v_20050303"."orgz_cd", "c_cmb_vst_v_20050303"."vst_type_cd", "c_cmb_vst_v_20050303"."dsch_year", "c_pract_dim_cons_v"."pract_name", "c_smd_consult_v"."smd_consult_dtime", "c_smd_consult_v"."smd_consult_dr_prio"
FROM ("SMSPHdssp0r0"."smsdss"."c_cmb_vst_v_20050303" "c_cmb_vst_v_20050303" INNER JOIN "SMSPHdssp0r0"."smsdss"."c_cmb_actv_v_20050303" "c_cmb_actv_v_20050303" ON "c_cmb_vst_v_20050303"."vst_key"="c_cmb_actv_v_20050303"."vst_key") LEFT OUTER JOIN ("SMSPHdssp0r0"."smsdss"."c_pract_dim_cons_v" "c_pract_dim_cons_v" INNER JOIN "SMSPHdssp0r0"."smsdss"."c_smd_consult_v" "c_smd_consult_v" ON "c_pract_dim_cons_v"."pract_no"="c_smd_consult_v"."smd_consult_dr_no") ON ("c_cmb_vst_v_20050303"."pt_id"="c_smd_consult_v"."pt_id") AND ("c_cmb_vst_v_20050303"."orgz_cd"="c_smd_consult_v"."orgz_cd")
WHERE NOT ("c_cmb_vst_v_20050303"."drg_serv_line"='behavioral health' OR "c_cmb_vst_v_20050303"."drg_serv_line"='rehab' OR "c_cmb_vst_v_20050303"."drg_serv_line"='ungroupable') AND "c_cmb_vst_v_20050303"."hosp_svc"<>'hsp' AND "c_cmb_vst_v_20050303"."len_of_stay"<>0 AND "c_cmb_vst_v_20050303"."tot_chg_amt"<>0 AND NOT ("c_cmb_vst_v_20050303"."prim_pyr_cd"='j24' OR "c_cmb_vst_v_20050303"."prim_pyr_cd"='k01' OR "c_cmb_vst_v_20050303"."prim_pyr_cd"='n15') AND "c_cmb_vst_v_20050303"."vst_type_cd"='I' AND "c_cmb_vst_v_20050303"."drg_no"=82 AND ("c_cmb_actv_v_20050303"."actv_cd"='20431011' OR "c_cmb_actv_v_20050303"."actv_cd"='20431029' OR "c_cmb_actv_v_20050303"."actv_cd"='20431037' OR "c_cmb_actv_v_20050303"."actv_cd"='20431078' OR "c_cmb_actv_v_20050303"."actv_cd"='20431086' OR "c_cmb_actv_v_20050303"."actv_cd"='20431094' OR "c_cmb_actv_v_20050303"."actv_cd"='20431169' OR "c_cmb_actv_v_20050303"."actv_cd"='20431177' OR "c_cmb_actv_v_20050303"."actv_cd"='20431219' OR "c_cmb_actv_v_20050303"."actv_cd"='20431227' OR "c_cmb_actv_v_20050303"."actv_cd"='20431235' OR "c_cmb_actv_v_20050303"."actv_cd"='20431243' OR "c_cmb_actv_v_20050303"."actv_cd"='20431250' OR "c_cmb_actv_v_20050303"."actv_cd"='20431359' OR "c_cmb_actv_v_20050303"."actv_cd"='20431367' OR "c_cmb_actv_v_20050303"."actv_cd"='20431375' OR "c_cmb_actv_v_20050303"."actv_cd"='20431599' OR "c_cmb_actv_v_20050303"."actv_cd"='21700059' OR "c_cmb_actv_v_20050303"."actv_cd"='21700067' OR "c_cmb_actv_v_20050303"."actv_cd"='21700562' OR "c_cmb_actv_v_20050303"."actv_cd"='21700786' OR "c_cmb_actv_v_20050303"."actv_cd"='21701057') AND "c_cmb_vst_v_20050303"."orgz_cd"='P0B0' AND "c_cmb_vst_v_20050303"."dsch_year"=2005
ORDER BY "c_cmb_vst_v_20050303"."pt_id",
"c_smd_consult_v"."smd_consult_dr_prio"
Thanks, Maruja