# [ -n "${_POST[hi_company]}${_POST[hi_number]}${_POST[hi_status]}" ] \
# && _POST[X-HEALTH-INSURANCE]="$(vcf_escape "${_POST[hi_company]}" "${_POST[hi_number]}" "${_POST[hi_status]}")"
-vcf="$(pdi_load "$cardfile")"
+# vcf="$(pdi_load "$cardfile")"
+vcf="$(pdi_load "$tempfile")"
vcf="$(pdi_update_value "$vcf" N 1 "$(vcf_escape "$(POST 1N)" "$(POST 2N)" "$(POST 3N)" "$(POST 4N)" "$(POST 5N)")")"
+vcf="$(pdi_update_value "$vcf" FN 1 "$(vcf_escape "$(POST 4N) $(POST 2N) $(POST 3N) $(POST 1N) $(POST 5N)" \
+ | sed -E 's;^ +;;; s; +$;;; s; +; ;g;')" )"
for field in $(POST_KEYS |grep -xE '[A-Z][A-Z0-9-]*'); do
for cnt in $(seq 1 $(POST_COUNT "$field")); do
if [ "$action" = addfield ]; then
vcf="$(pdi_update_value "$vcf" "$newfield" $(( $(pdi_count "$vcf" "$newfield") + 1 )) '')"
fi
-printf '%s' "$vcf" |grep -vx '' >"$tempfile"
+printf '%s' "$vcf" | sed -E '/^$/d; s/^([^:]+);:/\1:/;' >"$tempfile"
case "$action" in
addfield)