瑞美网络版lis仪器接口源码

嘎嘎,尿分仪UT150仪器接口解析代码,提供大家参考,其他仪器接口也是差不多的做法,有需要做仪器接口的=或者需要瑞美网络版源码的可以 + (dynn2018)


string ls_code
string ls_result
string ls_data
string ls_string[]
string ls_item
string ls_result1
string ls_result2
long ll_stx
long ll_etx
long ll_ub
long ll_year
long ll_month
long ll_day
long ll_count
long ll_num
long ll_posint
ls_data = string(ib_data)
ll_etx = pos(ls_data,etx)
if ll_etx = 0 then
	return 1
end if
debugbreak()
ls_code = left(ls_data,ll_etx - 1)
ls_data = mid(ls_data,ll_etx + 1)
ib_data = blob(ls_data)

ll_stx = pos(ls_code,"")
ls_code = mid(ls_code,ll_stx + 1)
ll_count = in_dec.uf_putstrtoarray(ls_code,char(13) + char(10),ls_string)

if ll_count < 5 then
else
	//取第四行数据     从第5个开始截取    6个长度
	is_sampleno = mid(ls_string[4],5,6)
	//固定方法    把sampleno插入数据库中
	event ue_dealsampleno(is_sampleno,true)
	//取到年月日
	ll_year = long(mid(ls_string[2],12,4))
	ll_month = long(mid(ls_string[2],17,2))
	ll_day = long(mid(ls_string[2],20,2))
	//取样本检验日期
	idt_sampleda = event ue_makesampleda(ll_year,ll_month,ll_day)
	//从第五行开始取检验结果   一值到最后一行  第一行是空 
	//第二行是  第三行是 检验日期
	//第四行是样本号   //第五行开始是项目结果
	for ll_num = 5 to ll_count

		if ls_string[ll_num] = "" then
		else

			if pos(ls_string[ll_num],char(10)) > 0 then
			else
				ls_item = mid(ls_string[ll_num],2,3)
				debugbreak()
				ls_result1 = trim(mid(ls_string[ll_num],6,5))
				ls_result2 = trim(mid(ls_string[ll_num],9))
				wf_setresult(ls_result2)

				choose case is_rstmode
					case "2"
						ls_result = trim(ls_result2)

						if ls_result = "" then
							ls_result = trim(ls_result1)
						end if

					case "3"
						ls_result = trim(ls_result1 + "  " + ls_result2)
					case else
						ls_result = trim(ls_result1)
						ll_posint = pos(ls_result," ")

						if ll_posint > 0 then
							ls_result = left(ls_result,ll_posint)
						end if

						if ls_result = "" then
							ls_result = trim(ls_result2)
						end if

				end choose

				ls_result = profilestring(gs_ini,ls_item,ls_result,ls_result)
				wf_addresult(ls_item,ls_result,idt_sampleresulttime)
			end if

		end if

	next

	wf_calcsample()
	wf_sendrecmsg()
end if

if pos(ls_data,etx) > 0 then
	event ue_redecode()
end if

return 0

你可能感兴趣的:(lis系统源码)