⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 common.htc

📁 HTC,demo WEB用于。 超大型
💻 HTC
📖 第 1 页 / 共 4 页
字号:
      else return null;
    }
	

	  function freeMsgBody(objMsgBody){
	    var n = objMsgBody.ChildMsgBodysCount;
  	  
	    for(var i = 0; i < n; i++){
	      freeMsgBody(objMsgBody.ChildMsgBodys[i]);
	    }
  	  
	    objMsgBody.parseState = "free";	
      objMsgBody.init = "1";
	  }
	
	  function setGlobCommInst(objFrameWin){
  
        if(objFrameWin.frames.length>0){
          for(var i = 0; i < objFrameWin.frames.length; i++){
            setGlobCommInst(objFrameWin.frames(i)); 
          }
        }else{          
          objFrameWin.__objGlobalCommonInst = element;
        }  
    }
    
    function RefreshDictionary(){      
      arrDictionary.RemoveAll();      
      InitDicList();
    }
    
    function InitDicList(){//字典初始化
    
        var objDicList;
        var objDicItem;
        var objNodeList;          
        var strDicName;
        
        //diclist.xml
        //<root>
        //  <r DicName="性别字典" XMLFileName="BTDicSex.xml"/>
        //  <r DicName="学历字典" XMLFileName="BTDicEducationLife.xml"/>
        //  <r DicName="医疗专业类别字典" XMLFileName="BTDicMedicalspecialty.xml"/>
        //</root>          
        objDicList = inputXML("http://192.168.1.55:7001/dhrm/dics/diclist.xml");
        if(!objDicList){
          window.status = "无法连接服务器,字典初始化失败,请联系系统管理员...";
          return(-1);
        } 
        
        objNodeList = objDicList.selectNodes("/*/r");
        
        for(var i = 0; i < objNodeList.length; i++){//字典初始化                    
            strDicName = objNodeList(i).getAttribute("DicName");
            objDicItem = inputXML("http://192.168.1.55:7001/dhrm/dics/" + objNodeList(i).getAttribute("XMLFileName"));            
            arrDictionary.Add(strDicName, objDicItem);
        }//End of for 
        
        //以下为checkXML

        /*<XML ID="DServeState" desc="设备可用状态">
              <r value="U" text="在用"/><r value="S" text="停用"/><r value="E" text="检修"/>
          </XML>*/
        arrDictionary.Add("设备可用状态", inputXML('<root><r value="U" text="在用"/><r value="S" text="停用"/><r value="E" text="检修"/></root>'));
        
         /*<XML ID="DServeState" desc="用户状态">
              <r value="U" text="在用"/><r value="S" text="停用"/>
          </XML>*/
        arrDictionary.Add("用户状态", inputXML('<root><r value="U" text="在用"/><r value="S" text="停用"/></root>'));

        /*<XML ID="PServeState" desc="人员状态">
              <r value="U" text="在职可用"/><r value="R" text="退休"/><r value="S" text="调离"/>
          </XML>*/
        arrDictionary.Add("人员可用状态", inputXML('<root><r value="U" text="在职可用"/><r value="R" text="退休"/><r value="S" text="调离"/></root>'));

        /*<XML ID="ManagementCode" desc="机构分类管理代码">
              <r value="Y" text="营利"/><r value="N" text="非营利"/>
          </XML>*/
        arrDictionary.Add("机构分类管理代码",inputXML('<root><r value="Y" text="营利"/><r value="N" text="非营利"/></root>'));
        
        /*<XML ID="InOutFlag" desc="入出转标志">
              <r value="I" text="入院"/><r value="O" text="出院"/><r value="T" text="转科"/>
          </XML>*/
        arrDictionary.Add("入出转标志",inputXML('<root><r value="I" text="入院"/><r value="O" text="出院"/><r value="T" text="转科"/></root>'));
        
        /*<XML ID="IfImport" desc="是否进口">
              <r value="0" text="进口"/><r value="1" text="非进口"/>
          </XML>*/
        arrDictionary.Add("是否进口",inputXML('<root><r value="0" text="进口"/><r value="1" text="非进口"/></root>'));

        /*<XML ID="IfNew" desc="是否新设备">
              <r value="0" text="新设备"/><r value="1" text="旧设备"/>
          </XML>*/
        arrDictionary.Add("是否新设备",inputXML('<root><r value="0" text="新设备"/><r value="1" text="旧设备"/></root>'));
         arrDictionary.Add("慢病字典", transformXMLToNode(arrDictionary.Item("ICD10字典"), "<?xml version='1.0' encoding='UTF-8'?><xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:fo='http://www.w3.org/1999/XSL/Format'><xsl:template match='//root'><xsl:copy><xsl:apply-templates select='r'/></xsl:copy></xsl:template><xsl:template match='r[@C != \"N\"]'><xsl:copy-of select='.'/></xsl:template></xsl:stylesheet>"));

        arrDictionary.Add("传染病字典", transformXMLToNode(arrDictionary.Item("ICD10字典"), "<?xml version='1.0' encoding='UTF-8'?><xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:fo='http://www.w3.org/1999/XSL/Format'><xsl:template match='//root'><xsl:copy><xsl:apply-templates select='r'/></xsl:copy></xsl:template><xsl:template match='r[@I != \"N\"]'><xsl:copy-of select='.'/></xsl:template></xsl:stylesheet>"));
         /*<XML ID="ServeState" desc="帐户可用状态">
        <r value='Y' txt="可用"/><r value='N' txt='不可用'/>
        </XML>*/
        arrDictionary.Add("帐户可用状态",inputXML("<root><r value='Y' text='可用'/><r value='N' text='不可用'/></root>"));
        
        /*<XML ID="IfHerbal" desc="是否是中药">
        <r value='Y' txt="可用"/><r value='N' txt='不可用'/>
        </XML>*/
        arrDictionary.Add("是否是中药",inputXML("<root><r value='Y' text='中药'/><r value='N' text='西药'/></root>"));

        /*<XML ID="AccidentLevel" desc="公共卫生事件级别">
        <r value='0' txt="一般"/><r value='1' txt='严重'/><r value='2' txt='重大'/>
        </XML>*/
        arrDictionary.Add("公共卫生事件级别",inputXML("<root><r value='0' text='0级'/><r value='1' text='1级'/><r value='2' text='2级'/></root>"));
        
        
        /*<XML ID="TransfusionFeedback" desc="输血反应">
              <r value="N" text="无"/><r value="Y" text="有"/>
          </XML>*/
        arrDictionary.Add("输血反应",inputXML('<root><r value="N" text="无"/><r value="Y" text="有"/></root>'));

        /*<XML ID="ReceiveState" desc="公文接收状态">
              <r value="0" text="待接收"/><r value="1" text="已接收"/>
          </XML>*/
        arrDictionary.Add("公文接收状态",inputXML('<root><r value="0" text="待接收"/><r value="1" text="已接收"/></root>'));

        /*<XML ID="DocLevel" desc="公文级别">
            <r value="0" text="低"/>
            <r value="1" text="普通"/>
            <r value="2" text="高"/>
          </XML>*/
        arrDictionary.Add("公文级别",inputXML('<root><r value="0" text="低"/><r value="1" text="普通"/><r value="2" text="高"/></root>'));
        

        /*<XML ID="WoundCloseDegree" desc="切口愈合等级">
              <r value="1" text="一级"/><r value="2" text="二级"/><r value="3" text="三级"/><r value="4" text="四级"/><r value="5" text="五级"/>
          </XML>*/
        arrDictionary.Add("切口愈合等级",inputXML('<root><r value="1" text="一级"/><r value="2" text="二级"/><r value="3" text="三级"/><r value="4" text="四级"/><r value="5" text="五级"/></root>'));
        
         /*<XML ID="ChronicDiseaseReportState" desc="慢病报告卡状态">
                <r value="2" text="确诊"/><r value="4" text="死亡"/><r value="5" text="排除"/><r value="6" text="作废"/>
          </XML>*/
        arrDictionary.Add("慢病报告卡状态",inputXML('<root><r value="2" text="确诊"/><r value="4" text="死亡"/><r value="5" text="排除"/><r value="6" text="作废"/></root>'));

        /*<XML ID="InfectionReportState" desc="传染病报告卡状态">
                <r value="1" text="疑似"/><r value="2" text="确诊"/><r value="3" text="治愈"/><r value="4" text="死亡"/><r value="5" text="排除"/><r value="6" text="作废"/>
          </XML>*/
        arrDictionary.Add("传染病报告卡状态",inputXML('<root><r value="1" text="疑似"/><r value="2" text="确诊"/><r value="3" text="治愈"/><r value="4" text="死亡"/><r value="5" text="排除"/><r value="6" text="作废"/></root>'));


        /*<XML ID="InoculationHistory" desc="预防接种史">
                <r value="1" text="已种"/><r value="2" text="未种"/>
          </XML>*/
        arrDictionary.Add("预防接种史",inputXML('<root><r value="1" text="已种"/><r value="2" text="未种"/></root>'));

        /*<XML ID="ReceiveMan" desc="接生人">
                <r value="1" text="有"/><r value="2" text="没有"/>
          </XML>*/
        arrDictionary.Add("接生人",inputXML('<root><r value="1" text="有"/><r value="2" text="没有"/></root>'));

        /*<XML ID="InoculationHistory" desc="传染病类别">
                <r value="1" text="甲类"/><r value="2" text="乙类"/><r value="3" text="丙类"/>
          </XML>*/
        arrDictionary.Add("传染病类别",inputXML('<root><r value="4" text="按甲类处理"/><r value="1" text="甲类"/><r value="2" text="乙类"/><r value="3" text="丙类"/></root>'));        
        /*
          <XML ID="IfRelease" desc="上报状态">
            <r value="0" text="未上报"/><r value="1" text="已上报"/>
          </XML>
        */       
       arrDictionary.Add("上报状态",inputXML('<root><r value="0" text="未上报"/><r value="1" text="已上报"/><r value="3" text="作废"/></root>'));
       arrDictionary.Add("上报年份",inputXML('<root><r value="1998" text="1998"/><r value="1999" text="1999"/><r value="2000" text="2000"/><r value="2001" text="2001"/><r value="2002" text="2002"/><r value="2003" text="2003"/><r value="2004" text="2004"/><r value="2005" text="2005"/><r value="2006" text="2006"/><r value="2007" text="2007"/><r value="2008" text="2008"/><r value="2009" text="2009"/><r value="2010" text="2010"/></root>'));
  }

  function getDictionary(strDicName){//返回各种字典
 
    if(arrDictionary.Exists(strDicName)){
      return(arrDictionary.Item(strDicName));
    }
  }
  
  
  function login(strUName, strUPassword){//登录,并获得一些全局变量,将它们添加到动态属性数组中
                                         //其中UIDofSession是最重要的,用于以后的发送过程中每次携带
    var objFragement;
    var objNode;

    objXMLDoc.loadXML("<root UIDofSession='0' TimeStmp='' Tran='0'><MsgBody target='用户' action='登录' UIDofMesg='' Priority='0' Syn='0'><Parameters><Parameter Name='UName' Val='" + strUName + "' /><Parameter Name='UPassword' Val='" + strUPassword + "'/></Parameters></MsgBody></root>");
    objXMLHttp.send(objXMLDoc);        
    objFragement = inputXML(objXMLHttp.responseText);//得到返回,并装配为XMLFragement
    
    objNode = objFragement.selectSingleNode("//r");
    arrProperty["DEPTCODE"] = objFragement.childNodes(0).getAttribute("DEPTCODE");
    
    strUIDofSession = objFragement.childNodes(0).getAttribute("UIDOFSESSION");
    arrProperty["UIDOFSESSION"] = strUIDofSession;
    arrProperty["MEDICALINSTITUTION"] = objFragement.childNodes(0).getAttribute("MEDICALINSTITUTION");   
    arrProperty["IDOFMEDICALINSTITUTION"] = objFragement.childNodes(0).getAttribute("IDOFMEDICALINSTITUTION");   
    
    arrProperty["IDOFUSERBASE"] = objNode.getAttribute("IDOFUSERBASE");
    arrProperty["SERVESTATE"] = objNode.getAttribute("SERVESTATE");
    
    funInitSectionList();
    funInitMedicalManList();
    funInitRegionalismList();
  }
  
  function funInitSectionList(){
    objXMLHttp.Open("POST",proxyLocation,false);  
    objXMLDoc.loadXML("<?xml version='1.0' encoding='GBK'?><root UIDofSession='" + arrProperty["UIDOFSESSION"] + "' TimeStmp='' Tran='0'><MsgBody target='科室资源' action='列出全部科室名称' UIDofMesg='' Priority='0' Syn='0'/></root>");
    objXMLHttp.send(objXMLDoc); 
    objSectionListXML = transformXML(objXMLHttp.responseText, "<?xml version='1.0' encoding='GBK'?><xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:fo='http://www.w3.org/1999/XSL/Format'><xsl:template match='/'>	<xsl:element name='root'><xsl:apply-templates select='//r'/></xsl:element ></xsl:template><xsl:template match='r'><xsl:copy-of select='.'/></xsl:template></xsl:stylesheet>");    
  }
  
  function funInitMedicalManList(){    
    if(arrProperty["IDOFMEDICALINSTITUTION"] != "-1" && arrProperty["IDOFMEDICALINSTITUTION"] != "-2"){
        objMedicalManListXML = transformXML("http://192.168.1.55:7001/dhrm/dics/medicalManDic.xml",'<?xml version="1.0" encoding="GBK"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"><xsl:template match="/"><xsl:element name="root"><xsl:apply-templates select="//r"/></xsl:element></xsl:template><xsl:template match="r"><xsl:if test="@IDOFMEDICALINSTITUTION=\'' + arrProperty["IDOFMEDICALINSTITUTION"] + '\'"><xsl:copy-of select="."/></xsl:if></xsl:template></xsl:stylesheet>');
    }else{
       objMedicalManListXML = inputXML("http://192.168.1.55:7001/dhrm/dics/medicalManDic.xml").xml; 
    }
  }
  
  function funInitRegionalismList(){
    objXMLHttp.Open("POST",proxyLocation,false);  
    objXMLDoc.loadXML("<?xml version='1.0' encoding='GBK'?><root UIDofSession='" + arrProperty["UIDOFSESSION"] + "' TimeStmp='' Tran='0'><MsgBody target='准字典' action='列出所有行政区域' UIDofMesg='' Priority='0' Syn='0'/></root>");    
    objXMLHttp.send(objXMLDoc); 
    objRegionalismListXML = transformXML(objXMLHttp.responseText, "<?xml version='1.0' encoding='GBK'?><xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:fo='http://www.w3.org/1999/XSL/Format'><xsl:template match='/'>	<xsl:element name='root'><xsl:apply-templates select='//r'/></xsl:element ></xsl:template><xsl:template match='r'><xsl:copy-of select='.'/></xsl:template></xsl:stylesheet>");      
  }
  
  function InitFromContext(objNode){
    
    if(!objNode || !objNode.xml){
      alert("请重新登录。");
      return(-1);
    }

    arrProperty["DEPTCODE"] = objNode.getAttribute("DEPTCODE");

    strUIDofSession = objNode.getAttribute("UIDOFSESSION");
    arrProperty["UIDOFSESSION"] = strUIDofSession;
    
    arrProperty["UNAME"] = objNode.getAttribute("UNAME");   
    arrProperty["INSTITUTIONNAME"] = objNode.getAttribute("INSTITUTIONNAME");   
    arrProperty["IDOFMEDICALINSTITUTION"] = objNode.getAttribute("IDOFMEDICALINSTITUTION"); 
    
    arrProperty["IDOFUSERBASE"] = objNode.getAttribute("IDOFUSERBASE");
    arrProperty["SERVESTATE"] = objNode.getAttribute("SERVESTATE");
    
    funInitSectionList();
    funInitMedicalManList();
    funInitRegionalismList();
  }

  function getProperty(strPropertyName){//获取动态属性
    if(arrProperty[strPropertyName]){
      return(arrProperty[strPropertyName]);
    }else{
      return(null);
    }  
  }
  
  function getSectionList(){
    return objSectionListXML;
  }
  
  function getMedicalManList(){
    return objMedicalManListXML;
  }
  
  function getRegionalismList(){
    return objRegionalismListXML;
  }
  
//-->
  </script>
</public:component>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -