function in add family visit to convert to appropriate json object