mysql行列动态转换
直接上代码:
drop view if exists v_home_page;
create view v_home_page(xl_insert_time,xl_change_time,inpatient_serial_num,name,sex,birth_date,discharge_date,admission_date,age,marital_status,blbh,pay_type,profession,birthplace,birth_province,
birth_city,birth_county,nationality,post_code,mobile,work_unit_addr,registered_addr,contact_name,relationship,contact_addr,contact_mobile,admission_diagnosis_code,
admission_diagnosis_desc,inpatient_id,identity_card_num,present_addr,home_telephone,admission_type,
-- admission_dep,
admission_ward,transfer_dep,
-- discharge_dep,
discharge_ward,clinic_diagnosis_code,clinic_diagnosis_desc,major_diagnosis_code,major_diagnosis_desc,major_diagnosis_admission,major_diagnosis_discharge,other_diagnosis_code_1,
other_diagnosis_desc_1,other_diagnosis_admission_1,other_diagnosis_discharge_1,other_diagnosis_code_2,other_diagnosis_desc_2,other_diagnosis_admission_2,other_diagnosis_discharge_2,
other_diagnosis_code_3,other_diagnosis_desc_3,other_diagnosis_admission_3,other_diagnosis_discharge_3,other_diagnosis_code_4,other_diagnosis_desc_4,other_diagnosis_admission_4,
other_diagnosis_discharge_4,other_diagnosis_code_5,other_diagnosis_desc_5,other_diagnosis_discharge_5,other_diagnosis_code_6,other_diagnosis_desc_6,other_diagnosis_admission_6,
other_diagnosis_discharge_6,other_diagnosis_code_7,other_diagnosis_admission_7,other_diagnosis_discharge_7,other_diagnosis_code_8,other_diagnosis_desc_8,other_diagnosis_admission_8,
other_diagnosis_discharge_8,other_diagnosis_code_9,other_diagnosis_desc_9,other_diagnosis_admission_9,other_diagnosis_discharge_9,pathological_diagnosis_code_1,
pathological_diagnosis_name_1,attending_physician,other_diagnosis_discharge_10)
as select a.xl_insert_time,a.xl_change_time,a.inpatient_serial_num,a.name,a.sex,a.birth_date,a.cyrq as discharge_date,a.ryrq as admission_date,a.age,a.marital_status,a.blbh,
a.pay_type,a.profession,a.birthplace,a.birth_province,a.birth_city,a.birth_county,a.nationality,
a.post_code,a.mobile,a.work_unit_addr,a.registered_addr,a.contact_name,a.relationship,a.contact_addr,
a.contact_mobile,a.admission_diagnosis_code,a.admission_diagnosis_desc,
-- GROUP_CONCAT(a.admission_num) admission_num,
GROUP_CONCAT(a.inpatient_id) inpatient_id,
GROUP_CONCAT(a.identity_card_num) identity_card_num,
GROUP_CONCAT(a.present_addr) present_addr,
GROUP_CONCAT(a.home_telephone) home_telephone,
GROUP_CONCAT(a.admission_type) admission_type,
-- GROUP_CONCAT(a.admission_date) admission_date,
-- GROUP_CONCAT(a.admission_dep) admission_dep,
GROUP_CONCAT(a.admission_ward) admission_ward,
GROUP_CONCAT(a.transfer_dep) transfer_dep,
-- GROUP_CONCAT(a.discharge_date) discharge_date,
-- GROUP_CONCAT(a.discharge_dep) discharge_dep,
GROUP_CONCAT(a.discharge_ward) discharge_ward,
-- GROUP_CONCAT(a.hospital_stay) identity_card_num,
GROUP_CONCAT(a.clinic_diagnosis_code) clinic_diagnosis_code,
GROUP_CONCAT(a.clinic_diagnosis_desc) clinic_diagnosis_desc,
GROUP_CONCAT(a.major_diagnosis_code) major_diagnosis_code,
GROUP_CONCAT(a.major_diagnosis_desc) major_diagnosis_desc,
GROUP_CONCAT(a.major_diagnosis_admission) major_diagnosis_admission,
GROUP_CONCAT(a.major_diagnosis_discharge) major_diagnosis_discharge,
GROUP_CONCAT(a.other_diagnosis_code_1) other_diagnosis_code_1,
GROUP_CONCAT(a.other_diagnosis_desc_1) other_diagnosis_desc_1,
GROUP_CONCAT(a.other_diagnosis_admission_1) other_diagnosis_admission_1,
GROUP_CONCAT(a.other_diagnosis_discharge_1) other_diagnosis_discharge_1,
GROUP_CONCAT(a.other_diagnosis_code_2) other_diagnosis_code_2,
GROUP_CONCAT(a.other_diagnosis_desc_2) other_diagnosis_desc_2,
GROUP_CONCAT(a.other_diagnosis_admission_2) other_diagnosis_admission_2,
GROUP_CONCAT(a.other_diagnosis_discharge_2) other_diagnosis_discharge_2,
GROUP_CONCAT(a.other_diagnosis_code_3) other_diagnosis_code_3,
GROUP_CONCAT(a.other_diagnosis_desc_3) other_diagnosis_desc_3,
GROUP_CONCAT(a.other_diagnosis_admission_3) other_diagnosis_admission_3,
GROUP_CONCAT(a.other_diagnosis_discharge_3) other_diagnosis_discharge_3,
GROUP_CONCAT(a.other_diagnosis_code_4) other_diagnosis_code_4,
GROUP_CONCAT(a.other_diagnosis_desc_4) other_diagnosis_desc_4,
GROUP_CONCAT(a.other_diagnosis_admission_4) other_diagnosis_admission_4,
GROUP_CONCAT(a.other_diagnosis_discharge_4) other_diagnosis_discharge_4,
GROUP_CONCAT(a.other_diagnosis_code_5) other_diagnosis_code_5,
GROUP_CONCAT(a.other_diagnosis_desc_5) other_diagnosis_desc_5,
GROUP_CONCAT(a.other_diagnosis_admission_5) other_diagnosis_discharge_5,
GROUP_CONCAT(a.other_diagnosis_code_6) other_diagnosis_code_6,
GROUP_CONCAT(a.other_diagnosis_desc_6) other_diagnosis_desc_6,
GROUP_CONCAT(a.other_diagnosis_admission_6) other_diagnosis_admission_6,
GROUP_CONCAT(a.other_diagnosis_discharge_6) other_diagnosis_discharge_6,
GROUP_CONCAT(a.other_diagnosis_code_7) other_diagnosis_code_7,
GROUP_CONCAT(a.other_diagnosis_admission_7) other_diagnosis_admission_7,
GROUP_CONCAT(a.other_diagnosis_discharge_7) other_diagnosis_discharge_7,
GROUP_CONCAT(a.other_diagnosis_code_8) other_diagnosis_code_8,
GROUP_CONCAT(a.other_diagnosis_desc_8) other_diagnosis_desc_8,
GROUP_CONCAT(a.other_diagnosis_admission_8) other_diagnosis_admission_8,
GROUP_CONCAT(a.other_diagnosis_discharge_8) other_diagnosis_discharge_8,
GROUP_CONCAT(a.other_diagnosis_code_9) other_diagnosis_code_9,
GROUP_CONCAT(a.other_diagnosis_desc_9) other_diagnosis_desc_9,
GROUP_CONCAT(a.other_diagnosis_admission_9) other_diagnosis_admission_9,
GROUP_CONCAT(a.other_diagnosis_discharge_9) other_diagnosis_discharge_9,
GROUP_CONCAT(a.pathological_diagnosis_code_1) pathological_diagnosis_code_1,
GROUP_CONCAT(a.pathological_diagnosis_name_1) pathological_diagnosis_name_1,
GROUP_CONCAT(a.attending_physician) attending_physician,
-- GROUP_CONCAT(a.other_diagnosis_discharge_10) other_diagnosis_discharge_10,
-- GROUP_CONCAT(a.other_diagnosis_code_10) other_diagnosis_code_10,
-- GROUP_CONCAT(a.other_diagnosis_desc_10) other_diagnosis_desc_10,
-- GROUP_CONCAT(a.other_diagnosis_admission_10) other_diagnosis_admission_10,
-- GROUP_CONCAT(a.other_diagnosis_discharge_10) other_diagnosis_discharge_10,
-- GROUP_CONCAT(a.other_diagnosis_code_10) other_diagnosis_code_10,
-- GROUP_CONCAT(a.other_diagnosis_desc_10) other_diagnosis_desc_10,
-- GROUP_CONCAT(a.other_diagnosis_admission_10) other_diagnosis_admission_10,
-- GROUP_CONCAT(a.other_diagnosis_discharge_10) other_diagnosis_discharge_10,
-- GROUP_CONCAT(a.other_diagnosis_code_10) other_diagnosis_code_10,
-- GROUP_CONCAT(a.other_diagnosis_desc_10) other_diagnosis_desc_10,
-- GROUP_CONCAT(a.other_diagnosis_admission_10) other_diagnosis_admission_10,
-- GROUP_CONCAT(a.other_diagnosis_discharge_10) other_diagnosis_discharge_10,
-- GROUP_CONCAT(a.other_diagnosis_code_10) other_diagnosis_code_10,
-- GROUP_CONCAT(a.other_diagnosis_desc_10) other_diagnosis_desc_10,
-- GROUP_CONCAT(a.other_diagnosis_admission_10) other_diagnosis_admission_10,
-- GROUP_CONCAT(a.other_diagnosis_discharge_10) other_diagnosis_discharge_10,
-- GROUP_CONCAT(a.other_diagnosis_code_10) other_diagnosis_code_10,
-- GROUP_CONCAT(a.other_diagnosis_desc_10) other_diagnosis_desc_10,
-- GROUP_CONCAT(a.other_diagnosis_admission_10) other_diagnosis_admission_10,
-- GROUP_CONCAT(a.other_diagnosis_discharge_10) other_diagnosis_discharge_10,
-- GROUP_CONCAT(a.other_diagnosis_code_10) other_diagnosis_code_10,
-- GROUP_CONCAT(a.other_diagnosis_desc_10) other_diagnosis_desc_10,
-- GROUP_CONCAT(a.other_diagnosis_admission_10) other_diagnosis_admission_10,
-- GROUP_CONCAT(a.other_diagnosis_discharge_10) other_diagnosis_discharge_10,
-- GROUP_CONCAT(a.other_diagnosis_code_10) other_diagnosis_code_10,
-- GROUP_CONCAT(a.other_diagnosis_desc_10) other_diagnosis_desc_10,
-- GROUP_CONCAT(a.other_diagnosis_admission_10) other_diagnosis_admission_10,
-- GROUP_CONCAT(a.other_diagnosis_discharge_10) other_diagnosis_discharge_10,
-- GROUP_CONCAT(a.other_diagnosis_code_10) other_diagnosis_code_10,
-- GROUP_CONCAT(a.other_diagnosis_desc_10) other_diagnosis_desc_10,
-- GROUP_CONCAT(a.other_diagnosis_admission_10) other_diagnosis_admission_10,
-- GROUP_CONCAT(a.other_diagnosis_discharge_10) other_diagnosis_discharge_10,
-- GROUP_CONCAT(a.other_diagnosis_code_10) other_diagnosis_code_10,
-- GROUP_CONCAT(a.other_diagnosis_desc_10) other_diagnosis_desc_10,
-- GROUP_CONCAT(a.other_diagnosis_admission_10) other_diagnosis_admission_10,
-- GROUP_CONCAT(a.other_diagnosis_discharge_10) other_diagnosis_discharge_10,
-- GROUP_CONCAT(a.other_diagnosis_code_10) other_diagnosis_code_10,
-- GROUP_CONCAT(a.other_diagnosis_desc_10) other_diagnosis_desc_10,
-- GROUP_CONCAT(a.other_diagnosis_admission_10) other_diagnosis_admission_10,
GROUP_CONCAT(a.other_diagnosis_discharge_10) other_diagnosis_discharge_10
from
(select
xl_insert_time,xl_change_time,inpatient_serial_num,name,sex,birth_date,cyrq,ryrq,age,marital_status,blbh,pay_type,
(case profession when '其他' then '90'
when '退休' then '80'
when '职员' then '17'
when '无业' then '70'
when '离休' then '80'
when '不详' then '90'
when '工人' then '24' end) profession,
birthplace,birth_province,birth_city,birth_county,nationality,
post_code,mobile,work_unit_addr,registered_addr,contact_name,
(case relationship when '本人' then '8'
when '母女' then '3'
when '父女' then '3'
when '夫妻' then '1'
when '亲戚' then '8'
when '母子' then '2'
when '父子' then '2'
when '朋友' then '8'
when '婆媳' then '3'
when '同事' then '8'
when '兄弟' then '7'
when '姐弟' then '7'
when '姐妹' then '7'
when '翁婿' then '2'
when '公媳' then '3'
when '祖孙' then '4'
when '子母' then '5'
when '女母' then '5'
when '(外)祖孙' then '4'
when '兄妹' then '7'
when '子父' then '5' end) relationship,
contact_addr,contact_mobile,admission_diagnosis_code,admission_diagnosis_desc,
-- (case xmxh when '1010' then blnr end) as admission_num,
(case xmxh when '1012' then blnr end) as inpatient_id,
(case xmxh when '1038' then blnr end) as identity_card_num,
(case xmxh when '1044' then blnr end) as present_addr,
(case xmxh when '1046' then blnr end) as home_telephone,
(case xmxh when '1068' then blnr end) as admission_type,
-- (case xmxh when '1070' then blnr end) as admission_date,
(case xmxh when '1072' then blnr end) as admission_ward,
-- (case xmxh when '1076' then blnr end) as admission_ward,
(case xmxh when '1078' then blnr end) as transfer_dep,
(case xmxh when '1080' then blnr end) as discharge_date,
(case xmxh when '1084' then blnr end) as discharge_ward,
-- (case xmxh when '1086' then blnr end) as discharge_ward,
(case xmxh when '1088' then blnr end) as hospital_stay,
(case xmxh when '1092' then blnr end) as clinic_diagnosis_code,
(case xmxh when '1090' then blnr end) as clinic_diagnosis_desc,
(case xmxh when '1102' then blnr end) as major_diagnosis_code,
(case xmxh when '1094' then blnr end) as major_diagnosis_desc,
(case xmxh when '1192' then blnr end) as major_diagnosis_admission,
(case xmxh when '507' then blnr end) as major_diagnosis_discharge,
(case xmxh when '1148' then blnr end) as other_diagnosis_code_1,
(case xmxh when '1104' then blnr end) as other_diagnosis_desc_1,
(case xmxh when '1194' then blnr end) as other_diagnosis_admission_1,
(case xmxh when '519' then blnr end) as other_diagnosis_discharge_1,
(case xmxh when '1150' then blnr end) as other_diagnosis_code_2,
(case xmxh when '1106' then blnr end) as other_diagnosis_desc_2,
(case xmxh when '1196' then blnr end) as other_diagnosis_admission_2,
(case xmxh when '520' then blnr end) as other_diagnosis_discharge_2,
(case xmxh when '1152' then blnr end) as other_diagnosis_code_3,
(case xmxh when '1108' then blnr end) as other_diagnosis_desc_3,
(case xmxh when '1198' then blnr end) as other_diagnosis_admission_3,
(case xmxh when '521' then blnr end) as other_diagnosis_discharge_3,
(case xmxh when '1154' then blnr end) as other_diagnosis_code_4,
(case xmxh when '1110' then blnr end) as other_diagnosis_desc_4,
(case xmxh when '1200' then blnr end) as other_diagnosis_admission_4,
(case xmxh when '522' then blnr end) as other_diagnosis_discharge_4,
(case xmxh when '1156' then blnr end) as other_diagnosis_code_5,
(case xmxh when '1112' then blnr end) as other_diagnosis_desc_5,
(case xmxh when '1202' then blnr end) as other_diagnosis_admission_5,
(case xmxh when '523' then blnr end) as other_diagnosis_discharge_5,
(case xmxh when '1158' then blnr end) as other_diagnosis_code_6,
(case xmxh when '1114' then blnr end) as other_diagnosis_desc_6,
(case xmxh when '1204' then blnr end) as other_diagnosis_admission_6,
(case xmxh when '524' then blnr end) as other_diagnosis_discharge_6,
(case xmxh when '1160' then blnr end) as other_diagnosis_code_7,
(case xmxh when '1206' then blnr end) as other_diagnosis_admission_7,
(case xmxh when '525' then blnr end) as other_diagnosis_discharge_7,
(case xmxh when '1162' then blnr end) as other_diagnosis_code_8,
(case xmxh when '1118' then blnr end) as other_diagnosis_desc_8,
(case xmxh when '1208' then blnr end) as other_diagnosis_admission_8,
(case xmxh when '526' then blnr end) as other_diagnosis_discharge_8,
(case xmxh when '1164' then blnr end) as other_diagnosis_code_9,
(case xmxh when '1120' then blnr end) as other_diagnosis_desc_9,
(case xmxh when '1210' then blnr end) as other_diagnosis_admission_9,
(case xmxh when '527' then blnr end) as other_diagnosis_discharge_9,
(case xmxh when '1166' then blnr end) as other_diagnosis_code_10,
(case xmxh when '1122' then blnr end) as other_diagnosis_desc_10,
(case xmxh when '1212' then blnr end) as other_diagnosis_admission_10,
(case xmxh when '528' then blnr end) as other_diagnosis_discharge_10,
(case xmxh when '1250' then blnr end) as pathological_diagnosis_code_1,
(case xmxh when '1246' then blnr end) as pathological_diagnosis_name_1,
(case xmxh when '1252' then blnr end) as pathological_number_1,
(case xmxh when '1248' then blnr end) as pathological_diagnosis_name_2,
(case xmxh when '1242' then blnr end) as injure_poison_code_1,
(case xmxh when '1240' then blnr end) as injure_poison_name_1,
(case xmxh when '1254' then blnr end) as allergy_drugs,
(case xmxh when '1577' then blnr end) as salvage_counts,
(case xmxh when '1264' then blnr end) as section_director,
(case xmxh when '1266' then blnr end) as chief_physician,
(case xmxh when '1268' then blnr end) as attending_physician,
(case xmxh when '1270' then blnr end) as resident,
(case xmxh when '1280' then blnr end) as primary_nurse,
(case xmxh when '1274' then blnr end) as continuing_education_physician,
(case xmxh when '1276' then blnr end) as intern_physician,
(case xmxh when '1272' then blnr end) as coder,
(case xmxh when '1288' then blnr end) as medical_record_quality,
(case xmxh when '1284' then blnr end) as quality_control_physician,
(case xmxh when '1282' then blnr end) as quality_control_senior_nurse,
(case xmxh when '1292' then blnr end) as quality_control_date,
(case xmxh when '1322' then blnr end) as operation_code_1,
(case xmxh when '1340' then blnr end) as operation_date_1,
(case xmxh when '1356' then blnr end) as operation_level_1,
(case xmxh when '1374' then blnr end) as operation_name_1,
(case xmxh when '1390' then blnr end) as operator_1,
(case xmxh when '1406' then blnr end) as first_assistant_1,
(case xmxh when '1422' then blnr end) as second_assistant_1,
(case xmxh when '1470' then blnr end) as anesthesia_method_1,
(case xmxh when '1454' then blnr end) as wound_healing_level_1,
(case xmxh when '1486' then blnr end) as anesthesia_physician_1,
(case xmxh when '1326' then blnr end) as operation_code_2,
(case xmxh when '1342' then blnr end) as operation_date_2,
(case xmxh when '1358' then blnr end) as operation_level_2,
(case xmxh when '1376' then blnr end) as operation_name_2,
(case xmxh when '1392' then blnr end) as operator_2,
(case xmxh when '1408' then blnr end) as first_assistant_2,
(case xmxh when '1424' then blnr end) as second_assistant_2,
(case xmxh when '1472' then blnr end) as anesthesia_method_2,
(case xmxh when '1456' then blnr end) as wound_healing_level_2,
(case xmxh when '1488' then blnr end) as anesthesia_physician_2,
(case xmxh when '1328' then blnr end) as operation_code_3,
(case xmxh when '1344' then blnr end) as operation_date_3,
(case xmxh when '1360' then blnr end) as operation_level_3,
(case xmxh when '1378' then blnr end) as operation_name_3,
(case xmxh when '1394' then blnr end) as operator_3,
(case xmxh when '1410' then blnr end) as first_assistant_3,
(case xmxh when '1426' then blnr end) as second_assistant_3,
(case xmxh when '1474' then blnr end) as anesthesia_method_3,
(case xmxh when '1458' then blnr end) as wound_healing_level_3,
(case xmxh when '1490' then blnr end) as anesthesia_physician_3,
(case xmxh when '1330' then blnr end) as operation_code_4,
(case xmxh when '1346' then blnr end) as operation_date_4,
(case xmxh when '1362' then blnr end) as operation_level_4,
(case xmxh when '1380' then blnr end) as operation_name_4,
(case xmxh when '1396' then blnr end) as operator_4,
(case xmxh when '1412' then blnr end) as first_assistant_4,
(case xmxh when '1428' then blnr end) as second_assistant_4,
(case xmxh when '1476' then blnr end) as anesthesia_method_4,
(case xmxh when '1460' then blnr end) as wound_healing_level_4,
(case xmxh when '1492' then blnr end) as anesthesia_physician_4,
(case xmxh when '1332' then blnr end) as operation_code_5,
(case xmxh when '1348' then blnr end) as operation_date_5,
(case xmxh when '1364' then blnr end) as operation_level_5,
(case xmxh when '1382' then blnr end) as operation_name_5,
(case xmxh when '1398' then blnr end) as operator_5,
(case xmxh when '1414' then blnr end) as first_assistant_5,
(case xmxh when '1430' then blnr end) as second_assistant_5,
(case xmxh when '1478' then blnr end) as anesthesia_method_5,
(case xmxh when '1462' then blnr end) as wound_healing_level_5,
(case xmxh when '1494' then blnr end) as anesthesia_physician_5,
(case xmxh when '1334' then blnr end) as operation_code_6,
(case xmxh when '1350' then blnr end) as operation_date_6,
(case xmxh when '1366' then blnr end) as operation_level_6,
(case xmxh when '1384' then blnr end) as operation_name_6,
(case xmxh when '1400' then blnr end) as operator_6,
(case xmxh when '1416' then blnr end) as first_assistant_6,
(case xmxh when '1432' then blnr end) as second_assistant_6,
(case xmxh when '1480' then blnr end) as anesthesia_method_6,
(case xmxh when '1464' then blnr end) as wound_healing_level_6,
(case xmxh when '1496' then blnr end) as anesthesia_physician_6,
(case xmxh when '1336' then blnr end) as operation_code_7,
(case xmxh when '1352' then blnr end) as operation_date_7,
(case xmxh when '1370' then blnr end) as operation_level_7,
(case xmxh when '1386' then blnr end) as operation_name_7,
(case xmxh when '1402' then blnr end) as operator_7,
(case xmxh when '1418' then blnr end) as first_assistant_7,
(case xmxh when '1434' then blnr end) as second_assistant_7,
(case xmxh when '1482' then blnr end) as anesthesia_method_7,
(case xmxh when '1466' then blnr end) as wound_healing_level_7,
(case xmxh when '1498' then blnr end) as anesthesia_physician_7,
(case xmxh when '1338' then blnr end) as operation_code_8,
(case xmxh when '1354' then blnr end) as operation_date_8,
(case xmxh when '1372' then blnr end) as operation_level_8,
(case xmxh when '1388' then blnr end) as operation_name_8,
(case xmxh when '1404' then blnr end) as operator_8,
(case xmxh when '1420' then blnr end) as first_assistant_8,
(case xmxh when '1436' then blnr end) as second_assistant_8,
(case xmxh when '1484' then blnr end) as anesthesia_method_8,
(case xmxh when '1468' then blnr end) as wound_healing_level_8,
(case xmxh when '1500' then blnr end) as anesthesia_physician_8,
(case xmxh when '1258' then blnr end) as death_patient_autopsy,
(case xmxh when '1260' then blnr end) as ABO_blood_group,
(case xmxh when '510' then blnr end) as transfusion_reaction,
(case xmxh when '584' then blnr end) as red_blood_cell,
(case xmxh when '585' then blnr end) as platelet,
(case xmxh when '586' then blnr end) as plasma,
(case xmxh when '587' then blnr end) as whole_blood,
(case xmxh when '588' then blnr end) as blood_other,
(case xmxh when '1600' then blnr end) as newborn_birth_weight,
(case xmxh when '1304' then blnr end) as readmission,
(case xmxh when '1306' then blnr end) as readmission_purpose,
(case xmxh when '1296' then blnr end) as discharge_type,
(case xmxh when '1300' then blnr end) as to_hospital_name,
(case xmxh when '1302' then blnr end) as to_community_health_name,
-- (case xmxh when '1502' then blnr end) as total_inpatient_cost,
-- (case xmxh when '560' then blnr end) as self_payment,
-- (case xmxh when '1508' then blnr end) as medical_service_cost,
-- (case xmxh when '1510' then blnr end) as treatment_cost,
-- (case xmxh when '1512' then blnr end) as nursing_cost,
-- (case xmxh when '1514' then blnr end) as comprehensive_other_cost,
-- (case xmxh when '1516' then blnr end) as pathologic_diagnosis_cost,
-- (case xmxh when '1518' then blnr end) as laboratory_cost,
-- (case xmxh when '1520' then blnr end) as imaging_diagnosis_cost,
-- (case xmxh when '1522' then blnr end) as clinical_diagnosis_cost,
-- (case xmxh when '1524' then blnr end) as non_operation_cost,
-- (case xmxh when '1526' then blnr end) as clinical_physical_therapy_cost,
-- (case xmxh when '1528' then blnr end) as operation_therapy_cost,
-- (case xmxh when '1530' then blnr end) as anesthetic_cost,
-- (case xmxh when '1532' then blnr end) as operation_cost,
-- (case xmxh when '1534' then blnr end) as rehabilitation_cost,
-- (case xmxh when '1536' then blnr end) as TCM_treatment_cost,
-- (case xmxh when '1538' then blnr end) as western_medicine_cost,
-- (case xmxh when '1540' then blnr end) as antibiotics_cost,
-- (case xmxh when '1542' then blnr end) as chinese_patent_medicine_cost,
-- (case xmxh when '1544' then blnr end) as chinese_herbal_medicine_cost,
-- (case xmxh when '1546' then blnr end) as blood_cost,
-- (case xmxh when '1548' then blnr end) as albumin_products_cost,
-- (case xmxh when '1550' then blnr end) as globulin_products_cost,
-- (case xmxh when '1552' then blnr end) as coagulation_factor_cost,
-- (case xmxh when '1554' then blnr end) as cytokine_products_cost,
-- (case xmxh when '1556' then blnr end) as check_material_cost,
-- (case xmxh when '1558' then blnr end) as treatment_material_cost,
-- (case xmxh when '1560' then blnr end) as operation_material_cost,
(case xmxh when '1562' then blnr end) as other_cost
from home_back) a group by a.name,a.ryrq;