Merging patients

Discuss use of CDR Software Development Kit including Practice Management Software, Acquisition Controls and CDR Data Controls.

Moderator: Software Moderators

Merging patients

Postby dtully » Thu Jun 10, 2004 2:46 pm

I am building a bridge between my patient management software and CDR DICOM using Visual Basic Script. So far, it is going well. I have scripts set up to launch DICOM with the correct patient and scripts to change the first name, last name, and patient ID.

The next step is to merge 2 existing CDR DICOM patients together. Unfortunately, it doesn't appear that the SDK can do this. Can someone verify this for me? Assuming the SDK can't handle this, is there any work arounds or do I need to have staff make use of the Data Administrator Utility?

Thanks,
Don
dtully
 
Posts: 38
Joined: Thu Jun 10, 2004 2:36 pm

Postby jgoyette » Sat Jun 12, 2004 2:54 pm

Hi Don,

No, there is no specific command to merge 2 patients in the SDK. The technique would be very similar to changing patient names or id numbers. First, keep in mind that this should be carried out on the server, or on a machine that is using direct database connection with access to the images (i.e., it cannot be done via the DICOM server). You will need to use some properties in the CDRDataDB interfaces.

Our DataAdmin tool does something like the following:

Code: Select all
   1. Create a query to hold images
   2. Iterate thru all of the studies in source patient
      3. For each Study, use query to find all images in study
         4. Load each image (Image.LoadImageData)
         5. Copy in new patient data
         6. Update image (Image.Update)
         7. Unload image (Image.FreePixelData)
      8. After updating all of the images, you need to make a change to the database that moves this Study into the new patient.  You do this by setting the PatientNumber property in this Study to the same value as the new Patient.PatientNumber.  (Note that these are CDRStudyDB and  CDRPatientDB properties).
   9. repeat for each study in the source patient


When you are done, all of the studies and images should be associated with the new Patient. The original patient will still exists in the database but have no studies. You can delete this Patient if you like. Be careful not to delete the folder for this patient as the original images are still located there!

-John G.
John Goyette
Sirona Dental, Inc.
jgoyette
Moderator
 
Posts: 309
Joined: Thu Jan 01, 2004 7:33 pm
Location: Long Island City, NY

Postby hlazar » Mon Jun 21, 2004 11:05 am

I have to merge patients every so often and hate the fact that I have to go through the entire patient list. Is there any way this can be rewritten to make it user friendly.

Henry L lazarus [email protected]
www.netaxs.com/~hlazar/
www.netaxs.com/~hlazar/god.html
hlazar
 
Posts: 22
Joined: Thu Jan 01, 2004 7:33 pm

Merging Patients

Postby dlindberg » Thu Jun 24, 2004 2:12 pm

Dr. Lazarus,

Your request has been submitted to our Software Engineering Department as an enhancement request for future software releases.
Thank you for your request.


Donald A. Lindberg
Schick Technologies
dlindberg
Moderator
 
Posts: 1420
Joined: Thu Jan 01, 2004 7:33 pm
Location: Long Island City, NY

Re:

Postby Mynhard » Mon Aug 15, 2011 11:17 pm

Hi John

I need to merge duplicate patients (due to a legacy issue in our PM software), and I've tried to implement it based on your pseudocode:

jgoyette wrote:Our DataAdmin tool does something like the following:

Code: Select all
   1. Create a query to hold images
   2. Iterate thru all of the studies in source patient
      3. For each Study, use query to find all images in study
         4. Load each image (Image.LoadImageData)
         5. Copy in new patient data
         6. Update image (Image.Update)
         7. Unload image (Image.FreePixelData)
      8. After updating all of the images, you need to make a change to the database that moves this Study into the new patient.  You do this by setting the PatientNumber property in this Study to the same value as the new Patient.PatientNumber.  (Note that these are CDRStudyDB and  CDRPatientDB properties).
   9. repeat for each study in the source patient


When you are done, all of the studies and images should be associated with the new Patient. The original patient will still exists in the database but have no studies. You can delete this Patient if you like. Be careful not to delete the folder for this patient as the original images are still located there!

-John G.


You also gave similar instructions in Bridge issue - switching PM software causes PatID issues:

jgoyette wrote:2. Write a conversion process for the Patient IDs in the CDR Dicom database. This is not as simple as updating the PatientID field in the database. Every image file for every patient must also be updated. You will need to use the SDK to do this. Using the SDK, the old patient must be retrieved with a CDRDataQuery. Then using a second DataQuery, iterate through every ICDRImage belonging to that patient. Load the image data, obtain the parent ICDRPatient object, update the ID, then update the ICDRImage. This process touches every file belonging to the patient and can take a long time to run for all patient data.

-John G.


Now I have two questions:
1) Is the CDRDataDB API documented anywhere in the SDK, or is it available for download? I can't find any documentation except for the CDRData API, so I've had to base my code on the VS2010 or Visual Assist auto-completion suggestions, as well as by examining the type libraries in the OLE-COM Object Viewer. However this doesn't give me information such as, say, the purpose of the arguments to CDRDATADBLib::ICDRPatientDB::Delete(Boolean bDeleteFlag, Boolean bRecurse).
2) My implementation appears to work fine, but I don't update the ICDRImage/ICDRImage2/ICDRImageDB objects at all (your steps 3 to 7). I only update the ICDRStudyDB and ICDRPatientDB objects, because I can't find any image properties or methods that refer to their owning patients. As far as I can see, images only refer to their owning series, which in turn refer only to their owning studies, which in turn refer only to their owning patients, so surely all I need to do is to move all the old patient's studies to the new patient, and then delete the old patient?

Thanks
Mynhard Rudolph
Software of Excellence
Mynhard
 
Posts: 4
Joined: Tue Jan 04, 2011 5:36 pm

Re: Merging patients

Postby jgoyette » Tue Aug 16, 2011 10:34 am

Mynhard,

Sorry, the CDRDataDB interface is not documented. What you have already done by inspecting the interface and asking questions here is the best you can do. It was never intended that integrators would use CDRDataDB directly.

You are right about the ownership of Images, Series, etc... You can get the Patient from an Image by calling GetSeries, then GetStudy, etc... You can also use QueryInterface to obtain the ICDRPatient interface directly from an image object.

Also, as you said it is probably sufficient to change the Patient to Study link to move all the images to a different patient.

-John G.
John Goyette
Sirona Dental, Inc.
jgoyette
Moderator
 
Posts: 309
Joined: Thu Jan 01, 2004 7:33 pm
Location: Long Island City, NY

Re: Merging patients

Postby Mynhard » Tue Aug 16, 2011 9:14 pm

Hi John

Thanks for your prompt reply! I feel far more secure about my solution now. :-)

Regards
Mynhard
Mynhard
 
Posts: 4
Joined: Tue Jan 04, 2011 5:36 pm


Return to CDR Dicom SDK

Who is online

Users browsing this forum: JacklynaMent and 18 guests

cron