SELECT CS.CLAIMS_ID, CE.LONG_NAME CORPORATENAME, CS.PATIENT_NAME, CS.EMPLOYEE_NAME,CS.DEPARTMENT,E.SUBSIDIARY ,E.BRANCH, CS.ADMISSION_DATE, CS.DISCHARGEABLE_DATE , CS.PROVIDER_NAME, CS.PANEL_PROVIDER, TRIM(DS.ICD_CODE)||', '||DS.DESCRIPTION DIAGNOSISNAME, CS.MC_TAKEN_DAY ,CR.DESCRIPTION COVERAGE_DESCRIPTION, SD2.FDESC CLAIMTYPE,CS.REMARKS, CS.DUE_TOTAL, CS.PAID_TO_CLAIMANT, CS.PAID_BY_CLAIMANT, CS.AUTHORIZATION_CODE, CS.SERVICE_DATE,CS.RECORD_NO,CS.SUB_RECORD_NO,CS.PLAN_ID,CS.TRANSMISSION_DATE,CS.CLAIMS_REC_DATE, CS.CLAIMS_STATUS ,CS.APPROVED_BY, CS.HOSP_INVOICE_NO, CS.TERMINAL_ID, CS.TERMINAL_TYPE, CS.DEDUCTIBLE,CS.POLICY_NO,CS.PAYEE_NAME,CS.CARD_NO, CS.DOCRCV_BY, CS.CENTRE_CODE ,CS.DOCUMENT_NO,CS.MRN , NVL((SELECT UPLDT FROM (SELECT UPLDT FROM SYT_ATTACHDOC LD WHERE TO_NUMBER(TRIM(LD.KEY1))=CS.CLAIMS_ID AND LD.MATERIAL_TYPE IN('申诉材料','补充材料','调查材料') AND ROWNUM<2 ORDER BY UPLDT DESC) WHERE ROWNUM<2),CS.SERVICE_DATE) AS LAST_DOCUMENT_RECEIVED_DATE FROM CLAIMS CS, CORPORATE CE, COVERAGE_MASTER CR, SYC_REFCD SD1, SYC_REFCD SD2, DIAGNOSIS DS , EMPLOYEE E WHERE CS.COVERAGE_ID = CR.COVERAGE_CODE AND CS.CORPORATE_CODE = CE.CORP_CODE AND CS.PRIMARY_DIAGNOSIS = DS.ICD_CODE AND CS.CLAIM_TYPE = SD1.REFCD AND CS.CARD_NO = E.CARD_NO AND SD1.VAR1 = SD2.REFCD AND SD1.MODID = 'ES' AND SD1.REFGRP = 'CLAIMTYP' AND SD2.MODID = 'ES' AND SD2.REFGRP = 'CLAIM_APPLICABLE' AND CS.PLAN_ID!='TEST-2023-GLOBAL-PLAN-DEMO' AND (CS.PAYOR_CODE,CS.CENTRE_CODE) IN (SELECT SYFIELD(STNCD,'*',1,1), SYFIELD(STNCD,'*',2,1) FROM SYM_USRSTN WHERE USRID='SYSTEM' AND STNTYP IN ('PC')) AND (CS.CORPORATE_CODE IN (SELECT STNCD FROM SYM_USRSTN WHERE USRID='SYSTEM' AND STNTYP IN ('PY','CO')) OR (CS.PAYOR_CODE,CS.CENTRE_CODE) IN (SELECT SYFIELD(STNCD,'*',1,1), SYFIELD(STNCD,'*',2,1) FROM SYM_USRSTN WHERE USRID='SYSTEM' AND STNTYP IN ('PC'))) AND CS.CLAIMS_REC_DATE>=TO_DATE('1999-01-01','yyyy-MM-dd') AND CS.CLAIMS_REC_DATE<TO_DATE('2099-01-01','yyyy-MM-dd')+1
时间: 2024-04-01 20:34:59 浏览: 139
Virtual-WiF-VB.Net.rar_WIF_vb.net_vb.net wifi
这是一个 SQL 查询语句,根据不同的表和条件,查询出一些索赔相关的信息,包括索赔 ID、公司名称、患者姓名、员工姓名、部门、分公司、入院日期、出院日期、供应商名称、面板供应商、诊断名称、医疗保险覆盖范围描述、索赔类型、备注、到期总额、向索赔人支付的金额、由索赔人支付的金额、授权代码、服务日期、记录编号、子记录编号、计划 ID、传输日期、索赔记录日期、索赔状态、批准人、医院发票号、终端 ID、终端类型、免赔额、保单号、收款人姓名、卡号、收到文件的人、中心代码、文件编号、病历号和最后一次收到文件的日期。需要注意的是,这个查询排除了测试计划,并且只查询系统中特定类型的用户可以访问的索赔信息。
阅读全文