12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799 |
- /**
- * @desc : 아파치항목값 저장
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- //function fSaveApache(){
- function fSaveApache(flag){
- ////아파치 기록정보 인증저장
- //function fSaveApchEspi(flag)
- //{
- if (flag == null) {
- flag = "N"
- }
- var apchhr = "06"; //아파치적용시간
-
- var instcd = getUserInfo("dutplceinstcd");
- var pid = opener.javascript.getParameter("SPMMR03200_pid");
- var orddd = opener.javascript.getParameter("SPMMR03200_orddd");
- var cretno = opener.javascript.getParameter("SPMMR03200_cretno");
- //var apchdd = opener.javascript.getParameter("SPMMR03200_apchdd");
- model.setValue("/root/send/selectdata/status", status);
- model.refresh();
-
- if(model.getValue("/root/send/selectdata/ordinfo") == "" ){
- messageBox("입실, 재원중, 퇴실 여부를 ", "C002" );
- return;
- }
-
- submit("TRMMR03213");
-
- var cnt = getNodesetCount("/root/temp/apchlist");
-
- if(cnt > 0){
- var status = "u";
- var m = "u";
- }else if(cnt <= 0){
- var status = "i";
- var m = "i";
- }
- var currentdate = getCurrentDate() + getCurrentTime();
- var ref = "/root/main/apchitem/item";
- var dataCnt = getNodesetCnt(model, ref);
- var savedata1 ="status▦instcd▦pid▦orddd▦cretno▦apchdd▦apchitemcd▦reptrslt▦rsltrgstdt▦apchval▦apchscore▦apchlabel▩"; //헤더부분 컬럼
- var savedata2 ="m▦instcd▦pid▦orddd▦cretno▦apchdd▦apchscore▦dethrate▦apchscorea▦dethratea▦apchhr▦adjustednm▦ordinfo▦lastespiyn▦signno▩"; //헤더부분 컬럼
- var dataString1 = "";
- var dataString2 = "";
- var apchdd = model.getValue("/root/main/reqstnddd");
-
- for (var i=1 ; i <= dataCnt ; i++) {
- var apchitemcd = model.getValue(ref + "[" + i + "]/apchitemcd");
- var reptrslt = model.getValue(ref + "[" + i + "]/apchitemvalue");
- var rsltrgstdt = model.getValue(ref + "[" + i + "]/apchitemdt");
- var apchval = model.getValue(ref + "[" + i + "]/apchitemval");
- var apchscore = model.getValue(ref + "[" + i + "]/apchitemscore");
-
- //model.setValue(ref + "[" + i + "]/apchitemlabel", model.getValue("/root/init/item/apchitemlabel["+ i +"]"));
- var apchlabel = model.getValue(ref + "[" + i + "]/apchitemlabel");
-
- dataString1 = dataString1 + status + "▦" + instcd + "▦" + pid + "▦" + orddd + "▦" + cretno + "▦" + apchdd + "▦";
- dataString1 = dataString1 + apchitemcd + "▦" + reptrslt + "▦" + rsltrgstdt + "▦" + apchval + "▦" + apchscore + "▦" + apchlabel+ "▩";
- }//for i END
- var apchscore = model.getValue(ref + "[apchitemcd='18']/apchitemscore");
- var dethrate = model.getValue(ref + "[apchitemcd='19']/apchitemscore");
- var apchscorea = model.getValue(ref + "[apchitemcd='20']/apchitemscore");
- var dethratea = model.getValue(ref + "[apchitemcd='21']/apchitemscore");
- var adjustednm = model.getValue("/root/send/selectdata/adjustednm");
- var ordinfo = model.getValue("/root/send/selectdata/ordinfo");
-
- model.setValue("/root/send/selectdata/lastespiyn",flag);
- var lastespiyn = model.getValue("/root/send/selectdata/lastespiyn");
-
- //model.setValue("/root/send/selectdata/signno",model.getValue("/root/temp/sign/no"));
- var signno = model.getValue("/root/send/selectdata/signno");
-
- var fstrgstrid = model.getValue("/root/send/selectdata/fstrgstrid");
- var fstrgstdt = model.getValue("/root/send/selectdata/fstrgstdt");
- var lastupdtrid = model.getValue("/root/send/selectdata/lastupdtrid");
- var lastupdtdt = model.getValue("/root/send/selectdata/lastupdtdt");
- dataString2 = dataString2 + m + "▦" + instcd + "▦" + pid + "▦" + orddd + "▦" + cretno + "▦" + apchdd + "▦";
- dataString2 = dataString2 + apchscore + "▦" + dethrate + "▦" + apchscorea + "▦" + dethratea + "▦" + apchhr + "▦";
- dataString2 = dataString2 + adjustednm + "▦" + ordinfo + "▦" + lastespiyn + "▦" + signno + "▦";
- dataString2 = dataString2 + fstrgstrid + "▦" + fstrgstdt + "▦" + lastupdtrid + "▦" + lastupdtdt + "▩";
-
- if(dataString1.length > 0 && dataString2.length > 0) {
- model.setValue("/root/send/savedata/apchitem", savedata1 + dataString1);
- model.setValue("/root/send/savedata/apchscore", savedata2 + dataString2);
- if(model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore") != "N"){
- //항목별
- model.removeNode("/root/main/apchresult");
- model.makeNode("/root/main/apchresult");
-
- copyNodeset("/root/main/apchresult", "/root/main/apchitem", "", model, model);
- // 인증정보
- if(submit("TXMMR03210")==true){
- if (flag == "Y") {
- // 2009.08.10. *** 아파치기록정보 인증데이타 만들기..
- fGetApchRecCert();
- }
- //if(submit("TXMMR03210")==true){
- messageBox("저장","I002");
- fInit();
- }
- }else{
- messageBox("APACHE Ⅱ - ADJUSTED 항목을 ", "C002" );
- return;
- }
- model.refresh();
- }//if END
- }//fSaveApache END
- /**
- * @desc : 아파치 상세항목 Excel 파일로 저장
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fSelect(){
- model.setValue("/root/main/apchitem/item[apchitemcd='01']/apchitemlabel", cmb_temp.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='02']/apchitemlabel", cmb_zpam.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='03']/apchitemlabel", cmb_zfc.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='04']/apchitemlabel", cmb_zfr.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemlabel", cmb_zaa.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemlabel", cmb_pao.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemlabel", cmb_hco.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='08']/apchitemlabel", cmb_ph.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='09']/apchitemlabel", cmb_na.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='10']/apchitemlabel", cmb_ka.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='11']/apchitemlabel", cmb_uree.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='12']/apchitemlabel", cmb_urea.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='13']/apchitemlabel", cmb_hc.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='14']/apchitemlabel", cmb_gb.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='15']/apchitemlabel", cmb_glas.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='16']/apchitemlabel", cmb_age.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='17']/apchitemlabel", cmb_mcro.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='23']/apchitemlabel", cmb_simple.label);
- model.setValue("/root/main/apchitem/item[apchitemcd='24']/apchitemlabel", ipt_fio2.value);
- model.setValue("/root/main/apchitem/item[apchitemcd='25']/apchitemlabel", opt_aao2.value);
- model.setValue("/root/main/apchitem/item[apchitemcd='26']/apchitemlabel", ipt_paco2.value);
- model.setValue("/root/main/apchitem/item[apchitemcd='27']/apchitemlabel", ipt_pao2.value);
- model.setValue("/root/main/apchitem/item[apchitemcd='28']/apchitemlabel", ipt_hco3.value);
- model.refresh();
- }
- function fSaveExcel() {
- var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
- if (fileName != "") {
- item.saveExcel(fileName, "SheetName", true, true, "", "", "Boolean colHiddenExtend");
- }
- }
- /**
- * @desc : 아파치 스코어 디폴트값 지정
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fInit(){
-
- var instcd = getUserInfo("dutplceinstcd");
- var vNowDD = getCurrentDate();
- var ref = "/root/main/apchitem/item";
- var dataCnt = getNodesetCnt(model, ref);
- var node = getGlobalVariable("paminfo");
-
- var pid = opener.javascript.getParameter("SPMMR03200_pid");
- var hngnm = opener.javascript.getParameter("SPMMR03200_hngnm");
- var orddd = opener.javascript.getParameter("SPMMR03200_orddd");
- var cretno = opener.javascript.getParameter("SPMMR03200_cretno");
- var apchdd = opener.javascript.getParameter("SPMMR03200_apchdd");
- var age = opener.javascript.getParameter("SPMMR03200_age");
- var fromdd = opener.javascript.getParameter("SPMMR03200_fromdd");
- var todd = opener.javascript.getParameter("SPMMR03200_todd");
- if(model.getValue("/root/send/selectdata/daylist") != apchdd && model.getValue("/root/send/selectdata/daylist") != ""){
- model.setValue("/root/main/reqstnddd", model.getValue("/root/send/selectdata/daylist"));
- }else if(model.getValue("/root/send/selectdata/daylist") == apchdd || model.getValue("/root/send/selectdata/daylist") == ""){
- model.setValue("/root/main/reqstnddd", apchdd);
- }
- if (pid!=""){
- model.setValue("/root/send/selectdata/hngnm",hngnm);
- model.setValue("/root/send/selectdata/pid",pid);
- model.setValue("/root/send/selectdata/instcd",instcd);
- model.setValue("/root/send/selectdata/orddd",orddd);
- model.setValue("/root/send/selectdata/cretno",cretno);
- model.setValue("/root/send/selectdata/apchdd",model.getValue("/root/main/reqstnddd"));
- model.setValue("/root/send/selectdata/fromdd",fromdd);
- model.setValue("/root/send/selectdata/todd",todd);
-
- //ipt_zage.value = age;
-
- submit("TRMMR03214");
-
- //cmb_daylist.select(0);
- model.refresh();
- }
- cmb_device.visible = false;
- cmb_nasal.visible = false;
- cmb_simple.visible = false;
- cpt_O2.visible = false;
- cpt_L.visible = false;
- model.refresh();
-
- submit("TRMMR03210");
- //나이
- if(model.getValue("/root/main/apchitem/item[apchitemcd='16']/apchitemvalue") == ""){
- ipt_zage.value = age;
- }else{
- ipt_zage.value = model.getValue("/root/main/apchitem/item[apchitemcd='16']/apchitemvalue");
- }
-
- //기록정보 유형
- if(model.getValue("/root/temp/apchpidlist/item/ordinfo") == ""){
- if(model.getValue("/root/send/selectdata/apchdd") == model.getValue("/root/send/selectdata/fromdd")){
- rdo_ordinfo.value = "1";
- }
- }else{
- rdo_ordinfo.value = model.getValue("/root/temp/apchpidlist/item/ordinfo");
- }
-
- //Adjusted 명칭
- if(opt_zmorta.value != ""){
- if(model.getValue("/root/temp/apchpidlist/item/adjustednm") != ""){
- opt_content.value = model.getValue("/root/temp/apchpidlist/item/adjustednm");
- }
- }else{
- opt_content.value = "";
- }
-
- //인증저장정보
- model.setValue("/root/send/selectdata/lastespiyn", model.getValue("/root/temp/apchpidlist/item/lastespiyn"));
- //signno
- model.setValue("/root/send/selectdata/signno", model.getValue("/root/temp/apchpidlist/item/signno"));
-
- model.refresh();
- fView();
- }
- /**
- * @desc : 아파치 상세항목 선택 스코어값 저장
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- // 1. Temperature
- function fValueTEMP() {
- setInputNodeCurText();
- if (ipt_ztemp.currentText == ""){
- cmb_temp.value = "90";
- } else if (ipt_ztemp.currentText <= 29.9){
- cmb_temp.value = "14";
- } else if (ipt_ztemp.currentText >= 30 && ipt_ztemp.currentText <= 31.9){
- cmb_temp.value = "13";
- } else if (ipt_ztemp.currentText >= 32 && ipt_ztemp.currentText <= 33.9){
- cmb_temp.value = "12";
- } else if (ipt_ztemp.currentText >= 34 && ipt_ztemp.currentText <= 35.9){
- cmb_temp.value = "11";
- } else if (ipt_ztemp.currentText >= 36 && ipt_ztemp.currentText <= 38.4){
- cmb_temp.value = "10";
- } else if (ipt_ztemp.currentText >= 38.5 && ipt_ztemp.currentText <= 38.9){
- cmb_temp.value = "21";
- } else if (ipt_ztemp.currentText >= 39 && ipt_ztemp.currentText <= 40.9){
- cmb_temp.value = "23";
- } else if (ipt_ztemp.currentText >= 41){
- cmb_temp.value = "24";
- }
- fCalcTEMP();
- model.refresh();
- }
- function fCalcTEMP() {
- //99 opt_ztemp.value = cmb_temp.value.substr(1, 2);
- ztemp = cmb_temp.value.substr(1, 2);
- lbtemp = cmb_temp.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
- //99 if(opt_zmorta.value == ""){
- //99 if(opt_ztemp.value == ""){
- if(ztemp == ""){
- model.setValue("/root/init/item/apchitemscore1", "0");
- model.setValue("/root/init/item/apchitemlabel1", "");
- //99 model.makeValue("/root/init/item2/apchitemscore[1]", "0");
- }else{
- //99 model.setValue("/root/main/apchitem/item[apchitemcd='01']/apchitemscore", opt_ztemp.value);
- model.setValue("/root/init/item/apchitemscore1", ztemp);
- model.setValue("/root/init/item/apchitemlabel1", lbtemp);
- //99 model.makeValue("/root/init/item2/apchitemscore[1]", "0");
- }
-
- model.refresh();
- }
- // 2. Mean Arterial Pressure
- function fValuePAM() {
- setInputNodeCurText();
- if (ipt_zpam.currentText == ""){
- cmb_zpam.value = "90";
- } else if (ipt_zpam.currentText <= 49){
- cmb_zpam.value = "14";
- } else if (ipt_zpam.currentText >= 50 && ipt_zpam.currentText <= 69){
- cmb_zpam.value = "12";
- } else if (ipt_zpam.currentText >= 70 && ipt_zpam.currentText <= 109){
- cmb_zpam.value = "10";
- } else if (ipt_zpam.currentText >= 110 && ipt_zpam.currentText <= 129){
- cmb_zpam.value = "22";
- } else if (ipt_zpam.currentText >= 130 && ipt_zpam.currentText <= 159){
- cmb_zpam.value = "23";
- } else if (ipt_zpam.currentText >= 160){
- cmb_zpam.value = "24";
- }
- fCalcPAM();
- model.refresh();
- }
- function fCalcPAM() {
- //99 opt_zpam.value = cmb_zpam.value.substr(1,2);
- zpam = cmb_zpam.value.substr(1,2);
- lbpam = cmb_zpam.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
- //99 if(opt_zpam.value == ""){
- if(zpam == ""){
- model.setValue("/root/init/item/apchitemscore2", "0");
- model.setValue("/root/init/item/apchitemlabel2", "");
- }else{
- //99 model.setValue("/root/main/apchitem/item[apchitemcd='02']/apchitemscore", opt_zpam.value);
- model.setValue("/root/init/item/apchitemscore2", zpam);
- model.setValue("/root/init/item/apchitemlabel2", lbpam);
- }
- model.refresh();
- }
- // 3. Heart Rate
- function fValueFC() {
- setInputNodeCurText();
- if (ipt_zfc.currentText == ""){
- cmb_zfc.value = "90";
- } else if (ipt_zfc.currentText <= 39){
- cmb_zfc.value = "14";
- } else if (ipt_zfc.currentText >= 40 && ipt_zfc.currentText <= 54){
- cmb_zfc.value = "13";
- } else if (ipt_zfc.currentText >= 55 && ipt_zfc.currentText <= 69){
- cmb_zfc.value = "12";
- } else if (ipt_zfc.currentText >= 70 && ipt_zfc.currentText <= 109){
- cmb_zfc.value = "10";
- } else if (ipt_zfc.currentText >= 110 && ipt_zfc.currentText <= 139){
- cmb_zfc.value = "22";
- } else if (ipt_zfc.currentText >= 140 && ipt_zfc.currentText <= 179){
- cmb_zfc.value = "23";
- } else if (ipt_zfc.currentText >= 180){
- cmb_zfc.value = "24";
- }
- fCalcFC();
- model.refresh();
- }
- function fCalcFC() {
- //99 opt_zfc.value = cmb_zfc.value.substr(1,2);
- zfc = cmb_zfc.value.substr(1,2);
- lbfc = cmb_zfc.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
- //99 if(opt_zfc.value == ""){
- if(zfc == ""){
- model.setValue("/root/init/item/apchitemscore3", "0");
- model.setValue("/root/init/item/apchitemlabel3", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='03']/apchitemscore", opt_zfc.value);
- model.setValue("/root/init/item/apchitemscore3", zfc);
- model.setValue("/root/init/item/apchitemlabel3", lbfc);
- }
- model.refresh();
- }
- // 4. Respiratory Rate
- function fValueFR() {
- setInputNodeCurText();
- if (ipt_zfr.currentText == ""){
- cmb_zfr.value = "90";
- } else if (ipt_zfr.currentText <= 5){
- cmb_zfr.value = "14";
- } else if (ipt_zfr.currentText >= 6 && ipt_zfr.currentText <= 9){
- cmb_zfr.value = "12";
- } else if (ipt_zfr.currentText >= 10 && ipt_zfr.currentText <= 11){
- cmb_zfr.value = "11";
- } else if (ipt_zfr.currentText >= 12 && ipt_zfr.currentText <= 24){
- cmb_zfr.value = "10";
- } else if (ipt_zfr.currentText >= 25 && ipt_zfr.currentText <= 34){
- cmb_zfr.value = "21";
- } else if (ipt_zfr.currentText >= 35 && ipt_zfr.currentText <= 49){
- cmb_zfr.value = "23";
- } else if (ipt_zfr.currentText >= 50){
- cmb_zfr.value = "24";
- }
- fCalcFR();
- model.refresh();
- }
- function fCalcFR() {
- //99 opt_zfr.value = cmb_zfr.value.substr(1,2);
- zfr = cmb_zfr.value.substr(1,2);
- lbfr = cmb_zfr.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
-
- //99 if(opt_zfr.value == ""){
- if(zfr == ""){
- model.setValue("/root/init/item/apchitemscore4", "0");
- model.setValue("/root/init/item/apchitemlabel4", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='04']/apchitemscore", opt_zfr.value);
- model.setValue("/root/init/item/apchitemscore4", zfr);
- model.setValue("/root/init/item/apchitemlabel4", lbfr);
- }
- model.refresh();
- }
- // 5. If FIO2>=0, 5:(A-a)O2
- function fValueAA() {
- if (ipt_zaa.currentText == ""){
- cmb_zaa.value = "90";
- } else if (ipt_zaa.currentText < 200){
- cmb_zaa.value = "20";
- } else if (ipt_zaa.currentText >= 200 && ipt_zaa.currentText <= 349){
- cmb_zaa.value = "22";
- } else if (ipt_zaa.currentText >= 350 && ipt_zaa.currentText <= 499){
- cmb_zaa.value = "23";
- } else if (ipt_zaa.currentText >= 500){
- cmb_zaa.value = "24";
- }
- fCalcAA();
- model.refresh();
- }
- function fCalcAA() {
- //99 opt_zaa.value = cmb_zaa.value.substr(1,2);
- zaa = cmb_zaa.value.substr(1,2);
- lbaa = cmb_zaa.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
-
- //99 if(opt_zaa.value == ""){
- if(zaa == ""){
- model.setValue("/root/init/item/apchitemscore5", "0");
- model.setValue("/root/init/item/apchitemlabel5", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemscore", opt_zaa.value);
- model.setValue("/root/init/item/apchitemscore5", zaa);
- model.setValue("/root/init/item/apchitemlabel5", lbaa);
- }
- model.refresh();
- }
- // 6. If FIO2<0, 5:PaO2
- function fValuePAO() {
- if (ipt_zpao.currentText == ""){
- cmb_pao.value = "90";
- } else if (ipt_zpao.currentText < 55){
- cmb_pao.value = "14";
- } else if (ipt_zpao.currentText >= 55 && ipt_zpao.currentText <= 60){
- cmb_pao.value = "13";
- } else if (ipt_zpao.currentText >= 61 && ipt_zpao.currentText <= 70){
- cmb_pao.value = "11";
- } else if (ipt_zpao.currentText > 70){
- cmb_pao.value = "20";
- }
- fCalcPAO();
- model.refresh();
- }
- function fCalcPAO() {
- //99 opt_zpao.value = cmb_pao.value.substr(1,2);
- zpao = cmb_pao.value.substr(1,2);
- lbpao = cmb_pao.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
-
- //99 if(opt_zpao.value == ""){
- if(zpao == ""){
- model.setValue("/root/init/item/apchitemscore6", "0");
- model.setValue("/root/init/item/apchitemlabel6", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemscore", opt_zpao.value);
- model.setValue("/root/init/item/apchitemscore6", zpao);
- model.setValue("/root/init/item/apchitemlabel6", lbpao);
- }
- model.refresh();
- }
- // 7. If no A.B Gs: Serum HCO3-
- function fValueHCO() {
- if (ipt_zhco.currentText == ""){
- cmb_hco.value = "90";
- } else if (ipt_zhco.currentText >= 52){
- cmb_hco.value = "14";
- } else if (ipt_zhco.currentText >= 41 && ipt_zhco.currentText <= 51.9){
- cmb_hco.value = "13";
- } else if (ipt_zhco.currentText >= 32 && ipt_zhco.currentText <= 40.9){
- cmb_hco.value = "11";
- } else if (ipt_zhco.currentText >= 22 && ipt_zhco.currentText <= 31.9){
- cmb_hco.value = "10";
- } else if (ipt_zhco.currentText >= 18 && ipt_zhco.currentText <= 21.9){
- cmb_hco.value = "22";
- } else if (ipt_zhco.currentText >= 15 && ipt_zhco.currentText <= 17.9){
- cmb_hco.value = "23";
- } else if (ipt_zhco.currentText < 15){
- cmb_hco.value = "24";
- }
- fCalcHCO();
- model.refresh();
- }
- function fCalcHCO() {
- //99 opt_zhco.value = cmb_hco.value.substr(1,2);
- zhco = cmb_hco.value.substr(1,2);
- lbhco = cmb_hco.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
-
- //99 if(opt_zhco.value == ""){
- if(zhco == ""){
- model.setValue("/root/init/item/apchitemscore7", "0");
- model.setValue("/root/init/item/apchitemlabel7", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemscore", opt_zhco.value);
- model.setValue("/root/init/item/apchitemscore7", zhco);
- model.setValue("/root/init/item/apchitemlabel7", lbhco);
- }
- model.refresh();
- }
- // 8. Aterial pH.
- function fValuePH() {
- setInputNodeCurText();
- if (ipt_zph.currentText == ""){
- cmb_ph.value = "90";
- } else if (ipt_zph.currentText >= 7.7){
- cmb_ph.value = "14";
- } else if (ipt_zph.currentText >= 7.6 && ipt_zph.currentText <= 7.69){
- cmb_ph.value = "13";
- } else if (ipt_zph.currentText >= 7.5 && ipt_zph.currentText <= 7.59){
- cmb_ph.value = "11";
- } else if (ipt_zph.currentText >= 7.33 && ipt_zph.currentText <= 7.49){
- cmb_ph.value = "10";
- } else if (ipt_zph.currentText >= 7.25 && ipt_zph.currentText <= 7.32){
- cmb_ph.value = "22";
- } else if (ipt_zph.currentText >= 7.15 && ipt_zph.currentText <= 7.24){
- cmb_ph.value = "23";
- } else if (ipt_zph.currentText < 7.15){
- cmb_ph.value = "24";
- }
- fCalcPH();
- model.refresh();
- }
- function fCalcPH() {
- //99 opt_zph.value = cmb_ph.value.substr(1,2);
- zph = cmb_ph.value.substr(1,2);
- lbph = cmb_ph.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
-
- //99 if(opt_zph.value == ""){
- if(zph == ""){
- model.setValue("/root/init/item/apchitemscore8", "0");
- model.setValue("/root/init/item/apchitemlabel8", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='08']/apchitemscore", opt_zph.value);
- model.setValue("/root/init/item/apchitemscore8", zph);
- model.setValue("/root/init/item/apchitemlabel8", lbph);
- }
- model.refresh();
- }
- // 9. Serum Sodium
- function fValueNA() {
- setInputNodeCurText();
- if (ipt_zna.currentText == ""){
- cmb_na.value = "90";
- } else if (ipt_zna.currentText >= 180){
- cmb_na.value = "14";
- } else if (ipt_zna.currentText >= 160 && ipt_zna.currentText <= 179){
- cmb_na.value = "13";
- } else if (ipt_zna.currentText >= 155 && ipt_zna.currentText <= 159){
- cmb_na.value = "12";
- } else if (ipt_zna.currentText >= 150 && ipt_zna.currentText <= 154){
- cmb_na.value = "11";
- } else if (ipt_zna.currentText >= 130 && ipt_zna.currentText <= 149){
- cmb_na.value = "10";
- } else if (ipt_zna.currentText >= 120 && ipt_zna.currentText <= 129){
- cmb_na.value = "22";
- } else if (ipt_zna.currentText >= 111 && ipt_zna.currentText <= 119){
- cmb_na.value = "23";
- } else if (ipt_zna.currentText <= 110){
- cmb_na.value = "24";
- }
- fCalcNA();
- model.refresh();
- }
- function fCalcNA() {
- //99 opt_zna.value = cmb_na.value.substr(1,2);
- zna = cmb_na.value.substr(1,2);
- lbna = cmb_na.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
-
- //99 if(opt_zna.value == ""){
- if(zna == ""){
- model.setValue("/root/init/item/apchitemscore9", "0");
- model.setValue("/root/init/item/apchitemlabel9", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='09']/apchitemscore", opt_zna.value);
- model.setValue("/root/init/item/apchitemscore9", zna);
- model.setValue("/root/init/item/apchitemlabel9", lbna);
- }
- model.refresh();
- }
- // 10. Serum Potassium
- function fValueKA() {
- setInputNodeCurText();
- if (ipt_zka.currentText == ""){
- cmb_ka.value = "90";
- } else if (ipt_zka.currentText >= 7){
- cmb_ka.value = "14";
- } else if (ipt_zka.currentText >= 6 && ipt_zka.currentText <= 6.9){
- cmb_ka.value = "13";
- } else if (ipt_zka.currentText >= 5.5 && ipt_zka.currentText <= 5.9){
- cmb_ka.value = "11";
- } else if (ipt_zka.currentText >= 3.5 && ipt_zka.currentText <= 5.4){
- cmb_ka.value = "10";
- } else if (ipt_zka.currentText >= 3 && ipt_zka.currentText <= 3.4){
- cmb_ka.value = "21";
- } else if (ipt_zka.currentText >= 2.5 && ipt_zka.currentText <= 2.9){
- cmb_ka.value = "22";
- } else if (ipt_zka.currentText < 2.5){
- cmb_ka.value = "24";
- }
- fCalcKA();
- model.refresh();
- }
- function fCalcKA() {
- //99 opt_zka.value = cmb_ka.value.substr(1,2);
- zka = cmb_ka.value.substr(1,2);
- lbka = cmb_ka.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
-
- //99 if(opt_zka.value == ""){
- if(zka == ""){
- model.setValue("/root/init/item/apchitemscore10", "0");
- model.setValue("/root/init/item/apchitemlabel10", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='10']/apchitemscore", opt_zka.value);
- model.setValue("/root/init/item/apchitemscore10", zka);
- model.setValue("/root/init/item/apchitemlabel10", lbka);
- }
- model.refresh();
- }
- // 11. Serum Creatinine With Acute Renal Failure
- function fValueUREE() {
- setInputNodeCurText();
- if (ipt_zuree.currentText == ""){
- cmb_uree.value = "90";
- } else if (ipt_zuree.currentText < 0.6){
- cmb_uree.value = "14";
- } else if (ipt_zuree.currentText >= 0.6 && ipt_zuree.currentText <= 1.4){
- cmb_uree.value = "20";
- } else if (ipt_zuree.currentText >= 1.5 && ipt_zuree.currentText <= 1.9){
- cmb_uree.value = "24";
- } else if (ipt_zuree.currentText >= 2 && ipt_zuree.currentText <= 3.4){
- cmb_uree.value = "26";
- } else if (ipt_zuree.currentText >= 3.5){
- cmb_uree.value = "28";
- }
- fCalcUREE();
- model.refresh();
- }
- function fCalcUREE() {
- //99 opt_zuree.value = cmb_uree.value.substr(1,2);
- zuree = cmb_uree.value.substr(1,2);
- lburee = cmb_uree.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
-
- //99 if(opt_zuree.value == ""){
- if(zuree == ""){
- model.setValue("/root/init/item/apchitemscore11", "0");
- model.setValue("/root/init/item/apchitemlabel11", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='11']/apchitemscore", opt_zuree.value);
- model.setValue("/root/init/item/apchitemscore11", zuree);
- model.setValue("/root/init/item/apchitemlabel11", lburee);
- }
- model.refresh();
- }
- // 12. Serum Creatinine Without Acute Renal Failure
- function fValueUREA() {
- setInputNodeCurText();
- if (ipt_zurea.currentText == ""){
- cmb_urea.value = "90";
- } else if (ipt_zurea.currentText < 0.6){
- cmb_urea.value = "12";
- } else if (ipt_zurea.currentText >= 0.6 && ipt_zurea.currentText <= 1.4){
- cmb_urea.value = "20";
- } else if (ipt_zurea.currentText >= 1.5 && ipt_zurea.currentText <= 1.9){
- cmb_urea.value = "22";
- } else if (ipt_zurea.currentText >= 2 && ipt_zurea.currentText <= 3.4){
- cmb_urea.value = "23";
- } else if (ipt_zurea.currentText >= 3.5){
- cmb_urea.value = "24";
- }
- fCalcUREA();
- model.refresh();
- }
- function fCalcUREA() {
- //99 opt_zurea.value = cmb_urea.value.substr(1,2);
- zurea = cmb_urea.value.substr(1,2);
- lburea = cmb_urea.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
-
- //99 if(opt_zurea.value == ""){
- if(zurea == ""){
- model.setValue("/root/init/item/apchitemscore12", "0");
- model.setValue("/root/init/item/apchitemlabel12", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='12']/apchitemscore", opt_zurea.value);
- model.setValue("/root/init/item/apchitemscore12", zurea);
- model.setValue("/root/init/item/apchitemlabel12", lburea);
- }
- model.refresh();
- }
- // 13. Ht
- function fValueHC() {
- setInputNodeCurText();
- if (ipt_zhc.currentText == ""){
- cmb_hc.value = "90";
- } else if (ipt_zhc.currentText < 20){
- cmb_hc.value = "14";
- } else if (ipt_zhc.currentText >= 20 && ipt_zhc.currentText <= 29.9){
- cmb_hc.value = "12";
- } else if (ipt_zhc.currentText >= 30 && ipt_zhc.currentText <= 45.9){
- cmb_hc.value = "10";
- } else if (ipt_zhc.currentText >= 46 && ipt_zhc.currentText <= 49.9){
- cmb_hc.value = "21";
- } else if (ipt_zhc.currentText >= 50 && ipt_zhc.currentText <= 59.9){
- cmb_hc.value = "22";
- } else if (ipt_zhc.currentText >= 60){
- cmb_hc.value = "24";
- }
- fCalcHC();
- model.refresh();
- }
- function fCalcHC() {
- //99 opt_zhc.value = cmb_hc.value.substr(1,2);
- zhc = cmb_hc.value.substr(1,2);
- lbhc = cmb_hc.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
-
- //99 if(opt_zhc.value == ""){
- if(zhc == ""){
- model.setValue("/root/init/item/apchitemscore13", "0");
- model.setValue("/root/init/item/apchitemlabel13", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='13']/apchitemscore", opt_zhc.value);
- model.setValue("/root/init/item/apchitemscore13", zhc);
- model.setValue("/root/init/item/apchitemlabel13", lbhc);
- }
- model.refresh();
- }
- // 14. W.B.C
- function fValueGB() {
- setInputNodeCurText();
- if (ipt_zgb.currentText == ""){
- cmb_gb.value = "90";
- } else if (ipt_zgb.currentText < 1){
- cmb_gb.value = "14";
- } else if (ipt_zgb.currentText >= 1 && ipt_zgb.currentText <= 2.9){
- cmb_gb.value = "12";
- } else if (ipt_zgb.currentText >= 3 && ipt_zgb.currentText <= 14.9){
- cmb_gb.value = "10";
- } else if (ipt_zgb.currentText >= 15 && ipt_zgb.currentText <= 19.9){
- cmb_gb.value = "21";
- } else if (ipt_zgb.currentText >= 20 && ipt_zgb.currentText <= 39.9){
- cmb_gb.value = "22";
- } else if (ipt_zgb.currentText >= 40){
- cmb_gb.value = "24";
- }
- fCalcGB();
- model.refresh();
- }
- function fCalcGB() {
- //99 opt_zgb.value = cmb_gb.value.substr(1,2);
- zgb = cmb_gb.value.substr(1,2);
- lbgb = cmb_gb.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
-
- //99 if(opt_zgb.value == ""){
- if(zgb == ""){
- model.setValue("/root/init/item/apchitemscore14", "0");
- model.setValue("/root/init/item/apchitemlabel14", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='14']/apchitemscore", opt_zgb.value);
- model.setValue("/root/init/item/apchitemscore14", zgb);
- model.setValue("/root/init/item/apchitemlabel14", lbgb);
- }
- model.refresh();
- }
- // 15. Glasgow Coma Score
- function fValueGLAS() {
- //setInputNodeCurText();
- if (ipt_zglas.currentText == ""){
- cmb_glas.value = "90";
- } else if (ipt_zglas.currentText == 15){
- cmb_glas.value = "0";
- } else if (ipt_zglas.currentText == 14){
- cmb_glas.value = "1";
- } else if (ipt_zglas.currentText == 13){
- cmb_glas.value = "2";
- } else if (ipt_zglas.currentText == 12){
- cmb_glas.value = "3";
- } else if (ipt_zglas.currentText == 11){
- cmb_glas.value = "4";
- } else if (ipt_zglas.currentText == 10){
- cmb_glas.value = "5";
- } else if (ipt_zglas.currentText == 9){
- cmb_glas.value = "6";
- } else if (ipt_zglas.currentText == 8){
- cmb_glas.value = "7";
- } else if (ipt_zglas.currentText == 7){
- cmb_glas.value = "8";
- } else if (ipt_zglas.currentText == 6){
- cmb_glas.value = "9";
- } else if (ipt_zglas.currentText == 5){
- cmb_glas.value = "10";
- } else if (ipt_zglas.currentText == 4){
- cmb_glas.value = "11";
- } else if (ipt_zglas.currentText == 3){
- cmb_glas.value = "12";
- }
- fCalcGLAS();
- model.refresh();
- }
- function fCalcGLAS() {
- if (cmb_glas.value == 90) {
- //99 opt_zglas.value = cmb_glas.value.substr(1,2);
- zglas = cmb_glas.value.substr(1,2);
- } else {
- //99 opt_zglas.value = cmb_glas.value;
- zglas = cmb_glas.value;
- }
- lbglas = cmb_glas.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
-
- //99 if(opt_zglas.value == ""){
- if(zglas == ""){
- model.setValue("/root/init/item/apchitemscore15", "0");
- model.setValue("/root/init/item/apchitemlabel15", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='15']/apchitemscore", opt_zglas.value);
- model.setValue("/root/init/item/apchitemscore15", zglas);
- model.setValue("/root/init/item/apchitemlabel15", lbglas);
- }
- model.refresh();
- }
- // 16. Age
- function fValueAGE() {
- setInputNodeCurText();
- if (ipt_zage.currentText == ""){
- cmb_age.value = "90";
- } else if (ipt_zage.currentText <= 44){
- cmb_age.value = "10";
- } else if (ipt_zage.currentText >= 45 && ipt_zage.currentText <= 54){
- cmb_age.value = "12";
- } else if (ipt_zage.currentText >= 55 && ipt_zage.currentText <= 64){
- cmb_age.value = "13";
- } else if (ipt_zage.currentText >= 65 && ipt_zage.currentText <= 74){
- cmb_age.value = "15";
- } else if (ipt_zage.currentText >= 75){
- cmb_age.value = "16";
- }
- fCalcAGE();
- model.refresh();
- }
- function fCalcAGE() {
- //99 opt_zage.value = cmb_age.value.substr(1,2);
- zage = cmb_age.value.substr(1,2);
- lbage = cmb_age.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
-
- //99 if(opt_zage.value == ""){
- if(zage == ""){
- model.setValue("/root/init/item/apchitemscore16", "0");
- model.setValue("/root/init/item/apchitemlabel16", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='16']/apchitemscore", opt_zage.value);
- model.setValue("/root/init/item/apchitemscore16", zage);
- model.setValue("/root/init/item/apchitemlabel16", lbage);
- }
- model.refresh();
- }
- // 17. Chronic Organ Insufficiency immuno-compromised
- function fCalcMCRO() {
- //99 opt_zmcro.value = cmb_mcro.value.substr(1,2);
- zmcro = cmb_mcro.value.substr(1,2);
- lbmcro = cmb_mcro.label;
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
-
- //opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore") == ""){
- opt_zmorta.value = fCalcMort();
- }else{
- opt_zmorta.value = model.getValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore");
- }
-
- //99 if(opt_zmcro.value == ""){
- if(zmcro == ""){
- model.setValue("/root/init/item/apchitemscore17", "0");
- model.setValue("/root/init/item/apchitemlabel17", "");
- }else{
- //model.setValue("/root/main/apchitem/item[apchitemcd='17']/apchitemscore", opt_zmcro.value);
- model.setValue("/root/init/item/apchitemscore17", zmcro);
- model.setValue("/root/init/item/apchitemlabel17", lbmcro);
- }
- model.refresh();
- }
- function fCalcAPA() {
- var z = eval(opt_ztemp.value);
- z = z + eval(opt_zpam.value);
- z = z + eval(opt_zfc.value);
- z = z + eval(opt_zfr.value);
- z = z + eval(opt_zaa.value);
- z = z + eval(opt_zpao.value);
- z = z + eval(opt_zhco.value);
- z = z + eval(opt_zph.value);
- z = z + eval(opt_zna.value);
- z = z + eval(opt_zka.value);
- z = z + eval(opt_zuree.value);
- z = z + eval(opt_zurea.value);
- z = z + eval(opt_zhc.value);
- z = z + eval(opt_zgb.value);
- z = z + eval(opt_zage.value);
- z = z + eval(opt_zglas.value);
- z = z + eval(opt_zmcro.value);
- if (opt_zuree.value > 0 && opt_zurea.value > 0) {
- alert("Acute renal failure or not ?");
- }
- if (opt_zph.value > 0 && opt_zhco.value > 0) {
- alert(" Serum HCO3 : use only if no ABGs");
- }
- if (opt_zaa.value > 0 && opt_zpao.value > 0) {
- alert(" FIO2 > or< 0.5 ?");
- }
- model.setValue("/root/main/apchitem/item[apchitemcd='18']/apchitemscore", z);
- model.refresh();
- return ''+z;
-
-
- }
- function fCalcMort(){
- z = eval(opt_zapa.value);
- z = -3.517 + z * (0.146);
- z = Math.exp(z) / (1 + Math.exp(z));
- z = fFmt(100 * z);
-
- return z;
-
- model.setValue("/root/main/apchitem/item[apchitemcd='19']/apchitemscore", opt_zmort.value); // %
- model.refresh();
- }
- function fCalcMorta() {
- /*
- var z = 0;
- z = eval(model.getValue("/root/main/y") + "+z");
- z = Math.exp(z) / (1 + Math.exp(z));
- z = fFmt(100 * z);
- opt_zmorta.value = z;
- */
- var z = 0;
- t = eval(model.getValue("/root/main/y"));
- z = eval(model.getValue("/root/main/zapa"));
- b = -3.517 + z * (0.146);
- z = b + t;
- z = Math.exp(z) / (1 + Math.exp(z));
- z = fFmt(100 * z);
- opt_zmorta.value = z;
-
- return z;
- }
- function fFmt(x) {
- var v
- if(x >= 0) {
- v = '' + (x + 0.05)
- } else {
- v = '' + (x - 0.05)
- }
-
- return v.substring(0,v.indexOf('.')+2)
- }
- function fPrd(){
- var adjusted = model.getValue("/root/main/y");
- var content = model.getValue("/root/main/content");
- var pdr = model.getValue("/root/main/pdeathrate");
-
- opener.model.setValue("/root/main/apchitem/item[apchitemcd='20']/apchitemscore", adjusted);
- opener.model.setValue("/root/send/selectdata/adjustednm", content);
- opener.model.setValue("/root/main/apchitem/item[apchitemcd='21']/apchitemscore", pdr);
- opener.model.refresh();
- window.close();
- }
- function fGubun() {
- //var fio2 = model.getValue("/root/main/apchitem/item[apchitemcd='23']/apchitemvalue");
- var fio2 = cmb_fio2.value;
- var lbfio2 = cmb_fio2.label;
- model.setValue("/root/main/apchitem/item[apchitemcd='23']/apchitemlabel", lbfio2);
- if (fio2 == "0"){
- cmb_device.visible = false;
- cmb_nasal.visible = false;
- cmb_simple.visible = false;
- cpt_O2.visible = false;
- cpt_L.visible = false;
- model.setValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue", "21");
- model.refresh();
- var paco2 = model.getValue("/root/main/apchitem/item[apchitemcd='28']/apchitemvalue");
- if(paco2 != ""){
- fValue();
- model.setFocus("ipt_zpao");
- ipt_zpao.dispatch("onkeydown");
- fValuePAO();
- }else{
- model.setFocus("ipt_paco2");
- }
-
- }else if(fio2 == "1"){
- cmb_device.visible = true;
- cmb_nasal.visible = true;
- cmb_simple.visible = false;
- cpt_O2.visible = true;
- cpt_L.visible = true;
- model.setValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue", "");
- fDevice();
- fValue();
-
- }else if(fio2 == "2"){
- cmb_device.visible = false;
- cmb_nasal.visible = false;
- cmb_simple.visible = false;
- cpt_O2.visible = false;
- cpt_L.visible = false;
- model.setValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue", "");
- fDevice();
- //fValue();
- model.setFocus("ipt_fio2");
-
- }
- /*
- var fio2 = model.getValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue");
- var paco2 = model.getValue("/root/main/apchitem/item[apchitemcd='28']/apchitemvalue");
- var pao2 = model.getValue("/root/main/apchitem/item[apchitemcd='29']/apchitemvalue");
-
- var aao2value = (760-47) * fio2 * 0.01 - paco2 - pao2;
- model.setValue("/root/main/apchitem/item[apchitemcd='27']/apchitemvalue", aao2value);
- */
- model.refresh();
- //fValue();
- }
- function fDevice() {
- var device = model.getValue("/root/main/apchitem/item[apchitemcd='24']/apchitemvalue");
- var lbdevice = cmb_device.label;
- model.setValue("/root/main/apchitem/item[apchitemcd='24']/apchitemlabel", lbdevice);
- model.setValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue","");
- if (device == "0"){ //Nasal cauuula
- cpt_L.visible = true;
- cmb_nasal.visible = true;
- cmb_simple.visible = false;
- }else if(device == "1"){ //Simple face mask
- cpt_L.visible = true;
- cmb_nasal.visible = false;
- cmb_simple.visible = true;
- }else if(device =="2"){ //Ventilator
- cpt_L.visible = false;
- cmb_nasal.visible = false;
- cmb_simple.visible = false;
-
- model.setFocus("ipt_fio2");
- //model.setValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue", "");
- }else{
- cpt_L.visible = false;
- cmb_nasal.visible = false;
- cmb_simple.visible = false;
- }
- model.refresh();
- }
- function fNasal() {
- var napro = model.getValue("/root/main/apchitem/item[apchitemcd='25']/apchitemvalue");
- model.setValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue", napro);
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue") >= 50){
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemvalue", model.getValue("/root/main/apchitem/item[apchitemcd='27']/apchitemvalue"));
- model.setFocus("ipt_zaa");
- ipt_zaa.dispatch("onkeydown");
- fValueAA();
- }else if (model.getValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue") < 50){
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemvalue", model.getValue("/root/main/apchitem/item[apchitemcd='29']/apchitemvalue"));
- model.setFocus("ipt_zpao");
- ipt_zpao.dispatch("onkeydown");
- fValuePAO();
- }else if (model.getValue("/root/main/apchitem/item[apchitemcd='28']/apchitemvalue") == "" && model.getValue("/root/main/apchitem/item[apchitemcd='29']/apchitemvalue") == ""){
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemvalue", model.getValue("/root/main/apchitem/item[apchitemcd='30']/apchitemvalue"));
- model.setFocus("ipt_zhco");
- ipt_zhco.dispatch("onkeydown");
- fValueHCO();
- }
-
- model.refresh();
-
- }
- function fSimple() {
- var simpro = model.getValue("/root/main/apchitem/item[apchitemcd='25']/apchitemvalue");
-
- model.setValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue", simpro);
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue") >= 50){
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemvalue", model.getValue("/root/main/apchitem/item[apchitemcd='27']/apchitemvalue"));
- fCalcAao2();
- fValue();
- model.setFocus("ipt_zaa");
- ipt_zaa.dispatch("onkeydown");
- fValueAA();
- }else if (model.getValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue") < 50){
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemvalue", model.getValue("/root/main/apchitem/item[apchitemcd='29']/apchitemvalue"));
- fCalcAao2();
- fValue();
- model.setFocus("ipt_zpao");
- ipt_zpao.dispatch("onkeydown");
- fValuePAO();
- }else if (model.getValue("/root/main/apchitem/item[apchitemcd='28']/apchitemvalue") == "" && model.getValue("/root/main/apchitem/item[apchitemcd='29']/apchitemvalue") == ""){
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemvalue", model.getValue("/root/main/apchitem/item[apchitemcd='30']/apchitemvalue"));
- fCalcAao2();
- fValue();
- model.setFocus("ipt_zhco");
- ipt_zhco.dispatch("onkeydown");
- fValueHCO();
- }
-
- model.refresh();
- }
- function fCalcAao2() {
-
-
- //var fio2 = model.getValue("/root/main/apchbun/apchfio2per");
- //var paco2 = model.getValue("/root/main/apchbun/apchpaco2");
- //var pao2 = model.getValue("/root/main/apchbun/apchpao2");
- var fio2 = model.getValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue");
- var paco2 = model.getValue("/root/main/apchitem/item[apchitemcd='28']/apchitemvalue");
- var pao2 = model.getValue("/root/main/apchitem/item[apchitemcd='29']/apchitemvalue");
-
- var aao2value = (760-47) * fio2 * 0.01 - paco2 - pao2;
- model.setValue("/root/main/apchitem/item[apchitemcd='27']/apchitemvalue", aao2value);
- model.refresh();
- }
- function fValue() {
- var apchitemdt = getCurrentDate() + getCurrentTime();
-
- //If FiO2>=0.5 : (A-a)O2
- if(model.getValue("/root/main/apchitem/item[apchitemcd='27']/apchitemvalue") != "" && model.getValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue") >= 50){
- if(model.getValue("/root/main/apchitem/item[apchitemcd='06']/apchitemvalue") != ""){
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemvalue", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemval", "");
- }
- if(model.getValue("/root/main/apchitem/item[apchitemcd='07']/apchitemvalue") != ""){
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemvalue", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemval", "");
- }
-
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemvalue", model.getValue("/root/main/apchitem/item[apchitemcd='27']/apchitemvalue"));
- model.refresh();
-
- //If FiO2<0.5 : PaO2
- }else if (model.getValue("/root/main/apchitem/item[apchitemcd='28']/apchitemvalue") != "" && model.getValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue") < 50){
- if(model.getValue("/root/main/apchitem/item[apchitemcd='05']/apchitemvalue") != ""){
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemvalue", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemval", "");
- }
- if(model.getValue("/root/main/apchitem/item[apchitemcd='07']/apchitemvalue") != ""){
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemvalue", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemval", "");
- }
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemvalue", model.getValue("/root/main/apchitem/item[apchitemcd='29']/apchitemvalue"));
- model.refresh();
-
- //If no A.B Gs : Serum HCO3-
- }else if (model.getValue("/root/main/apchitem/item[apchitemcd='28']/apchitemvalue") == "" && model.getValue("/root/main/apchitem/item[apchitemcd='29']/apchitemvalue") == ""){
- //setInputNodeCurText();
- if(model.getValue("/root/main/apchitem/item[apchitemcd='05']/apchitemvalue") != ""){
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemvalue", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemval", "");
- }
- if(model.getValue("/root/main/apchitem/item[apchitemcd='06']/apchitemvalue") != ""){
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemvalue", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemval", "");
- }
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemvalue", model.getValue("/root/main/apchitem/item[apchitemcd='30']/apchitemvalue"));
- model.refresh();
- }
-
- model.refresh();
- }
- function fValue_Back() {
- var apchitemdt = getCurrentDate() + getCurrentTime();
-
- //If FiO2>=0.5 : (A-a)O2
- //if(model.getValue("/root/main/apchbun/apchpaco2") != "" && model.getValue("/root/main/apchbun/apchfio2per") >= 0.5){
- if(model.getValue("/root/main/apchitem/item[apchitemcd='27']/apchitemvalue") != "" && model.getValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue") >= 50){
- if(model.getValue("/root/main/apchitem/item[apchitemcd='06']/apchitemvalue") != ""){
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemvalue", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemval", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemscore", "0");
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemdt", "");
- }
- if(model.getValue("/root/main/apchitem/item[apchitemcd='07']/apchitemvalue") != ""){
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemvalue", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemval", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemscore", "0");
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemdt", "");
- }
- //var aao2 = model.getValue("/root/main/apchbun/apchaao2");
- //ipt_zaa.currentText = aao2;
- //model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemvalue", model.getValue("/root/main/apchbun/apchaao2"));
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemvalue", model.getValue("/root/main/apchitem/item[apchitemcd='27']/apchitemvalue"));
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemscore", "0");
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemdt", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemscore", "0");
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemdt", "");
- model.refresh();
- //If FiO2<0.5 : PaO2
- //}else if (model.getValue("/root/main/apchbun/apchpaco2") != "" && model.getValue("/root/main/apchbun/apchfio2per") < 0.5){
- }else if (model.getValue("/root/main/apchitem/item[apchitemcd='28']/apchitemvalue") != "" && model.getValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue") < 50){
- if(model.getValue("/root/main/apchitem/item[apchitemcd='05']/apchitemvalue") != ""){
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemvalue", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemval", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemscore", "0");
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemdt", "");
- }
- if(model.getValue("/root/main/apchitem/item[apchitemcd='07']/apchitemvalue") != ""){
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemvalue", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemval", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemscore", "0");
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemdt", "");
- }
- //model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemvalue", model.getValue("/root/main/apchbun/apchpao2"));
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemvalue", model.getValue("/root/main/apchitem/item[apchitemcd='29']/apchitemvalue"));
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemscore", "0");
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemdt", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemscore", "0");
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemdt", "");
- model.refresh();
- //If no A.B Gs : Serum HCO3-
- //}else if (model.getValue("/root/main/apchbun/apchpaco2") == "" && model.getValue("/root/main/apchbun/apchpao2") == ""){
- }else if (model.getValue("/root/main/apchitem/item[apchitemcd='28']/apchitemvalue") == "" && model.getValue("/root/main/apchitem/item[apchitemcd='29']/apchitemvalue") == ""){
- setInputNodeCurText();
- if(model.getValue("/root/main/apchitem/item[apchitemcd='05']/apchitemvalue") != ""){
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemvalue", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemval", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemscore", "0");
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemdt", "");
- }
- if(model.getValue("/root/main/apchitem/item[apchitemcd='06']/apchitemvalue") != ""){
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemvalue", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemval", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemscore", "0");
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemdt", "");
- }
- //model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemvalue", model.getValue("/root/main/apchbun/apchhco3"));
- model.setValue("/root/main/apchitem/item[apchitemcd='07']/apchitemvalue", model.getValue("/root/main/apchitem/item[apchitemcd='30']/apchitemvalue"));
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemscore", "0");
- model.setValue("/root/main/apchitem/item[apchitemcd='05']/apchitemdt", "");
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemscore", "0");
- model.setValue("/root/main/apchitem/item[apchitemcd='06']/apchitemdt", "");
- model.refresh();
- }
- model.refresh();
- }
- function fView() {
- var fio2 = model.getValue("/root/main/apchitem/item[apchitemcd='23']/apchitemvalue");
- var lbfio2 = cmb_fio2.label;
- model.setValue("/root/main/apchitem/item[apchitemcd='23']/apchitemlabel", lbfio2);
- if (fio2 == "0"){
- cpt_O2.visible = false;
- cpt_L.visible = false;
- cmb_device.visible = false;
- cmb_nasal.visible = false;
- cmb_simple.visible = false;
-
- //model.setValue("/root/main/apchbun/apchfio2per", "0.21");
- model.setValue("/root/main/apchitem/item[apchitemcd='26']/apchitemvalue", "21");
- }else if(fio2 == "1"){
- cpt_O2.visible = true;
- cpt_L.visible = true;
- cmb_device.visible = true;
- fDevice();
- }else if(fio2 == "2"){
- cpt_O2.visible = false;
- cpt_L.visible = false;
- cmb_device.visible = false;
- fDevice();
- }
-
- submit("TRMMR03212");
-
- model.setValue("/root/init/item/apchitemlabel1", cmb_temp.label);
- model.setValue("/root/init/item/apchitemlabel2", cmb_zpam.label);
- model.setValue("/root/init/item/apchitemlabel3", cmb_zfc.label);
- model.setValue("/root/init/item/apchitemlabel4", cmb_zfr.label);
- model.setValue("/root/init/item/apchitemlabel5", cmb_zaa.label);
- model.setValue("/root/init/item/apchitemlabel6", cmb_pao.label);
- model.setValue("/root/init/item/apchitemlabel7", cmb_hco.label);
- model.setValue("/root/init/item/apchitemlabel8", cmb_ph.label);
- model.setValue("/root/init/item/apchitemlabel9", cmb_na.label);
- model.setValue("/root/init/item/apchitemlabel10", cmb_ka.label);
- model.setValue("/root/init/item/apchitemlabel11", cmb_uree.label);
- model.setValue("/root/init/item/apchitemlabel12", cmb_urea.label);
- model.setValue("/root/init/item/apchitemlabel13", cmb_hc.label);
- model.setValue("/root/init/item/apchitemlabel14", cmb_gb.label);
- model.setValue("/root/init/item/apchitemlabel15", cmb_glas.label);
- model.setValue("/root/init/item/apchitemlabel16", cmb_age.label);
- model.setValue("/root/init/item/apchitemlabel17", cmb_mcro.label);
-
- for (var i = 1; i < 18; i++){
- model.setValue("/root/main/apchitem/item[" + i + "]/apchitemlabel", model.getValue("/root/init/item/apchitemlabel" + i));
- }
-
- /*
- var ref = "/root/main/apchitem/item";
- var dataCnt = getNodesetCnt(model, ref);
- for (var i = 1; i < 18; i++){
- if((model.getValue("/root/main/apchitem/item[" + i + "]/apchitemvalue") == "") && (i != 17)){
- model.setValue("/root/main/apchitem/item[" + i + "]/apchitemscore", "0");
- }else if(model.getValue("/root/init/item/apchitemscore" + i) != ""){
- model.setValue("/root/main/apchitem/item[" + i + "]/apchitemscore", model.getValue("/root/init/item/apchitemscore" + i));
- }
- model.setValue("/root/main/apchitem/item[" + i + "]/apchitemlabel", model.getValue("/root/init/item/apchitemlabel" + i));
- }
- */
- //나이
- var age = model.getValue("/root/temp/apchpidlist/item/age");
- if(model.getValue("/root/main/apchitem/item[apchitemcd='16']/apchitemvalue") == ""){
- ipt_zage.value = age;
- }else{
- ipt_zage.value = model.getValue("/root/main/apchitem/item[apchitemcd='16']/apchitemvalue");
- }
- //기록정보 유형
- if(model.getValue("/root/temp/apchpidlist/item/ordinfo") == ""){
- if(model.getValue("/root/send/selectdata/apchdd") == model.getValue("/root/send/selectdata/fromdd")){
- rdo_ordinfo.value = "1";
- }
- }else{
- rdo_ordinfo.value = model.getValue("/root/temp/apchpidlist/item/ordinfo");
- }
-
- //Adjusted 명칭
- if(model.getValue("/root/temp/apchpidlist/item/adjustednm") != ""){
- opt_content.value = model.getValue("/root/temp/apchpidlist/item/adjustednm");
- }
-
- //인증저장정보
- model.setValue("/root/send/selectdata/lastespiyn", model.getValue("/root/temp/apchpidlist/item/lastespiyn"));
- //signno
- model.setValue("/root/send/selectdata/signno", model.getValue("/root/temp/apchpidlist/item/signno"));
- //최초작성자
- model.setValue("/root/send/selectdata/fstrgstrid", model.getValue("/root/temp/apchpidlist/item/fstrgstrid"));
- model.setValue("/root/send/selectdata/fstrgstdt", model.getValue("/root/temp/apchpidlist/item/fstrgstdt"));
- //최종작성자
- model.setValue("/root/send/selectdata/lastupdtrid", model.getValue("/root/temp/apchpidlist/item/lastupdtrid"));
- model.setValue("/root/send/selectdata/lastupdtdt", model.getValue("/root/temp/apchpidlist/item/lastupdtdt"));
-
- model.refresh();
- }
- // 계산 버튼
- function fCalc() {
- var ref = "/root/main/apchitem/item";
- var dataCnt = getNodesetCnt(model, ref);
- var apchitemdt = getCurrentDate() + getCurrentTime();
- //for (var i = 1; i < dataCnt; i++){
- for (var i = 1; i < 18; i++){
- if((model.getValue("/root/main/apchitem/item[" + i + "]/apchitemvalue") == "") && (i != 17)){
- model.setValue("/root/main/apchitem/item[" + i + "]/apchitemscore", "0");
- }else if(model.getValue("/root/init/item/apchitemscore" + i) != ""){
- model.setValue("/root/main/apchitem/item[" + i + "]/apchitemscore", model.getValue("/root/init/item/apchitemscore" + i));
- }
- model.setValue("/root/main/apchitem/item[" + i + "]/apchitemlabel", model.getValue("/root/init/item/apchitemlabel" + i));
- //if((model.getValue("/root/main/apchitem/item[" + i + "]/apchitemdt") == "") && (i != 5) && (i != 6) && (i != 7)){
- if(((model.getValue("/root/main/apchitem/item[" + i + "]/apchitemdt") == "") &&
- (model.getValue("/root/main/apchitem/item[" + i + "]/apchitemvalue") == ""))||
- ((model.getValue("/root/main/apchitem/item[" + i + "]/apchitemdt") == "") &&
- (model.getValue("/root/main/apchitem/item[" + i + "]/apchitemvalue") != ""))){
- model.setValue("/root/main/apchitem/item[" + i + "]/apchitemdt", apchitemdt);
- }
- if(i == 16){
- model.setValue("/root/main/apchitem/item[" + i + "]/apchitemdt", apchitemdt);
- }
- }
-
- opt_zapa.value = fCalcAPA();
- opt_zmort.value = fCalcMort();
- opt_zmorta.value = fCalcMorta();
-
- if(model.getValue("/root/main/apchitem/item[apchitemcd='19']/apchitemscore") == "N"){
- //opt_zmorta.value = fCalcMort();
- fCalcMort();
- fCalcMorta();
- }
- model.refresh();
- }
- /**
- * @ver : 2009.08.10.
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 아파치 기록정보 인증저장
- * @param : pFlag : TempSave : 임시저장, CertSave : 인증저장
- * @return :
- * @---------------------------------------------------
- */
- function fGetApchRecCert(){
- model.removeNode("/root/main/signSaveData");
- model.makeNode("/root/main/signSaveData");
- //copyNodeset("/root/main/signSaveData/apchinfo", "/root/main/apchitem", "", model, model);
- copyNodeset("/root/main/signSaveData/apchinfo", "/root/main/apchresult", "", model, model);
- //var dataCnt = getNodesetCnt(model, "/root/main/apchitem/item");
- var dataCnt = getNodesetCnt(model, "/root/main/apchresult/item");
- for (var i=1 ; i <= dataCnt ; i++) {
- /*
- var apchitemnm = model.getValue("/root/main/apchitem/item["+ i +"]/apchitemnm");
- var apchitemvalue = model.getValue("/root/main/apchitem/item["+ i +"]/apchitemvalue");
- var apchitemlabel = model.getValue("/root/main/apchitem/item["+ i +"]/apchitemlabel");
- //var apchitemlabel = model.getValue("/root/init/item/apchitemlabel["+ i +"]");
- alert("apchitemlabel : " + apchitemlabel);
- var apchitemval = model.getValue("/root/main/apchitem/item["+ i +"]/apchitemval");
- var apchitemscore = model.getValue("/root/main/apchitem/item["+ i +"]/apchitemscore");
- var apchitemdt = model.getValue("/root/main/apchitem/item["+ i +"]/apchitemdt");
- */
- var apchitemnm = model.getValue("/root/main/apchresult/item["+ i +"]/apchitemnm");
- var apchitemvalue = model.getValue("/root/main/apchresult/item["+ i +"]/apchitemvalue");
- var apchitemlabel = model.getValue("/root/main/apchresult/item["+ i +"]/apchitemlabel");
- //var apchitemlabel = model.getValue("/root/init/item/apchitemlabel["+ i +"]");
- var apchitemval = model.getValue("/root/main/apchresult/item["+ i +"]/apchitemval");
- var apchitemscore = model.getValue("/root/main/apchresult/item["+ i +"]/apchitemscore");
- var apchitemdt = model.getValue("/root/main/apchresult/item["+ i +"]/apchitemdt");
-
- model.makeValue("/root/main/signSaveData/apchinfo/item["+ i +"]/apchitemnm", apchitemnm);
- model.makeValue("/root/main/signSaveData/apchinfo/item["+ i +"]/apchitemvalue", apchitemvalue);
- model.makeValue("/root/main/signSaveData/apchinfo/item["+ i +"]/apchitemlabel", apchitemlabel);
- model.makeValue("/root/main/signSaveData/apchinfo/item["+ i +"]/apchitemval", apchitemval);
- model.makeValue("/root/main/signSaveData/apchinfo/item["+ i +"]/apchitemscore", apchitemscore);
- model.makeValue("/root/main/signSaveData/apchinfo/item["+ i +"]/apchitemdt", apchitemdt);
- }
-
- copyNodeset("/root/main/signSaveData/espidata", "/root/send/selectdata" , "", model, model);
-
- //인증저장
- if (!fSign()) return;
-
- if(submit("TXMMR03212")){
- model.removenodeset("/root/main/signSaveData");
- //alert("기록지가 저장되었습니다.");
- } else {
- alert("기록지가 저장되지 않았습니다.");
- }
- }
- /**
- * @group :
- * @ver : 2009.08.10.
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 인증로직
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSign(){
- //var node = getGlobalVariable("paminfo");
- //model.removeNodeset("/root/main/paminfo/list");
- //setCSVToNode("/root/main/paminfo", node);
- sPid = model.getValue("/root/send/selectdata/pid"); // 환자번호
- sOrddd = model.getValue("/root/send/selectdata/orddd"); // 입원일자
- sCretNo = model.getValue("/root/send/selectdata/cretno"); // 환자 일자별 일련번호
- sApchdd = model.getValue("/root/send/selectdata/apchdd"); // 환자 일자별 일련번호
- submit("TRMMR03215");
-
- sFormcd = model.getValue("/root/temp/cd/formcd"); //서식코드
- Sign.certreload = true ; // 전자서명 호출시 인증저장 버튼을 누늘때마다 인증서가 뜨도록 처리
-
- if(Sign.signprocess() == true){
- // 전자인증 관련 환자 인적 정보를 보내줌.
- model.makeValue("/root/send/signdata/pid", sPid );//등록번호
- model.makeValue("/root/send/signdata/orddd", sOrddd);//입원일자(입원,응급)/진료일자(외래)
- model.makeValue("/root/send/signdata/signno", ""); //서명번호
- model.makeValue("/root/send/signdata/cretno", sCretNo); //일련번호
-
- model.makeValue("/root/send/signdata/recdd", sApchdd);// 실제 기록이 이루어진 기록일자
- model.makeValue("/root/send/signdata/rectm", getCurrentTime());//실제 기록이 이루어진 기록시간
- model.makeValue("/root/send/signdata/recsaveflag" , "Y"); //전자서명 인적정보 변경여부(기록일시 변경되는 경우 : Y, 그외 : N)
- model.makeValue("/root/send/signdata/signflag" , "01" ); //서명자료구분 (01 : 진료, 02 : 간호, 03 : LIS, 04 : 진료지원)
- model.makeValue("/root/send/signdata/signgenrflag", "I"); //외래/입원구분(코드정의서 M0010 참조)
-
- //model.makeValue("/root/send/signdata/formcd" , "0900006103"); //아파치기록지 서식코드
- model.makeValue("/root/send/signdata/formcd" , sFormcd); //아파치기록지 서식코드
- model.makeValue("/root/send/signdata/orddeptcd" , getUserInfo("dutplcecd")); //진료부서코드
- model.makeValue("/root/send/signdata/orddrid" , getUserInfo("userid")); //진료의사ID
- model.makeValue("/root/send/signdata/dispyn" , "Y"); //기록뷰어에는 조회안되도록
- // 인증할 데이터 정보(미기록 노드 제거된 정보)
- // 미기록 노드 제거전 원본 노드 정보 : Sign.signedInfos[3]
- model.makeValue("/root/send/signdata/signbfcnts" , Sign.signedInfos[1]);
- // 공인인증 처리후 데이터
- model.makeValue("/root/send/signdata/signaftcnts" , Sign.signedInfos[2]);
- }else{
- return false;
- }
- model.makeValue("/root/send/signdata/screenid", getScreenID());
- return true;
- }
- /**
- * @group :
- * @ver : 2009.08.10
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 인증데이터 생성함수
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fMake_SignData(){
- Sign.addnode("/root/main/signSaveData");
- }
|