VixWin's somewhat confused explanation is actually (somewhat) true, but not in the way they said.
VixWin has two modes (options --> preferences --> 'bridge mode' | 'stand alone mode') and some lamebrain decided they should store and retrieve data from two separate directories, VXDATA and VXIMAGES, respectively. So when in 'bridge mode' the program can't find images generated in 'stand alone mode' and vice-versa. This makes conversions a bit of a challenge.
In a round-about way, OpenDental IS RESPONSIBLE for naming the VixWin files, but OpenDental doesn't do this on purpose. The VixWin program (when running in 'bridge mode') simply ASSUMES that whatever variable is passed is intended as the file name......... so OpenDental passes a PatNum and VixWin names the resulting file with that number.
Specifically, VixWin names the file 'xxPatNum00.TIF (or .....01.TIF, 02.TIF, etc. according to image number for that patient). the initial xx in the file name here denotes left padding to make the file name 8 digits long, the last two digits representing the image number for that patient.
for example, the first image for PatNum 12345 will be 01234500.TIF and the second image for PatNum 123 would be 00012302.TIF
There are two other corresponding files named xxPatNum00.TVW and xxPatNumFM.dat that are created at the same time and hold metadata that isn't critical to the program's function.
This means that in order to "attach" an existing image to an OD patient number, the associated files (.dat, .TIF, and .TVW) all have to be renamed AND moved in order to be recognized by the 'bridge mode'
program, using the PatNum provided via the OD bridge.
VixWin also generates a DBF file that indexes all the images by patient name, etc. This proved useful in moving and renaming files.
What I did was generate a script that finds all VixWin files where the patient name is identical to the way it is in OpenDental, and then move and rename the corresponding files. Because some VixWin images had names misspelled and others used nicknames, etc., this script only caught about 80%, still it helped to link the majority of 'stand alone' images to the 'bridge mode' program that recognizes OD's handoff.
This is an example script (written in Python with apologies to the teeth-gnashing among you), but a similar script will work with your favorite language. Oh, I first loated the .DBF data into MySQL to simplify the process.
Code: Select all
#!/usr/bin/python
import MySQLdb
import shutil
db = MySQLdb.connect("server","username","password","OpenDental" )
cursor = db.cursor()
cursor.execute("
SELECT
CONCAT(vix.PTSN,'00.TIF') AS old_name,
LPAD(CONCAT(UCASE(pat.PatNum),'00.TIF'),12,0) AS new_name
FROM patient pat, VixWin vix
WHERE ((UCASE(pat.LName) = UCASE(vix.SNAM)) and (UCASE(pat.FName) = UCASE(vix.NAME)))
")
database_rows = cursor.fetchall()
db.close()
old_dir = "X:/VXDATA/"
new_dir = "X:/VXIMAGES/"
for old_name, new_name in database_rows:
try:
shutil.move(old_dir + old_name, new_dir + new_name)
except Exception as e:
print "Exception moving %r to %r: %s" % (old_name, new_name, e)
Hope this helps somebody.
Neil