Exemplo n.º 1
0
    def __init__(self):
        # 连接报表数据库
        self.conndb = connectDB()
        self.conn = self.conndb.connect(self.conndb.dbname_report)
        self.cur = self.conndb.getCursor(self.conn)

        # 从配置文件中获取SQL配置项
        self.confR = configReader(path)

        #获取用户中心配置项的值
        self.configValue = configValue()
        self.configKey = 'ConfigurationItem_zone'

        #计算DDDS
        self.calcddds = DDDS()

        self.hospitalitems = self.confR.getitems('hospital')  # 全院指标的SQL
        self.optitems = self.confR.getitems('zone')  # 常规SQL
        self.optcalc = self.confR.getitems('item_calc')  # 计算指标的SQL,两个数相乘
        self.optcalc100 = self.confR.getitems('item_calc100')  # 计算指标乘以100的SQL
        self.optcalcminus = self.confR.getitems('item_calc_minus')  # 两个指标相减
        self.itemname_config = self.confR.getitems('ConfigurationItem_zone')
        self.zoneddds = self.confR.getitems('zone_ddds')
        self.hospitalddds = self.confR.getitems('hospital_ddds')
        self.drugzone = self.confR.getitems('drug_zone')
        self.productInfor = self.confR.getitems('drug_productInfor')
        self.operation = self.confR.getitems('operation_zone')
Exemplo n.º 2
0
    def __init__(self):
        #连接报表数据库
        self.conndb = connectDB()
        self.conn = self.conndb.connect(self.conndb.dbname_report)
        self.cur = self.conndb.getCursor(self.conn)

        #从配置文件中获取SQL配置项
        self.confR = configReader(path)
Exemplo n.º 3
0
    def __init__(self):
        # 连接报表数据库
        self.conndb = connectDB()
        self.conn = self.conndb.connect(self.conndb.dbname_report)
        self.cur = self.conndb.getCursor(self.conn)

        # 从配置文件中获取SQL配置项
        self.confR = configReader(path)
        self.optitems = self.confR.getitems('default_group')  # 常规SQL
Exemplo n.º 4
0
    def __init__(self):

        self.dbconf=configReader(path)
        self.host=self.dbconf.get("mysql","host")
        self.port = self.dbconf.getint("mysql", "port")
        self.username=self.dbconf.get("mysql","username")
        self.passwd=self.dbconf.get("mysql","passwd")
        self.dbname_dp=self.dbconf.get('mysql',"dbname_dp")
        self.dbname_sys=self.dbconf.get("mysql","dbname_sys")
        self.dbname_report=self.dbconf.get("mysql","dbname_report")
        self.charset=self.dbconf.get("mysql","charset")
Exemplo n.º 5
0
    def __init__(self,reportName=None):
        self.reportName=reportName
        self.getRC=getReportContent()
        self.getReportConfig(self.reportName)

        # 从配置文件中获取SQL配置项
        self.confR = configReader(path)

        #保存测试结果
        self.saveTR=getTestResult(self.reportName)

        # 获取SQL值的类
        self.getSqlValueZone = getZoneSQLvalue()  #数据维度:机构
        self.getSqlValueDoc=getDocSQLvalue()      #数据维度:医生
        self.getSqlValueDept=getDeptSQLvalue()    #数据维度:科室
        self.getSqlValueGroup=getGroupSQLvalue()  #数据维度:医疗组

        self.dimension={'缺省维度':'default','药品维度':'drug','手术维度':'operation','警示维度':'warning'} #各维度对应的方法名
Exemplo n.º 6
0
    def __init__(self):
        # 连接报表数据库
        self.conndb = connectDB()
        self.conn = self.conndb.connect(self.conndb.dbname_report)
        self.cur = self.conndb.getCursor(self.conn)

        # 从配置文件中获取SQL配置项
        self.confR = configReader(path)

        #获取用户中心配置项的值
        self.configValue = configValue()
        self.configKey = 'ConfigurationItem_dept'

        #计算DDDS
        self.calcddds=DDDS()

        self.hospitalitems = self.confR.getitems('hospital_dept')  # 全院指标的SQL
        self.optitems = self.confR.getitems('default_dept')  # 常规SQL
        self.optcalc = self.confR.getitems('item_calc')  # 计算指标的SQL,两个数相乘
        self.optcalc100 = self.confR.getitems('item_calc100')  # 计算指标乘以100的SQL
        self.optcalcminus = self.confR.getitems('item_calc_minus')  # 两个指标相减
        self.itemname_config = self.confR.getitems('ConfigurationItem_dept')
        self.deptddds = self.confR.getitems('dept_ddds')
        self.hospitalddds = self.confR.getitems('hospitalDept_ddds')
Exemplo n.º 7
0
 def __init__(self):
     self.cfR = configReader(path)
     self.url = self.cfR.get('url', 'url')
     self.headers = {
         'Content-Type': "application/json",
     }
Exemplo n.º 8
0
    def executeSQL_drug(self,cur,sql,zoneid,startT,endT,productId):
        cur.execute(sql,(zoneid,startT,endT,productId,zoneid,startT,endT,productId))
        return cur.fetchone()[0]

#测试指标用,临时的
    def getrecipeids(self):
        worksheet = xlrd.open_workbook('C:\\Users\\ipharmacare\\recipeid.xlsx')
        sheet1 = worksheet.sheet_by_name('Sheet1')
        cols = sheet1.col_values(46)
        return cols

if __name__=="__main__":
    connectDB=connectDB()
    conn=connectDB.connect(connectDB.dbname_report)
    cur=connectDB.getCursor(conn)
    confr=configReader(path)
    sql=confr.get('zone',"出院患者中联合使用抗菌药物人次")
    print sql

    # cur.execute(sql,('4','2014-08-01','2014-08-01','4','2014-08-01','2014-08-01'))
    cur.execute(sql, ('4', '2014-08-01', '2014-08-01'))
    rlt =cur.fetchall()[0]
    print(rlt)
    # ids=[str(rid[0]) for rid in rlt]
    # print(ids)

    # recipeids = connectDB.getrecipeids()
    # print(recipeids)
    # recipeids_new = [int(recipeid) for recipeid in recipeids]

    # print(set(ids)-set(recipeids_new))