def test_ipt_24(self): tem = Template() # 待审医嘱作为合并医嘱被删除后,原任务重新跑引擎,ccr值在已审页面展示正确 tem.send_data('ipt_delete', 'a2', **tem.change_data) # 发药嘱 tem.send_data('ipt_delete', 'a1', **tem.change_data) # 发草药嘱 tem.send_delete_1('ipt_delete', 'a4', **tem.change_data) # 删除药嘱 # 待审页面获取药嘱的引擎id param = { "patientId": tem.change_data['{{ts}}'] } url = tem.conf.get('auditcenter', 'address') + tem.conf.get('api', '查询待审住院任务列表') res = tem.post_json(url, param) engineid = res['data']['engineInfos'][0]['id'] res = tem.get_ipt_patient(engineid, 0) print(json.dumps(res, indent=2, sort_keys=False, ensure_ascii=False)) # try: self.assertEqual(res['data']['ccr'], "90.0(预设值)") # except AssertionError as e: # print(e) ids = [engineid] tem.audit_multi(3, *ids) res = tem.get_ipt_patient(engineid, 1) self.assertEqual(res['data']['ccr'], "90.0(预设值)")
class TestDelete(unittest.TestCase): def setUp(self): warnings.simplefilter("ignore", ResourceWarning) self.tem = Template() def test_opt_01(self): '''审核打回(双签),医生删除处方''' engineid = self.tem.get_opt_engineid('opt','处方一',1) # 审核打回 self.tem.opt_audit(engineid,1) self.tem.send_delete_1('doctor','opt_del_1',**self.tem.change_data) res = self.tem.get_opt_auditresult(engineid,1) self.assertEqual(0,res['data'][0]['rejectStatus']) def test_opt_02(self): '''审核打回,医生删除处方''' engineid = self.tem.get_opt_engineid('opt','处方一',1) # 审核打回 self.tem.opt_audit(engineid,0) self.tem.send_delete_1('doctor','opt_del_1',**self.tem.change_data) res = self.tem.get_opt_auditresult(engineid,1) self.assertEqual(0,res['data'][0]['rejectStatus']) def test_opt_03(self): '''审核通过,医生删除处方''' engineid = self.tem.get_opt_engineid('opt','处方一',1) # 审核打回 self.tem.opt_audit(engineid,2) self.tem.send_delete_1('doctor','opt_del_1',**self.tem.change_data) res = self.tem.get_opt_auditresult(engineid,1) self.assertEqual(0,res['data'][0]['rejectStatus']) def test_opt_04(self): '''审核打回,医生修改处方''' engineid = self.tem.get_opt_engineid('opt','处方一',1) # 审核打回 self.tem.opt_audit(engineid,0) self.tem.send_data('opt','修改处方一1',**self.tem.change_data) # 只修改处方头 res = self.tem.get_opt_auditresult(engineid,1) self.assertEqual(2,res['data'][0]['rejectStatus']) def test_opt_05(self): '''审核打回,医生修改处方''' engineid = self.tem.get_opt_engineid('opt', '处方一', 1) # 审核打回 self.tem.opt_audit(engineid, 0) self.tem.send_data('opt', '修改处方一2', **self.tem.change_data) # 修改部分药的处方明细 res = self.tem.get_opt_auditresult(engineid, 1) self.assertEqual(2, res['data'][0]['rejectStatus']) def test_opt_06(self): '''审核打回,医生修改处方''' engineid = self.tem.get_opt_engineid('opt','处方一',1) # 审核打回 self.tem.opt_audit(engineid,0) self.tem.send_data('opt','修改处方一3',**self.tem.change_data) # 修改全部药的处方明细 res = self.tem.get_opt_auditresult(engineid,1) print(res) self.assertEqual(2,res['data'][0]['rejectStatus']) def test_opt_07(self): '''审核通过,医生修改处方''' engineid = self.tem.get_opt_engineid('opt','处方一',1) # 审核打回 self.tem.opt_audit(engineid,0) self.tem.send_data('opt','修改处方一1',**self.tem.change_data) # 只修改处方头 res = self.tem.get_opt_auditresult(engineid,1) self.assertEqual(2,res['data'][0]['rejectStatus'])