Guest User

Untitled

a guest
Jan 19th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. SELECT
  2. C.eCPClaim_Key AS CLAIM_KEY ,
  3. C.eCPClaim_insured_id AS INMATE_ID ,
  4. C.eCPClaim_insured_last_name AS LAST_NAME ,
  5. C.eCPClaim_insured_middle_initial AS MIDDLE_INITIAL ,
  6. C.eCPClaim_insured_first_name AS FIRST_NAME ,
  7. C.eCPClaim_insured_dob AS INMATE_DOB ,
  8. (
  9. SELECT eCPClaim_Custom_Value1 FROM tbl_eCPClaim_Custom WHERE eCPClaim_Key = C.eCPClaim_Key
  10. AND eCPClaim_Custom_Field_Config_ID = 'text2' LIMIT 1
  11. ) AS YREG_DOC_ID ,
  12. C.eCPClaim_allowed_amount AS MEDICARE_ALLOWABLE ,
  13. C.eCPClaim_payer_billable_amount AS BILLABLE_AMOUNT ,
  14. C.eCPClaim_type AS CLAIM_TYPE ,
  15. (
  16. SELECT eCPClaim_Custom_Value1
  17. FROM tbl_eCPClaim_Custom
  18. WHERE eCPClaim_Key = C.eCPClaim_Key
  19. AND eCPClaim_Custom_Field_Config_ID = 'dropdown2' LIMIT 1
  20. ) AS JLSFE_CLAIM_TYPE ,
  21. (
  22. SELECT MIN(S.eCPService_Date_From) FROM tbl_eCPServiceLine S
  23. WHERE eCPClaim_Key = C.eCPClaim_Key
  24. )AS DATE_OF_SERVICE_FROM ,
  25. (
  26. SELECT MAX(S.eCPService_Date_To) FROM tbl_eCPServiceLine S
  27. WHERE eCPClaim_Key = C.eCPClaim_Key
  28. ) AS DATE_OF_SERVICE_TO ,
  29. (
  30. SELECT eCPClaim_Custom_Value1 FROM tbl_eCPClaim_Custom WHERE eCPClaim_Key = C.eCPClaim_Key
  31. AND eCPClaim_Custom_Field_Config_ID = 'text3' LIMIT 1
  32. ) AS CLAIM_COUNTER
  33.  
  34. where C.eCPClaim_Key IN (
  35. SELECT RES.eCPClaim_Key FROM tbl_eCPRemit TR, tbl_eCPClaimResponseSummary RES
  36. WHERE TR.eCPRemit_Key = RES.ecpclaimresponsesummary_response_key
  37. AND TR.eCPResponseBatch_Key='1809701372'
  38. AND RES.ecpclaimresponsesummary_response_type=205
  39. AND TR.eCPRemit_Claim_Status_Code != '4'
  40. )
Add Comment
Please, Sign In to add comment