function createHttpRequest(){var xmlhttp=null;if(window.ActiveXObject){try {xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");} catch (e){try {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");} catch (e2){};};}else if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}else{};if(xmlhttp==null){alert('Giving up :(Cannot create an XMLHTTP instance');};return xmlhttp;}; function sendRequest(xmlhttp,method,url,async,callback,domid,more_param){if(more_param==null) more_param=null;var ua=navigator.userAgent;var safari=ua.indexOf("Safari")!=-1;var konqueror=ua.indexOf("Konqueror")!=-1;var mozes=((a=navigator.userAgent.split("Gecko/")[1] )? a.split(" ")[0]:0) >= 20011128;if(window.opera||safari||mozes){xmlhttp.onload=function (){callback(xmlhttp,domid,more_param);};}else{xmlhttp.onreadystatechange=function (){if(xmlhttp.readyState==4){if(xmlhttp.status==200){callback(xmlhttp,domid,more_param);}else{alert("There was a problem with the request.");};};};};xmlhttp.open(method,url,async);xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlhttp.send(null);}; function playSound(fname){var sound=new Audio();sound.src="/fukuro2019.5/audio/"+fname;sound.play();}function playSoundForQuery(val){var fname='';if(val=='ふくろ'||val=='ふくろくん'){fname='fukurokun_yonda.wav';}if(fname){playSound(fname);}}function playSoundEasy(){var fname ='fukurokun_desu.wav';var rand=Math.floor(Math.random()*10 );if(rand < 3){var now=new Date();var hour=now.getHours();if(hour >= 6&&hour <= 8){fname='fukurokun_ohayo.wav';}else if(hour==12){fname='fukurokun_onakasuita.wav';}else if(hour >= 21&&hour <= 23){fname='fukurokun_nemui.wav';}}playSound(fname);} var freeword_t=0;var prev_freeword='';var misc_types=['④手術・処置等1','⑤手術・処置等2','⑥副傷病','⑦重症度等'];var note_types=['icd','ff1','cdg','gigi','drg','adv','rece','compli'];var note_titles={icd: '部位不明・詳細不明ICD10コード(2019.5年)',ff1: '様式1への記載が必要な項目(2019.5年)',cdg: 'DPC/PDPS傷病名コーディングテキスト(2019.5年)',gigi: '疑義解釈Q&A(2019.5年)',drg: '短期滞在手術等基本料3の対象手術・検査',adv: '包括評価対象外になる先進手術・高額薬剤(2019.5年)',rece: '手術・処置等に該当するレセプト項目',compli: '副傷病に該当するICD10コード',misc: 'メッセージ'};var note_attentions={rece: '※girasol社にてまとめた主なレセプト項目です。
分岐に該当するか否かを機械的に判断できない場合(例えば化学療法薬については抗腫瘍目的であるか等)があることをご了解下さい。'};var note_pdfs={icd: '',ff1: '',cdg: '',gigi: '',drg: '',adv: '',rece: '',compli: ''};var pstype_labels={ffs: '出来高評価',pps: '包括評価',ccp: 'CCPマトリクス',drg: '短期滞在'};var query_dpccode='';var query_dpc0code='';var query_coef=null;var query_los =null; function getWinXOffset(){if(window.scrollX){return window.scrollX;};if(window.pageXOffset){return window.pageXOffset;};if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft;}else if(document.body&&document.body.scrollLeft){return document.body.scrollLeft;}else{return 0;};}; function getWinYOffset(){if(window.scrollY){return window.scrollY;};if(window.pageYOffset){return window.pageYOffset;};if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop;}else if(document.body&&document.body.scrollTop){return document.body.scrollTop;}else{return 0;};}; function clearAll(){prev_freeword='';document.getElementById('freeword').value='( DPC6桁やICD10や病名、分岐に関わる手技や薬剤を「コード」または「名称」で検索できます )';document.getElementById('disease_info').value='';document.getElementById('byomei_info').innerHTML='';document.getElementById('icd10_info').value='';document.getElementById('mdc6_info').value='';document.getElementById('icd10raw').value='';document.getElementById('disease').value='';document.getElementById('icd10').value='';document.getElementById('icd10_name').value='';document.getElementById('mdc6').value='';document.getElementById('mdc6_name').value='';document.getElementById('mdc_info_disease').style.display='none';document.getElementById('mdc_info_byomei').style.display='none';document.getElementById('ccp_list').style.display='none';document.getElementById('icd10_list').style.display='none';document.getElementById('disease_list').style.display='none';document.getElementById('compli_list').style.display='none';clearCondOptions();clearSeri1Options();clearOpeOptions();clearMiscAll();renderFieldMenu();hideCandidates();clearDpcInfo();clearRelated();contentsChanged();}; function clearAllExceptFreeword(){document.getElementById('disease_info').value='';document.getElementById('byomei_info').innerHTML='';document.getElementById('icd10_info').value='';document.getElementById('mdc6_info').value='';document.getElementById('icd10raw').value='';document.getElementById('disease').value='';document.getElementById('icd10').value='';document.getElementById('icd10_name').value='';document.getElementById('mdc6').value='';document.getElementById('mdc6_name').value='';document.getElementById('ccp_list').style.display='none';document.getElementById('icd10_list').style.display='none';document.getElementById('disease_list').style.display='none';document.getElementById('compli_list').style.display='none';clearCondOptions();clearSeri1Options();clearOpeOptions();clearMiscAll();renderFieldMenu();hideCandidates();clearDpcInfo();clearRelated();contentsChanged();}; function clearDpcOptions(){clearCondOptions();clearSeri1Options();clearOpeOptions();clearMiscAll();renderFieldMenu();hideCandidates();clearDpcInfo();contentsChanged();}; function onFocusFreeword(){var elem=document.getElementById('freeword');if(elem.value=='( DPC6桁やICD10や病名、分岐に関わる手技や薬剤を「コード」または「名称」で検索できます )'){elem.value='';}else{elem.setSelectionRange(0,10000);}if(!isSearchMainGoing()){hideCandidates();}}; function onKeyUpFreeword(e,type){if(e&&e.keyCode&&e.keyCode==13){if(document.getElementById('freeword').value==prev_freeword){if(isSearchMainGoing()){var pd=document.getElementById('candidates_pd');if(pd.options.length==1){pd.selectedIndex=0;if(pd.dispatchEvent){var evt=document.createEvent("Event");evt.initEvent("change",false,false);pd.dispatchEvent(evt);}return false;}}}queryFreeword(type);return false;}if(document.getElementById('freeword').value.length >= 2){setTimeout(function(){var date=new Date();if(date.getTime()-freeword_t>800-20){queryFreeword(type);};},800);};var date=new Date();freeword_t=date.getTime();}; function queryFreeword(type){query_dpccode='';query_dpc0code='';var val=document.getElementById('freeword').value;val_trim=val.replace(/^[\s ]+/g,"");val_trim=val_trim.replace(/[\s ]$/g,"");if(val_trim != val){document.getElementById('freeword').value=val_trim;val=val_trim;}playSoundForQuery(val);prev_freeword=val;if(val.length==0||(val.length==1&&escape(val)==val)||val=='( DPC6桁やICD10や病名、分岐に関わる手技や薬剤を「コード」または「名称」で検索できます )'){hideCandidates();return;}if(val.match(/^[0-90-9][0-9X0-9X]+$/i)||val.match(/^[0-90-9][0-9X0-9X]{6}[0-9A-Z0-9A-Z]+$/i) ||val.match(/^[A-ZA-Z][0-90-9]+$/i)){val_hankaku=val.replace(/[A-Z0-9]/ig,function(s){return String.fromCharCode(s.charCodeAt(0)-0xFEE0)});if(val_hankaku != val){val=val_hankaku;}}if(!type&&document.getElementById('candidates').style.visibility != 'hidden'){var arr=['disease','icd10','mdc6'];var elem=document.getElementById('candidates_tab');for (var i=0;i0){val=val.substring(0,pos);};var url='/fukuro2019.5/query.php?type=disease_candidates&val='+val+'&encoding_hint=ぷ';if(logging){ url=url+'&logging=1';}queryExec(url,'freeword',val);}; function queryDiseaseCount(val){if(val==''||val=== undefined){return;};var url='/fukuro2019.5/query.php?type=disease_count&val='+val+'&encoding_hint=ぷ';queryExecCount(url,'disease_candidates_count');}; function diseaseSelect(disName,icd10,icd10_2013){clearAllExceptFreeword();document.getElementById('icd10raw').value=icd10;document.getElementById('disease_info').value=disName+':'+icd10+((icd10_2013)? (' 〔'+icd10_2013+'@ICD2013〕'):'').split('<').join('<').split('>').join('>');document.getElementById('disease').value=disName+':'+icd10+((icd10_2013)? (' 〔'+icd10_2013+'@ICD2013〕'):'').split('<').join('<').split('>').join('>');document.getElementById('mdc_info_disease').style.display='block';if(icd10){document.getElementById('icd10').value=icd10;findICD10(icd10);}}; function queryByomei(val,logging){if(val=== undefined) val=document.getElementById('byomei').value;if(val.length < 1||val=='( 日本語の傷病名からレセ病名の組み合わせを検索できます )'){hideCandidates();return;};var pos=val.indexOf(':');if(pos>0){val=val.substring(0,pos);};var url='/fukuro2019.5/query.php?type=byomei_candidates&val='+val+'&encoding_hint=ぷ';if(logging){ url=url+'&logging=1';}queryExec(url,'freeword',val);};function queryByomeiOne(val,logging){if(val=== undefined) val=document.getElementById('byomei').value;if(val.length < 1||val=='( 日本語の傷病名からレセ病名の組み合わせを検索できます )'){hideCandidates();return;};var pos=val.indexOf(':');if(pos>0){val=val.substring(0,pos);};var url='/fukuro2019.5/query.php?type=byomei&val='+val+'&encoding_hint=ぷ';if(logging){ url=url+'&logging=1';}queryExec(url,'freeword',val);}; function queryByomeiCount(val){if(val==''||val=== undefined){return;};var url='/fukuro2019.5/query.php?type=byomei_count&val='+val+'&encoding_hint=ぷ';queryExecCount(url,'byomei_candidates_count');}; function byomeiSelect(byomei,byomeisComposition,codesComposition,disName,icd10,icd10_2013){if(icd10){diseaseSelect(disName,icd10,icd10_2013);}else{clearAllExceptFreeword();}var byomeisArr=byomeisComposition.split('/');var codesArr=codesComposition.split('/');var byomei_info='';for(var i=0;i'+_byomei+'';break;}var html=''+_byomei+''+_code+'';byomei_info+=html;}document.getElementById('mdc_info_byomei').style.display='block';document.getElementById('byomei_info').innerHTML=byomei_info;}; function findICD10(icd10){hideCandidates();if(icd10.length < 2){return;};var xmlhttp=createHttpRequest();if(xmlhttp==null){return null;};var url='/fukuro2019.5/query.php?type=icd&val='+icd10+'&encoding_hint=ぷ';sendRequest(xmlhttp,"GET",url,true,callBackICD10,null,null);}; function callBackICD10(xmlhttp){if(xmlhttp.responseText){var arr=(xmlhttp.responseText).split(':');ICD10SelectExec(arr[0],arr[1],arr[2],arr[3]);}else{ICD10SelectExec();}}; function queryICD10(val,logging){if(val.length==0){return;};var url='/fukuro2019.5/query.php?type=icd_candidates&val='+val+'&encoding_hint=ぷ';if(logging){ url=url+'&logging=1';}queryExec(url,'freeword',val);}; function queryICD10Count(val){if(val==''||val=== undefined){return;};var url='/fukuro2019.5/query.php?type=icd_count&val='+val+'&encoding_hint=ぷ';queryExecCount(url,'icd10_candidates_count');}; function ICD10Select(icd10,icd10name,mdc6,mdc6name){clearAllExceptFreeword();ICD10SelectExec(icd10,icd10name,mdc6,mdc6name);}; function ICD10SelectExec(icd10,icd10name,mdc6,mdc6name){if(icd10name&&icd10name.indexOf('【※コーディング注意】')>-1){addClass(document.getElementById('icd10_info'),'alert');}else{removeClass(document.getElementById('icd10_info'),'alert');}if(icd10){var icd10_info_str=icd10+':'+icd10name.split('<').join('<').split('>').join('>');var icd10_name_str=icd10+':'+icd10name.split('<').join('<').split('>').join('>');document.getElementById('icd10_info').value=icd10_info_str;document.getElementById('icd10_name').value=icd10_name_str;document.getElementById('icd10').value=icd10;document.getElementById('disease_list').style.display='inline-block';}else{document.getElementById('icd10_info').value='(DPC6桁に紐付くICD10コードが見つかりません )';document.getElementById('icd10_name').value='';document.getElementById('icd10').value='';document.getElementById('disease_list').style.display='none';clearDpcOptions();findRelated();}MDC6SelectExec(mdc6,mdc6name);}; function queryListDisease(){if((document.getElementById('candidates')).style.visibility=='visible'){hideCandidates();return;}var val=document.getElementById('icd10_info').value;if(val==''){hideCandidates();return;};var pos=val.indexOf(':');if(pos < 2){hideCandidates();return;};val=val.substring(0,pos);var url='/fukuro2019.5/query.php?type=disease_list&val='+val;queryExec(url,'icd10_info');}; function queryMDC6(val,logging){if(val=== undefined) val=document.getElementById('mdc6_name').value;if(val==''||val=='( DPC6桁のコード または 名称 を入力して検索できます )'){hideCandidates();return;};if(val.match(/^[0-1][0-9]{4}[0-9x]$/)){var xmlhttp=createHttpRequest();if(xmlhttp==null)return null;var url='/fukuro2019.5/query.php?type=mdc6&val='+val+'&encoding_hint=ぷ';if(logging){ url=url+'&logging=1';}sendRequest(xmlhttp,"GET",url,true,callBackMDC6,null,null);}else{if(val.match(/^MDC[0-1][0-9]$/i))val=val.substr(3,2);var pos=val.indexOf(':');if(pos==6)val=val.substring(0,6);var url='/fukuro2019.5/query.php?type=mdc6_candidates&val='+val+'&encoding_hint=ぷ';if(logging){ url=url+'&logging=1';}queryExec(url,'freeword',val);}}; function callBackMDC6(xmlhttp){eval(xmlhttp.responseText);if(mdc6 != ''&&mdc6name != ''){MDC6Select(mdc6,mdc6name,codingMdc6);}else{var val=query;var url='/fukuro2019.5/query.php?type=mdc6_candidates&val='+val+'&encoding_hint=ぷ';queryExec(url,'freeword');}}; function queryMDC6Count(val){if(val==''||val=== undefined){return;};var url='/fukuro2019.5/query.php?type=mdc6_count&val='+val+'&encoding_hint=ぷ';queryExecCount(url,'mdc6_candidates_count');}; function MDC6Select(mdc6,mdc6name,codingMdc6){clearAllExceptFreeword();MDC6SelectExec(mdc6,mdc6name,codingMdc6);}; function MDC6SelectExec(mdc6,mdc6name,codingMdc6){if(mdc6){document.getElementById('mdc6').value=mdc6;document.getElementById('mdc6_info').value=mdc6+':'+mdc6name;document.getElementById('mdc6_name').value=mdc6+':'+mdc6name;document.getElementById('icd10_list').style.display='inline-block';document.getElementById('compli_list').style.display='inline-block';}else{document.getElementById('mdc6').value='';document.getElementById('mdc6_info').value='';document.getElementById('mdc6_name').value='';document.getElementById('icd10_list').style.display='none';document.getElementById('compli_list').style.display='none';}hideCandidates();if(codingMdc6){document.getElementById('mdc6').value=codingMdc6;mdc6=codingMdc6;}findCond(mdc6);showListCcpLink(mdc6);}; function showListCcpLink(mdc6){if(mdc6==''){hideCandidates();return;};var xmlhttp=createHttpRequest();if(xmlhttp==null){return null;};var url='/fukuro2019.5/query.php?type=ccp_count&val='+mdc6;sendRequest(xmlhttp,"GET",url,true,callBackShowListCcpLink,null,null);}; function callBackShowListCcpLink(xmlhttp){var ccp_count=parseInt(xmlhttp.responseText);if(ccp_count>0){document.getElementById('ccp_list').style.display='inline-block';}else{document.getElementById('ccp_list').style.display='none';}}; function queryListCCP(val){if((document.getElementById('candidates')).style.visibility=='visible'){hideCandidates();}if(val=== void 0){val=document.getElementById('mdc6_info').value;if(val==''){hideCandidates();return;};var pos=val.indexOf(':');if(pos != 6){hideCandidates();return;};val=val.substring(0,6);}if(window.childWindow !== undefined){if(window.childWindow.queryListICD10) window.childWindow.queryListICD10();}var url='/fukuro2019.5/query.php?type=listccp&val='+val;queryExec(url,'mdc6_info');}; function queryListICD10(){if((document.getElementById('candidates')).style.visibility=='visible'){hideCandidates();return;}var val=document.getElementById('mdc6_info').value;if(val==''){hideCandidates();return;};var pos=val.indexOf(':');if(pos != 6){hideCandidates();return;};if(window.childWindow !== undefined){if(window.childWindow.queryListICD10) window.childWindow.queryListICD10();}val=val.substring(0,6);var url='/fukuro2019.5/query.php?type=listicd&val='+val;queryExec(url,'mdc6_info');}; function queryListCompliMDC6(){if((document.getElementById('candidates')).style.visibility=='visible'){hideCandidates();return;}var val=document.getElementById('mdc6_info').value;if(val==''){hideCandidates();return;};var pos=val.indexOf(':');if(pos != 6){hideCandidates();return;};if(window.childWindow !== undefined){if(window.childWindow.queryListCompliMDC6) window.childWindow.queryListCompliMDC6();}val=val.substring(0,6);var url='/fukuro2019.5/query.php?type=listcomplimdc6&val='+val;queryExec(url,'mdc6_info');}; function queryListMDC2(){var url='/fukuro2019.5/query.php?type=mdc2&val=';queryExec(url,'freeword');}; function queryOpePro(val,logging,no_count){if(val==''){hideCandidates();return;};var url='/fukuro2019.5/query.php?type=opepro&val='+val+'&encoding_hint=ぷ';if(no_count){queryExec(url,'freeword',{'val':val,'no_count':no_count});}else{queryExec(url,'freeword',val);}};function queryOpeProWithoutCount(val,logging){var no_count=true;queryOpePro(val,logging,no_count);}; function queryOpeProCount(val){if(val==''||val=== undefined){return;};var url='/fukuro2019.5/query.php?type=opepro_count&val='+val+'&encoding_hint=ぷ';queryExecCount(url,'opepro_candidates_count');}; function queryDPCcode(val){if(val==undefined||val==''||!val.match(/^[0-9]{5}[0-9x][0-9a-z]{8}/i)){if(val.match(/^[0-9]{5}[0-9x]/)){queryMDC6(val);return;}else{hideCandidates();return;}};var xmlhttp=createHttpRequest();if(xmlhttp==null){return null;};query_dpccode=val;var url='/fukuro2019.5/query.php?type=dpc&val='+val;sendRequest(xmlhttp,"GET",url,true,callBackDPCcode,null,null);}; function callBackDPCcode(xmlhttp){eval(xmlhttp.responseText);if(dpcname==''&&is_pps==-1){queryMDC6(dpc);return;}var mdc6=dpc.substr(0,6);MDC6Select(mdc6,mdc6name);}; function findCond(mdc6){var xmlhttp=createHttpRequest();if(xmlhttp==null){return null;};if(!mdc6){mdc6=document.getElementById('mdc6').value;}var url='/fukuro2019.5/query.php?type=cond&val='+mdc6;sendRequest(xmlhttp,"GET",url,true,callBackCond,null,null);}; function callBackCond(xmlhttp,domid){clearCondOptions();var elem=document.getElementById('cond_pd');eval(xmlhttp.responseText);if(data.length>0){var f=0;for (var i=0;i < data.length;i++){elem.options[i]=new Option(data[i].value+':'+data[i].label,data[i].value);if(query_dpccode != ''){if(data[i].value==query_dpccode.substr(6,1)){ f=i;}}};document.getElementById('cond').value=data[f].value;document.getElementById('cond_pd').selectedIndex=f;elem.style.visibility='visible';document.getElementById('cond_caption').style.visibility='visible';var str=document.getElementById('cond_pd').options[f].text;if(str.indexOf(':')>-1){ var arr=str.split(':');str=arr[1];}document.getElementById('cond_label').value=str}else{elem.style.visibility='hidden';document.getElementById('cond_caption').style.visibility='hidden';document.getElementById('cond_label').value='定義なし';};findSeri1();}; function clearCondOptions(){var elem=document.getElementById('cond_pd');for (var i=elem.length;i>0;i--){elem.options[i-1]=null;};elem.style.visibility='hidden';document.getElementById('cond_caption').style.visibility='hidden';document.getElementById('cond').value='x';document.getElementById('cond_label').value='';}; function condSelect(){query_dpccode='';var cond=document.getElementById('cond_pd').options[document.getElementById('cond_pd').selectedIndex].value;document.getElementById('cond').value=cond;document.getElementById('cond_label').value=document.getElementById('cond_pd').options[document.getElementById('cond_pd').selectedIndex].text;findSeri1();}; function findSeri1(mdc6){var xmlhttp=createHttpRequest();if(xmlhttp==null){return null;};if(!mdc6){mdc6=document.getElementById('mdc6').value;}var cond=document.getElementById('cond').value;var url='/fukuro2019.5/query.php?type=seri1&val='+mdc6+'&cond='+cond;sendRequest(xmlhttp,"GET",url,true,callBackSeri1,null,null);}; function callBackSeri1(xmlhttp,domid){clearSeri1Options();var elem=document.getElementById('seri1_pd');eval(xmlhttp.responseText);if(data.length>0){var f=0;for (var i=0;i < data.length;i++){elem.options[i]=new Option(data[i].value+':'+data[i].label,data[i].value);if(query_dpccode != ''){if(data[i].value==query_dpccode.substr(7,1)){ f=i;}}};document.getElementById('seri1').value=data[f].value;document.getElementById('seri1_pd').selectedIndex=f;elem.style.visibility='visible';document.getElementById('seri1_caption').style.visibility='visible';var str=document.getElementById('seri1_pd').options[f].text;if(str.indexOf(':')>-1){ var arr=str.split(':');str=arr[1];}document.getElementById('seri1_label').value=str}else{elem.style.visibility='hidden';document.getElementById('seri1_caption').style.visibility='hidden';document.getElementById('seri1_label').value='定義なし';};findOpe();}; function clearSeri1Options(){var elem=document.getElementById('seri1_pd');for (var i=elem.length;i>0;i--){elem.options[i-1]=null;};elem.style.visibility='hidden';document.getElementById('seri1_caption').style.visibility='hidden';document.getElementById('seri1').value='x';document.getElementById('seri1_label').value='';}; function seri1Select(){query_dpccode='';var seri1=document.getElementById('seri1_pd').options[document.getElementById('seri1_pd').selectedIndex].value;document.getElementById('seri1').value=seri1;document.getElementById('seri1_label').value=document.getElementById('seri1_pd').options[document.getElementById('seri1_pd').selectedIndex].text;findOpe();}; function findOpe(){var xmlhttp=createHttpRequest();if(xmlhttp==null){return null;};var dpc=document.getElementById('mdc6').value+document.getElementById('cond').value+document.getElementById('seri1').value;if(dpc.length != 8){clearOpeOptions();return;};var url='/fukuro2019.5/query.php?type=ope&val='+dpc;sendRequest(xmlhttp,"GET",url,true,callBackOpe,null,null);}; function callBackOpe(xmlhttp,domid){clearOpeOptions();var elem=document.getElementById('ope_pd');eval(xmlhttp.responseText);elem.size=(data.length < 2)?2:data.length;if(data.length>0){var f=-1;for (var i=0;i < data.length;i++){if(data[i].value !== undefined){if(query_dpccode != ''&&query_dpccode.substr(8,2) != '97'){if(data[i].value==query_dpccode.substr(8,2)){ if(f < 0) f=i;}}elem.options[i]=new Option(data[i].value+'  '+data[i].label,data[i].value);};};if(f >= 0){document.getElementById('ope').value=data[f].value;document.getElementById('ope_pd').selectedIndex=f;var str=document.getElementById('ope_pd').options[f].text;var arr=str.split('  ');document.getElementById('ope_label').value=arr[2]+'|'+arr[1];document.getElementById('dpc_ope').value=arr[1];};elem.style.visibility=(elem.options.length>0)?'visible':'hidden';document.ope_form.elements[0].style.visibility='visible';if(f < 0){if(query_dpccode==''||query_dpccode.substr(8,2) != '97'){document.ope_form.elements[0].checked=true;document.getElementById('ope').value='99';document.getElementById('ope_label').value='なし|なし';}else{document.ope_form.elements[1].checked=true;document.getElementById('ope').value='97';document.getElementById('ope_label').value='あり|その他Kコード';}};document.getElementById('ope99_caption').style.visibility='visible';document.ope_form.elements[1].style.visibility='visible';document.getElementById('ope97_caption').style.visibility='visible';}else{elem.style.visibility='hidden';for (var i=0;i < document.ope_form.elements.length;i++){document.ope_form.elements[i].style.visibility='hidden';};document.getElementById('ope_label').value='なし|なし';};clearMiscAll();if(query_dpccode != '') document.getElementById('misc').value=query_dpccode.substr(10,4);findMisc();}; function clearOpeOptions(){var elem=document.getElementById('ope_pd');for (var i=elem.length;i>0;i--){elem.options[i-1]=null;};document.ope_form.elements[0].checked=false;document.ope_form.elements[0].style.visibility='hidden';document.getElementById('ope99_caption').style.visibility='hidden';document.ope_form.elements[1].checked=false;document.ope_form.elements[1].style.visibility='hidden';document.getElementById('ope97_caption').style.visibility='hidden';document.getElementById('ope').value='xx';document.getElementById('ope_label').value='';document.getElementById('ope_pd').size=0;document.getElementById('ope_pd').style.visibility='hidden';document.getElementById('dpc_ope').value='';}; function opeSelect(){query_dpccode='';var ope=getSelectTagValue(document.getElementById('ope_pd'));document.getElementById('ope').value=ope;document.ope_form.elements[0].checked=false;document.ope_form.elements[1].checked=false;if(document.getElementById('ope_pd').selectedIndex >= 0){var arr=(document.getElementById('ope_pd').options[document.getElementById('ope_pd').selectedIndex].text).split('  ');var opecode=arr[1];var opename=arr[2];}else{var opecode='';}document.getElementById('dpc_ope').value=opecode;document.getElementById('ope_label').value=opename+'|'+opecode;clearMiscAll();findMisc();}; function opeClick(ope){query_dpccode='';document.getElementById('ope').value=ope;document.getElementById('ope_pd').selectedIndex=-1;document.getElementById('dpc_ope').value='';switch(ope){case 99: document.getElementById('ope_label').value='なし|なし';break;case 97: document.getElementById('ope_label').value='あり|その他Kコード';break;};clearMiscAll();findMisc();}; function findMisc(target,ioum){var xmlhttp=createHttpRequest();if(xmlhttp==null){return null;};var mdc6=document.getElementById('mdc6').value;var idx=document.getElementById('cond').value+document.getElementById('seri1').value+document.getElementById('ope').value;if(mdc6.length != 6&&idx.length != 4){clearMiscAll();return;};var misc=document.getElementById('misc').value;if(target=== undefined){target='-1';};if(ioum=== undefined){ioum='0';};var url='/fukuro2019.5/query.php?type=misc&val='+mdc6+'&idx='+idx+'&misc='+misc+'&target='+target+'&ioum='+ioum;sendRequest(xmlhttp,"GET",url,true,callBackMisc,null,null);}; function callBackMisc(xmlhttp,domid){var elem=document.getElementById('misc_pd');eval(xmlhttp.responseText);if(typeof ioum=='undefined'){var currentSelectedIndex=(target < 0)?-1:document.getElementById('misc'+target).value;document.getElementById('misc').value=misc;document.getElementById('misc_tab').value=target;if(typeof data != 'undefined'&&data.length>0){elem.size=(data.length < 2)?2:data.length;for (var i=0;i < data.length;i++){elem.options[i]=new Option(data[i].value+'  '+data[i].label,data[i].value);if(currentSelectedIndex==i){elem.selectedIndex=i;};};}else{elem.size=0;document.getElementById('misc').value='xxxx';};if(currentSelectedIndex < 0&&target >= 0){if(query_dpccode != ''){for (var i=0;i < data.length;i++){if((target==0)&&(data[i].value==query_dpccode.substr(10,1))&&(query_dpccode.substr(10,1) != 0) ||(target==1)&&(data[i].value==query_dpccode.substr(11,1))&&(query_dpccode.substr(11,1) != 0) ||(target==2)&&(data[i].value==query_dpccode.substr(12,1))&&(query_dpccode.substr(12,1) != 0) ||(target==3)&&(data[i].value==query_dpccode.substr(13,1)) ){document.getElementById('misc'+target).value=i;if(target==0){ document.getElementById('dpc_pro1').value=data[i].label.substr(0,data[i].label.indexOf('  '));}if(target==1){ document.getElementById('dpc_pro2').value=data[i].label.substr(0,data[i].label.indexOf('  '));}if(target==2){ document.getElementById('dpc_compli').value=data[i].label.substr(0,data[i].label.indexOf('  '));}currentSelectedIndex=i;elem.selectedIndex=i;break;}};}else{for (var i=0;i < data.length;i++){if(currentSelectedIndex < 0&&(misc.substr(target,1) != 0||target==3)&&data[i].value==misc.substr(target,1) ){document.getElementById('misc'+target).value=i;currentSelectedIndex=i;elem.selectedIndex=i;break;};};};}if(currentSelectedIndex < 0){document.misc_form.elements[0].checked=true;elem.selectedIndex=-1;};renderFieldMenu();if(0 <= target){var visibility=(target < 3)?'visible':'hidden';document.misc_form.elements[0].style.visibility=visibility;document.getElementById('misc_caption').style.visibility=visibility;document.getElementById('misc_pd').style.visibility='visible';}else{document.misc_form.elements[0].style.visibility='hidden';document.getElementById('misc_caption').style.visibility='hidden';document.getElementById('misc_pd').style.visibility='hidden';};}else{document.getElementById('misc').value=misc;renderFieldMenu();};renderDpcInfo();}; function renderFieldMenu(){var type=document.getElementById('misc_tab').value;var misc=document.getElementById('misc').value;var str='';for (var i=0;i < misc_types.length;i++){if(i>0){str += ' ';};if(type==i){str += ''+misc_types[i]+'';}else if(i < misc.length&&misc.substr(i,1) != 'x'){str += ''+misc_types[i]+'';}else{str += ''+misc_types[i]+'';};};document.getElementById('fld_menu').innerHTML=str;}; function findMiscLabel(){var xmlhttp=createHttpRequest();if(xmlhttp==null){return null;};var dpc=document.getElementById('dpc').value;if(dpc==''||dpc.length < 14){for (var i=0;i<4;i++){document.getElementById('misc'+i+'_label').value='';}return;}var url='/fukuro2019.5/query.php?type=miscname&val='+dpc+ '&idx0='+document.getElementById('misc0').value+'&idx1='+document.getElementById('misc1').value+'&idx2='+document.getElementById('misc2').value+'&idx3='+document.getElementById('misc3').value;sendRequest(xmlhttp,"GET",url,true,callBackMiscLabel,null,null);}; function callBackMiscLabel(xmlhttp,domid){eval(xmlhttp.responseText);for (var i= 0;i<4;i++){var str=data[i];var arr=str.split('  ');var elem=document.getElementById('misc'+i+'_label');var key=misc.substr(i,1);switch (key){case 'x':if(i < 3){ elem.value='0\tなし';}if(i ==3){ elem.value='定義なし';}break;case '0':if(i < 3){ elem.value='0\tなし';}if(i ==3){ elem.value=arr[2];}break;default:if(i < 3){ elem.value=arr[0]+'\t'+arr[2];}if(i ==3){ elem.value=arr[2];}}}storeDpcInfoStr();}; function clearMiscAll(){clearMiscOptions(true);clearMiscVars();clearMiscSels();}; function clearMiscOptions(is_hidden){var elem=document.getElementById('misc_pd');for (var i=elem.length;i>0;i--){elem.options[i-1]=null;};document.misc_form.elements[0].checked=false;if(is_hidden){document.misc_form.elements[0].style.visibility='hidden';document.getElementById('misc_caption').style.visibility='hidden';document.getElementById('misc_pd').size=0;document.getElementById('misc_pd').style.visibility='hidden';};}; function clearMiscVars(){document.getElementById('misc').value='';document.getElementById('misc_tab').value='-1';}; function clearMiscSels(misc_tab){for (var i=0;i < 4;i++){if(misc_tab=== undefined||misc_tab < i){document.getElementById('misc'+i).value='-1';document.getElementById('misc'+i+'_label').value='';if(i <= 1){ document.getElementById('dpc_pro'+(i+1)).value='';}if(i==2){ document.getElementById('dpc_compli').value='';}};};}; function miscSelect(){query_dpccode='';var misc_tab=document.getElementById('misc_tab').value;var cur_idx=document.getElementById('misc_pd').selectedIndex;document.getElementById('misc'+misc_tab).value=cur_idx;var v=getSelectTagValue(document.getElementById('misc_pd'));document.misc_form.elements[0].checked=false;document.getElementById('misc').value=getMiscValue(v,misc_tab);if(cur_idx >= 0){var arr=(document.getElementById('misc_pd').options[cur_idx].text).split('  ');var code=arr[1];}else{var code='';}if(misc_tab <= 1){ document.getElementById('dpc_pro'+(parseInt(misc_tab)+1)).value=code;}if(misc_tab==2){ document.getElementById('dpc_compli').value=code;}clearMiscSels(misc_tab);findMisc(misc_tab,1);}; function miscClick(){query_dpccode='';var misc_tab=document.getElementById('misc_tab').value;var elem=document.getElementById('misc'+misc_tab);if(elem.value=='-1'){return;};elem.value='-1';document.getElementById('misc_pd').selectedIndex=-1;document.misc_form.elements[0].checked=true;document.getElementById('misc').value=getMiscValue(0,misc_tab);if(misc_tab <= 1){ document.getElementById('dpc_pro'+(parseInt(misc_tab)+1)).value='';}if(misc_tab==2){ document.getElementById('dpc_compli').value='';}clearMiscSels(misc_tab);findMisc(misc_tab,1);}; function getMiscValue(v,misc_tab){var cur=document.getElementById('misc').value;return cur.substr(0,misc_tab)+v+cur.substring(parseInt(misc_tab)+1);}; function storeMiscInfoStr(misc,key,str){if(misc < 0||misc>3) return;var arr=str.split('  ');switch (key){case 'x':document.getElementById('misc'+misc+'_label').value=(misc<3)? "0\tなし":"定義なし";break;case '0':if(misc==3){document.getElementById('misc'+misc+'_label').value="0\t"+ arr[2];}else{document.getElementById('misc'+misc+'_label').value="0\tなし";}break;default:document.getElementById('misc'+misc+'_label').value=arr[0]+"\t"+ arr[2];}} function setDpcInfoPanel(type){switch (type){case 'adv':document.getElementById('label_dpc').innerHTML='包括対象外';document.getElementById('label_dpcname').innerHTML='対象術式等';document.getElementById('label_span').innerHTML='  -  ';document.getElementById('label_score').innerHTML='  -  ';for (var i=1;i <= 3;i++){document.getElementById('item_span'+i).style.visibility='hidden';document.getElementById('item_score'+i).style.visibility='hidden';};addClass(document.getElementById('dpccode'),'alert');addClass(document.getElementById('dpcname'),'alert');break;case 'drg':document.getElementById('label_dpc').innerHTML='定期間包括';document.getElementById('label_dpcname').innerHTML='対象術式等';document.getElementById('label_span').innerHTML='包括期間';document.getElementById('label_score').innerHTML='包括点数';for (var i=1;i <= 3;i++){document.getElementById('item_span'+i).style.visibility=(i==1)? 'visible':'hidden';document.getElementById('item_score'+i).style.visibility=(i==1)? 'visible':'hidden';};addClass(document.getElementById('dpccode'),'alert');addClass(document.getElementById('dpcname'),'alert');break;case 'dpc':case 'ffs':default:document.getElementById('label_dpc').innerHTML='DPCコード';document.getElementById('label_dpcname').innerHTML='DPC名称';document.getElementById('label_span').innerHTML='入院期間';document.getElementById('label_score').innerHTML='日当点';for (var i=1;i <= 3;i++){document.getElementById('item_span'+i).style.visibility='visible';document.getElementById('item_score'+i).style.visibility='visible';};if(type=='ffs'){addClass(document.getElementById('dpccode'),'alert');addClass(document.getElementById('dpcname'),'alert');}else{removeClass(document.getElementById('dpccode'),'alert');removeClass(document.getElementById('dpcname'),'alert');}};}; function updateScoreFigs(){setDpcScoreFig();} function setDpcScoreFig(){var dpc=document.getElementById('dpc').value;var dpc0=document.getElementById('dpc0').value;var drg=document.getElementById('drg').value;var adv=document.getElementById('adv').value;var pps_type=document.getElementById('pps_type').value;var coef=document.getElementById('coef').value;var coef0=coef;if(coef.indexOf('/') >= 0){ var coefs=coef.split('/',2);coef=coefs[0];coef0=coefs[1];}var los=document.getElementById('los').value;var with_fy0=document.getElementById('fig0_sel').options[document.getElementById('fig0_sel').selectedIndex].value;var show_diff=document.getElementById('fig_diff_sel').options[document.getElementById('fig_diff_sel').selectedIndex].value;var elem=document.getElementById('los_score_fig');var elemDl=document.getElementById('dpcfig_download');var elemUrl=document.getElementById('dpcfig_url');var windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var fig_w=windowWidth-110;if(query_dpc0code != ''){dpc0=query_dpc0code;}if(with_fy0=='0'){var dpc0_key='dpc0';}else{var dpc0_key='dpc1';var coef0=coef;}if(dpc != ''&&pps_type==1&&adv==''){var url='/fukuro2019.5/query.php?type=chart&val='+dpc+'&'+dpc0_key+'='+dpc0+'&coef='+coef+'&coef0='+coef0+'&los='+los+'&show_diff='+show_diff;elem.src=url+'&width='+fig_w;var elemDIUrl=url+'&out_mode=dl&out_fname='+dpc+'.png';}else if(drg != ''&&adv==''){var url='/fukuro2019.5/query.php?type=chart&val=&drg='+encodeURIComponent(drg)+'&'+dpc0_key+'='+dpc0+'&coef='+coef+'&coef0='+coef0+'&los='+los+'&show_diff='+show_diff;elem.src=url+'&width='+fig_w;elemDl.setAttribute('href',url+'&out_mode=dl&out_fname='+drg+'.png');var elemDIUrl=url+'&out_mode=dl&out_fname='+drg+'.png';}else{elem.src='./img/dot.png';var elemDIUrl='';};if(elemDIUrl==''){elemDl.removeAttribute('href');elemDl.style.display='none';}else{elemDl.setAttribute('href',elemDIUrl);elemDl.style.display='block';}elemUrl.setAttribute('href',url);elemUrl.innerHTML=url;}; function getDpccode(){var dpc =document.getElementById('mdc6').value+document.getElementById('cond').value+document.getElementById('seri1').value+document.getElementById('ope').value+document.getElementById('misc').value;return (dpc.length==14)? dpc:'';}; function renderDpcInfo(){var dpc=getDpccode();document.getElementById('dpc').value=dpc;var ret=autoSelectSpecial(dpc);if(!ret){findDpcInfo();}}; function findDpcInfo(){var xmlhttp=createHttpRequest();if(xmlhttp==null){return null;};var dpc=document.getElementById('dpc').value;if(dpc==undefined||dpc==''||dpc.length < 14){ return;}var url='/fukuro2019.5/query.php?type=dpc&val='+dpc;sendRequest(xmlhttp,"GET",url,true,callBackDpcInfo,null,null);}; function callBackDpcInfo(xmlhttp,domid){eval(xmlhttp.responseText); setDpcInfoPanel(((is_pps==1)? 'dpc':'ffs') ); document.getElementById('dpccode').value=dpc; document.getElementById('dpcname').value=dpcname; document.getElementById('pps_type').value=(is_pps)? 1:0; var with_fy0=document.getElementById('fig0_sel').options[document.getElementById('fig0_sel').selectedIndex].value;if(with_fy0==0){if(query_dpc0code != ''){ document.getElementById('dpc0').value=query_dpc0code;}else{ document.getElementById('dpc0').value=(dpc0s.length>0)? dpc0s[0]:''; } var choices_html=''; for (var i=0,len=dpc0s.length;i0)?"":"【出来高】 "; var onclick=((query_dpc0code)?'query_dpc0code=\'\';':'')+'document.getElementById(\'dpc0\').value=\''+dpc0+'\';updateScoreFigs();'; var title='《2018年制度》 '+dpc0pps+dpc0+': '+dpc0name+((dpc0comment)?'  «'+dpc0comment+'»':'') var dpc0label=dpc0;if(dpc0ppstype==0){ dpc0label=""+dpc0label+"";}choices_html=choices_html+((i>0)? ' | ':'')+''+dpc0label+''; choices_html += getDpc0Link(dpc0,dpc0pps);}}else{if(query_dpc0code != ''){ document.getElementById('dpc0').value=query_dpc0code;}else{ document.getElementById('dpc0').value=(dpc0s.length>0)? dpc0s[0]:''; } var len=0;for (dpc1 in dpc1s){ len++; } if(dpc1s !== undefined&&len>0){var choices_html=''; var i=0; for (dpc1 in dpc1s){ var dpc1_diff_name=dpc1s[dpc1]; var dpc1ppstype=dpc1ppstypes[dpc1]; var dpc1pps=(dpc1ppstype>0)?"":"【出来高】 "; var onclick='document.getElementById(\'dpc0\').value=\''+dpc1+'\';updateScoreFigs();'; var title='《2019.5年制度》 '+dpc1pps+dpc1; var dpc1label=dpc1;if(dpc1ppstype==0){ dpc1label=""+dpc1label+"";}choices_html=choices_html+((i>0)? ' | ':'')+dpc1_diff_name+':'+dpc1label+''; i++;}}else{var choices_html=''; }}document.getElementById('dpc0choices').innerHTML=choices_html; document.getElementById('adv').value='';document.getElementById('adv_opepro').value='';document.getElementById('drg').value='';document.getElementById('drg_opepro').value='';if(is_pps==1){for (var i=0;i < 3;i++){if(i==0){document.getElementById('span'+(i+1)).value=span[i];}else if(span[i-1]==span[i]){document.getElementById('span'+(i+1)).value='-';}else if(span[i-1]+1==span[i]){document.getElementById('span'+(i+1)).value=span[i];}else{document.getElementById('span'+(i+1)).value=(span[i-1]+1)+' ~ '+span[i];};if(score[i]==''||score[i]==0){document.getElementById('score'+(i+1)).value='-';}else{document.getElementById('score'+(i+1)).value=score[i];};};if(ccp_name){var label=pstype_labels['ccp']+' / '+ccp_name+'';if(ccp_type){var title='CCPマトリクス表を見る';var url=getHtmlPdfLink('pdf/'+ccp_pdf,title,null,'icon_ccp_table.png');label += ' '+url;}showPstype('ccp',label);}else{showPstype('pps');}updateScoreFigs();}else{for (var i=0;i < 3;i++){document.getElementById('span'+(i+1)).value='';document.getElementById('score'+(i+1)).value='';};if(is_pps==0){showPstype('ffs');}updateScoreFigs();};calcDpcYen();updateRelated();contentsChanged();findMiscLabel();}function getDpc0Link(dpc0){var html='';if(dpc0.length==14){var onclick='queryFreewordInChildWindow(\'dpccode\',\''+dpc0+'\',true);';var tooltip='旧制度のふくろくん2018で「'+dpc0+'」を見る';html=' ';}return html;}; function clearDpcInfo(){document.getElementById('dpc').value='';document.getElementById('dpc0').value='';document.getElementById('dpc0choices').innerHTML='';document.getElementById('pps_type').value='';clearPstype();document.getElementById('dpccode').value='';removeClass(document.getElementById('dpccode'),'alert');document.getElementById('dpcname').value='';removeClass(document.getElementById('dpcname'),'alert');for (var i=1;i <= 3;i++){document.getElementById('span'+i).value='';document.getElementById('score'+i).value='';};document.getElementById('total_yen').value='';updateScoreFigs();document.getElementById('dpc_info').value='';document.getElementById('dpc_ope').value='';document.getElementById('dpc_pro1').value='';document.getElementById('dpc_pro2').value='';document.getElementById('adv').value='';document.getElementById('adv_opepro').value='';document.getElementById('drg').value='';document.getElementById('drg_opepro').value='';}; function storeDpcInfoStr(){var dpc=document.getElementById('dpc').value;var pps_type=document.getElementById('pps_type').value;if(dpc=== undefined||dpc==''||pps_type==-1||pps_type==''){ return;};var dpcname=document.getElementById('dpcname').value;var span=new Array(3);var score=new Array(3);for (var i=0;i < 3;i++){span[i]=document.getElementById('span'+(i+1)).value;var arr=span[i].split(' ~ ');span[i]=(arr.length>1)? parseInt(arr[1]):parseInt(span[i]);score[i]=document.getElementById('score'+(i+1)).value;}var seri1_label=document.getElementById('seri1_label').value;var ope_label=document.getElementById('ope_label').value;arr=ope_label.split('|');ope_label=arr[0];var opecode_label=arr[1];var pro1_label=document.getElementById('misc0_label').value;var pro2_label=document.getElementById('misc1_label').value;var compli_label=document.getElementById('misc2_label').value;var seri2_label=document.getElementById('misc3_label').value;str='通し番号\t000\n';str += '診断群分類番号\t'+dpc+'\n';str += '診断群分類名称\t'+dpcname+'\n';str += '入院期間Ⅰ\t'+((pps_type==1)? span[0] :"")+'\n';str += '入院期間Ⅱ\t'+((pps_type==1)? span[1] :"") +'\n';str += '入院期間Ⅲ\t'+((pps_type==1)? span[2] :"") +'\n';str += '入院期間Ⅰ以下の点数\t'+((pps_type==1)? score[0] :"")+'点\n';str += '入院期間Ⅰを超えⅡ以下の点数\t'+((pps_type==1)? score[1] :"")+'点\n';str += '入院期間Ⅱを超えⅢ以下の点数\t'+((pps_type==1)? score[2] :"")+'点\n';str += '年齢、出生時体重等\t'+seri1_label+'\n';str += '手術\t'+ope_label+'\n';str += '手術Kコード\t'+opecode_label+'\n';str += '手術・処置等1\t'+pro1_label+'\n';str += '手術・処置等2\t'+pro2_label+'\n';str += '副傷病\t'+compli_label+'\n';str += '重症度等\t'+seri2_label+'\n';document.getElementById('dpc_info').value=str;} function getDpcInfoStr(){return document.getElementById('dpc_info').value;}; function getDpcDayYenTableStr(){var dpc=document.getElementById('dpc').value;var adv=document.getElementById('adv').value;var drg=document.getElementById('drg').value;var dpccode=document.getElementById('dpccode').value;var dpcname=document.getElementById('dpcname').value;var coef=parseFloat(document.getElementById('coef').value);if(coef < 0||coef>10) coef=1;if(adv != ''){var tbl_str=dpccode+'\n'+dpcname+'\n';return tbl_str;}else if(drg==''){var pps_type=document.getElementById('pps_type').value;if(dpc=== undefined||dpc==''||pps_type==-1||pps_type==''){ return '';};var dpcname=document.getElementById('dpcname').value;var span=new Array(3);var score=new Array(3);for (var i=0;i < 3;i++){span[i]=document.getElementById('span'+(i+1)).value;if(span[i]=="-"){span[i]=span[i-1];}else{var arr=span[i].split(' ~ ');span[i]=(arr.length>1)? parseInt(arr[1]):parseInt(span[i]);}score[i]=document.getElementById('score'+(i+1)).value;if(score[i]=="-"){score[i]=score[i-1];}}var tbl_str=dpccode+'\n'+dpcname+'\n'+'医療機関別係数\t'+coef+'\n'+'経過日数\t入院期間\t日当点の金額\t初日からの累計金額\t日当点の金額(係数込み)\t初日からの累計金額(係数込み)\n';var max_span=Math.max.apply(null,span);var los_class;var yen;var sum_yen=0;for (var day=1;day <= max_span;day++){los_class=0;if(day>span[1]){ los_class=2;}else if(day>span[0]){ los_class=1;}yen=score[los_class]*10;sum_yen += yen;tbl_str += day+'日目\t期間'+((los_class==2)?'Ⅲ':((los_class==1)?'Ⅱ':'Ⅰ'))+'\t'+yen+'\t'+sum_yen+'\t'+Math.round(yen*coef)+'\t'+Math.round(sum_yen*coef)+'\n';}return tbl_str;}else{var span=document.getElementById('span'+(1)).value;var score=document.getElementById('score'+(1)).value;var yen=score*10;var tbl_str=dpccode+'\n'+dpcname+'\n'+'経過日数\t各日の金額\t初日からの累計金額\n'+'1日目\t'+yen+'\t'+yen+'\n';for (var day=2;day <= span;day++){tbl_str += day+'日目\t'+0+'\t'+yen+'\n';}return tbl_str;}}; function showPstype(pstype,label){if(typeof(label)=='undefined'){label=pstype_labels[pstype];}document.getElementById('is_pps').innerHTML=''+label+'';document.getElementById('is_pps').className=pstype;} function clearPstype(){document.getElementById('is_pps').innerHTML='';document.getElementById('is_pps').className='';} function calcDpcYen(){var los=document.getElementById('los').value;var dpc=document.getElementById('dpc').value;var pps_type=document.getElementById('pps_type').value;var drg=document.getElementById('drg').value;var coef=document.getElementById('coef').value;if(coef.indexOf("/")!=-1){var buf=coef.split("/");coef=buf[0];}if(coef <= 0){ coef=1;}var total_yen=0;if(los>0&&drg != ''){s=document.getElementById('score1').value;total_yen=10*parseInt(s);}else if(los>0&&dpc != ''){var span=new Array(3);var score=new Array(3);for (var i=0;i<3;i++){var s=document.getElementById('span'+(i+1)).value;if(s=="-"){span[i]=span[i-1];}else{span[i]=parseInt(s.substr(s.lastIndexOf("~")+1));}s=document.getElementById('score'+(i+1)).value;if(s=="-"){score[i]=0;}else{score[i]=parseInt(s.substr(s.lastIndexOf("~")+1));}}if(span[0]>0){total_yen=Math.round(10*score[0]*coef*((los <= span[0])? los:span[0]));if(span[1]>0&&los>span[0]){total_yen += Math.round(10*score[1]*coef*(((los <= span[1])? los:span[1])-span[0]));if(span[2]>0&&los>span[1]){total_yen += Math.round(10*score[2]*coef*(((los <= span[2])? los:span[2])-span[1]));}}}}document.getElementById('total_yen').value=((total_yen>0)? total_yen:'');}; function findDrgInfo(){setDpcInfoPanel('drg');var xmlhttp=createHttpRequest();if(xmlhttp==null){return null;};var drg=document.getElementById('drg').value;var url='/fukuro2019.5/query.php?type=drg&val='+encodeURIComponent(drg);sendRequest(xmlhttp,"GET",url,true,callBackDrgInfo,null,null);}; function callBackDrgInfo(xmlhttp,domid){eval(xmlhttp.responseText);storeDrgInfoStr(drg,drgname,span,score);if(drg==''){document.getElementById('dpccode').value='《 短期滞在手術等基本料3による包括 》';document.getElementById('dpcname').value='該当する項目が見つかりません';document.getElementById('pps_type').value=2;document.getElementById('span1').value='';document.getElementById('score1').value='';showPstype('drg');}else{document.getElementById('dpccode').value='《 短期滞在手術等基本料3による包括 》';document.getElementById('dpcname').value=drgname;document.getElementById('pps_type').value=2;document.getElementById('span1').value=span[0];document.getElementById('score1').value=score[0];showPstype('drg');}updateScoreFigs();calcDpcYen();updateRelated('ad');}; function storeDrgInfoStr(drg,drgname,span,score){if(drg=== undefined){ return;};str= '《 短期滞在手術基本料による包括評価 》\n';str += drgname+'\n';str += '期間:'+span[0]+'日\n';str += '包括点数:'+score[0]+'点\n';str += '※入院日から'+(span[0]+1)+'日目以降に対象手術/処置を実施した場合は包括対象外\n';document.getElementById('dpc_info').value=str;} function updateRelated(info_type){clearRelated(info_type);findRelated(info_type);} function findRelated(info_type){if(info_type=== undefined){ info_type='all';}var icd10raw=document.getElementById('icd10raw').value;var icd10=document.getElementById('icd10').value;if(icd10raw != '') icd10=icd10raw;var dpc=document.getElementById('dpc').value;var pps_type=document.getElementById('pps_type').value;var opepro=document.getElementById('dpc_ope').value+','+document.getElementById('dpc_pro1').value+','+document.getElementById('dpc_pro2').value+','+document.getElementById('adv_opepro').value+','+document.getElementById('drg_opepro').value;var compli=document.getElementById('dpc_compli').value;var xmlhttp=createHttpRequest();if(xmlhttp==null){return null;};var url='/fukuro2019.5/query.php?type=related&val='+info_type+'|'+icd10+'|'+dpc+'|'+opepro+'|'+compli;sendRequest(xmlhttp,"GET",url,true,callBackRelated,null,null);} function findAdvAllDpc(adv_name){var info_type='adv_alldpc';var xmlhttp=createHttpRequest();if(xmlhttp==null){return null;};var url='/fukuro2019.5/query.php?type=related&val='+info_type+'|'+adv_name;sendRequest(xmlhttp,"GET",url,true,callBackRelated,null,null);} function findDrgAllDpc(drg_name){var info_type='drg_alldpc';var xmlhttp=createHttpRequest();if(xmlhttp==null){return null;};var url='/fukuro2019.5/query.php?type=related&val='+info_type+'|'+drg_name;sendRequest(xmlhttp,"GET",url,true,callBackRelated,null,null);} function callBackRelated(xmlhttp,domid){eval(xmlhttp.responseText);if(data.length < 1){document.getElementById('noticeContainer').style.display='none';}else if(data.length >= 1){var notes={};for (var i=0;i < data.length;i++){if(!data[i]) continue;var fields=data[i].split("\t");if(fields.length < 3){ continue;}var key=fields[0];var type=fields[1];if(type=='ad'){var arr=fields[2].split('.');var ext=(arr.pop()).toLowerCase();if(ext=='png'||ext=='jpg'||ext=='jpeg'||ext=='gif'){document.getElementById('adSpace').innerHTML="";}else{document.getElementById('adSpace').innerHTML=fields[2];}}else if((','+note_types.join(',')+',').indexOf(','+type+',') >= 0){if(type in notes){notes[type].push(fields);}else{notes[type]=new Array(fields);}}}var items_cnt=0;for (type in notes){items_cnt += notes[type].length;}for (type in notes){var parent=document.getElementById('notes_'+type);parent.innerHTML='';var title=note_titles[type];var pdf=note_pdfs[type];var element=document.createElement('li');addClass(element,'title');addClass(element,type);if(pdf != ''){element.innerHTML=title+getHtmlPdfLink(pdf);}else{element.innerHTML=title;}parent.appendChild(element);if(type=='rece'){var element=document.createElement('li');addClass(element,'attention');addClass(element,type);element.innerHTML=note_attentions[type];parent.appendChild(element);}var elems_hidden_threshold=3;for (var i=0;i < notes[type].length;i++){fields=notes[type][i];var key=fields.shift();var type=fields.shift();var values=fields;var text=values[0];if(values.length>1&&values[values.length-1].match(/\.pdf(#page=[0-9]+)?$/i)){var pdf='pdf/'+values.pop();if(values.length>1){var source=values.pop();}else{var source='';}}else{var pdf='';}var pdf_html=(pdf != '')? getHtmlPdfLink(pdf,source):'';element=document.createElement('li');addClass(element,'item');addClass(element,type);element.setAttribute('title','マッチしたキーワード:'+key.replace(/\[.+\]/,''));var elem_id='';switch (type){case 'adv':var arr=(text.split(':'));if(arr.length>1){var code=arr[0];var name=arr[1];}else{var code='';var name=text;}if(/^(.*)\|(.*)$/.test(name)){var name=RegExp.$1;var remarks=RegExp.$2;var onclick="this.children[1].style.display=(this.children[1].style.display==\"none\")?\"block\":\"none\";";var div_remarks_options=" class='remarks' onclick='"+onclick+"' title='クリックして適用条件の表示を切り替える' style='cursor:pointer;display:block;transition:height 2s ease 1s;'";var display_default=(items_cnt>2)?'display:none;':'display:block';var remarks_html=" ※適用条件
"+remarks+"
";}else{var remarks_html='';}var html="";if(code) elem_id=type+'_item_'+code;html += pdf_html;html += remarks_html;break;case 'drg':var drg=((values.length>1)? values[1]:'');var arr=(text.split(':'));var code=arr[0];var name=arr[1];var html="";if(code) elem_id=type+'_item_'+code;html += pdf_html;break;case 'rece':var arr=(text.split(':'));var code=arr[0];var name=arr[1];var html="";var elems_subtitle=((values.length-1)>1)? 1: 0;for(var k=1;kelems_hidden_threshold)?" onclick=\"var ch=this.children;var disp='none';if(ch[ch.length-2].style.display=='none'){disp='list-item';}for(var i="+(elems_subtitle+elems_hidden_threshold)+",len=ch.length-1;i";if(k==1){if(elems_subtitle){html="
"+code+" "+name+"
";}else{html += "
"+code+" "+((name.length>17)? name.substr(0,16)+"...":name)+""+annotation+dl_url_html+"
";}}html += "
    ";var title_tooltip=label+' 【'+reces_cnt+'項目】';title_tooltip=' title="'+title_tooltip+'"';if(label.substr(0,1)=="x"){ label_title += "(以下に該当しない症例)";}if(elems_subtitle){html += "
  • "+label_title+""+annotation+dl_url_html+""+"
  • ";}for(var l=0;l= elems_hidden_threshold)?" style='display:none;'":"";var rece_code=rece.substr(0,rece.indexOf(":"));var rece_label=rece.substr(rece.indexOf(":")+1,rece.length-rece.indexOf(":")-1);if(rece_label.indexOf("|") >= 0){rece_label=""+rece_label.substr(0,rece_label.indexOf("|"))+" "+rece_label.substr(rece_label.indexOf("|")+1,rece_label.length-rece_label.indexOf("|")-1);}var rece_tooltip=rece.replace("|"," ");html += "
  • - "+rece_label+"
  • ";}if(reces_cnt>elems_hidden_threshold){html += "";}html += "
";}if(code) elem_id=type+'_item_'+code;html += pdf_html;break;case 'compli':var arr=(text.split(':'));var code=arr[0];var name=arr[1];var icds=values[1].split(",");var icds_cnt=icds.length;var annotation="(全"+icds_cnt+"項目)";var html="
"+code+" "+name+""+annotation+"
";var footer_tooltip_shrinked="▽ クリックして該当する標準病名を表示する...";var footer_tooltip_expanded="△ クリックして標準病名を非表示にする";var onclick_toggle=" onclick=\"var ch=this.children;var len=ch.length-1;var disp='none';for(var i=0;i";var hidden_style="display:none;";for(var k=0;k0){var byomei_str=icd_name.substring(icd_name.indexOf("[")+1,icd_name.indexOf("]"));byomeis=byomei_str.split("|");icd_name=icd_name.substring(0,icd_name.indexOf("["));}var icd_label=""+icd_code+"  "+icd_name;var title=icd_code+":"+icd_name;if(byomeis.length>0){ title=title+" ("+byomeis.length+"個の標準病名)";}html += "
  • "+"- "+icd_label+"
  • ";for(var j=0;j"+_label+"";}}html += "";if(code) elem_id=type+'_item_'+code;break;case 'gigi':var arr=(text.split(':'));if(arr.length>1){var question_id=arr[0];var question=arr[1];var answer=arr[2];var html="【"+question_id+"】 "+question+"
    (答) "+answer;if(code) elem_id=type+'_item_'+code;}else{var html=text;}html += pdf_html;break;default:var arr=(text.split(':'));if(arr.length>1){var code=arr[0];var name=arr[1];var html=""+code+" "+name;if(code) elem_id=type+'_item_'+code;}else{var html=text;}html += pdf_html;break;}if(key.indexOf("[")>-1&&key.substr(-1,1)=="]"){var dpc=document.getElementById('dpc').value;var more_keys=key.substr(key.indexOf("[")+1,key.length-key.indexOf("[")-2).split(",");var cols_class=((type=='adv')? " three_cols":"");html += "
      ";for (var j=0;j";if(dpc==key_dpc){html += ""+key_dpc+"";}else{html += ""+key_dpc+"";}if((j < more_keys.length-1)&&(j % 3 < 2)){ html += " | ";}html += "";}html += "
    ";}else if(key=='-'&&type=='adv'){html += "
      ";html += "
    • ";html += "【※ 全ての診断群分類が対象】";html += "
    • ";html += "
    ";}element.innerHTML=html;if(elem_id) element.id=elem_id;parent.appendChild(element);}}document.getElementById('noticeContainer').style.display='none';}contentsChanged();} function clearRelated(info_type){if(info_type=== undefined||info_type=='note'){for (var i=0;i0){elem.innerHTML=''+String(count)+'';}else if(count < 0){elem.innerHTML=''+String(-1*count)+'';}else{elem.innerHTML='';}}}; function showCandidates(innerHtml,domid){var result=document.getElementById('candidates');result.innerHTML=innerHtml;result.setAttribute('target_domid',domid);result.setAttribute('search_main',((result.children[0].id=='candidates_tab')? true:false));setCandidatesDimension();result.style.visibility='visible';}; function setCandidatesDimension(){var elem=document.getElementById('candidates');var domid=elem.getAttribute('target_domid');if(domid=='') return;var rect=document.getElementById(domid).getBoundingClientRect();elem.style.left=Math.round(getWinXOffset()+rect.left)+'px';elem.style.top=Math.round(getWinYOffset()+rect.bottom)+'px';elem.style.background='white';elem.style.width=Math.max(330,(rect.width||(rect.right-rect.left)))+'px';}; function hideCandidates(){var elem=document.getElementById('candidates');if(elem){elem.style.visibility='hidden';for (var i=0;i < elem.childNodes.length;i++){if(elem.childNodes[i].style){elem.childNodes[i].style.visibility='hidden';};};};}; function isCandidatesVisible(){var elem=document.getElementById('candidates');return (elem.style.visibility=='visible');}; function isSearchMainGoing(){if(isCandidatesVisible()){var elem=document.getElementById('candidates');if(elem.getAttribute('search_main')==true){return true;}}return false;}; function getHtmlPdfLink(pdf,title,page_no,icon_name){if(page_no !== undefined&&page_no>0){var pdf=pdf+'?page='+page_no;}if(title=== undefined||title=='')title='情報の出典を見る';if(icon_name=== undefined||icon_name=='')icon_name='icon_doc.png';return "";}; function updatePdfLinkTimestamp(elem){var url=elem.href;url=url.replace(/&t=[0-9]+/,("&t="+(new Date()).getTime()));elem.href=url;};