update vitaldef set syncparentid =
(select syncrepositoryid from vitaldefinfo where syncdeleted = 0 and name like 'Systolic BP')
where syncparentid = (select syncrepositoryid from vitaldefinfo where syncdeleted = 0 and name like  'Diastolic BP')
/

update vitaldefinfo
set name = 'Blood Pressure',
	abbrevname = 'BP',
	type = 2
where
	name = 'Systolic BP'
/
update vitaldefinfo
set syncdeleted = syncrepositoryid
where
	name = 'Diastolic BP'
/


update vitaldef set syncparentid =
(select syncrepositoryid from vitaldefinfo where syncdeleted = 0 and name like 'Systolic BP2')
where syncparentid = (select syncrepositoryid from vitaldefinfo where syncdeleted = 0 and name like  'Diastolic BP2')
/

update vitaldefinfo
set name = 'Blood Pressure 2',
	abbrevname = 'BP2',
	type = 2
where
	name = 'Systolic BP2'
/
update vitaldefinfo
set syncdeleted = syncrepositoryid
where
	name = 'Diastolic BP2'
/

update vitaldef set syncparentid =
(select syncrepositoryid from vitaldefinfo where syncdeleted = 0 and name like 'Systolic BP3')
where syncparentid = (select syncrepositoryid from vitaldefinfo where syncdeleted = 0 and name like  'Diastolic BP3')
/

update vitaldefinfo
set name = 'Blood Pressure 3',
	abbrevname = 'BP3',
	type = 2
where
	name = 'Systolic BP3'
/
update vitaldefinfo
set syncdeleted = syncrepositoryid
where
	name = 'Diastolic BP3'
/