php - Varchar values to numerical classification -
i have database containing 3 tables:
- practices - 8 fields
- patients - 47 fields
- exacerbations - 11 fields
the majority of fields in these tables recorded in varchar format, other fields include integers, doubles , dates.
i have transform data numerically classified data can used statistician extrapolate patterns in data. acheive have convert varchar fields integers represent classification string belongs to, example being 'severity' has following possible string values:
- mild
- moderate
- severe
- very severe
this field in patients table has finite list of string values can appear, other fields have endless possibility of string values cannot classified until encountered database (unless implement form of intelligent approach).
for time being trying construct best approach converting each field entries in each of 3 tables numeric values. pseudo code have in head far follows (it's not complete):
function profiledatabase each table in database each field of type varchar select distinct values , insert classfication table field end end function classifydatabase each table in database each field of type varchar // efficient build insert string place new table end end
can suggest best way of performing process efficient giving there in excess of 100 practices, 15,000 patients , 55,000 exacerbations in system. have no need implement in php, build prefer so. pointers how structure great not sure approach best approach.
this process have run every month next 2 years database grows have total of 100,000 patients.
maybe http://dev.mysql.com/doc/refman/5.1/en/procedure-analyse.html overview find out how fields used.
Comments
Post a Comment