0

I am working on a Cloud service for de-identifying DICOM data in a Google Healthcare DICOM store (not DICOM set). I want to replace patient name (value in DICOM tag (0010, 0010)) with a special char (such as '*') or with the name of the value's infoType (such as 'PERSON_NAME').

I tried following test code, NONE of them changed patient Name (i.e. After "deidentify()" call, the patient name in DICOM tag (0010,0010) remains same). Anything wrong in the code ?

Test Code #1:

const res = await healthcare.projects.locations.datasets.dicomStores.deidentify({           
          sourceStore: sourceStore,
          destinationStore: destinationStore,
          resource: { 
            config: {
             dicom: {  
               filterProfile: 'DEIDENTIFY_TAG_CONTENTS',  
             }, 
             text: {
              transformations: [ 
                {
                  infoTypes:['PERSON_NAME'], 
                  characterMaskConfig:{maskingCharacter: ''}
                }
              ]
            },  
             image: {
               textRedactionMode: 'REDACT_SENSITIVE_TEXT',
             }, 
           }, 
           filterConfig: { 
           },  
          },
        }); 

Test Code #2:

const res = await healthcare.projects.locations.datasets.dicomStores.deidentify({           
          sourceStore: sourceStore,
          destinationStore: destinationStore,   
          resource: { 
            config: {
             dicom: { 
               filterProfile: 'DEIDENTIFY_TAG_CONTENTS' 
             }, 
             text: {
              transformations: [
                {
                  infoTypes:['PERSON_NAME'], 
                  characterMaskConfig:{maskingCharacter: '*'}
                },                  
              ]
            },  
             image: {
               textRedactionMode: 'REDACT_SENSITIVE_TEXT',
             }, 
           }, 
           filterConfig: { 
           },  
          },
        });

Test Code #3:

const res = await healthcare.projects.locations.datasets.dicomStores.deidentify({         
          sourceStore: sourceStore,
          destinationStore: destinationStore,
          resource: { 
            config: {
             dicom: { 
               filterProfile: 'DEIDENTIFY_TAG_CONTENTS' 
             }, 
             text: {
              transformations: [
                // replace relevant values with their infoTypes                 
                {
                  infoTypes: [],
                    replaceWithInfoTypeConfig: {}
                } ,                 
              ]
            },  
             image: {
               textRedactionMode: 'REDACT_SENSITIVE_TEXT',
             }, 
           }, 
           filterConfig: { 
           },  
          },
        });

Test Code #4:

const res = await healthcare.projects.locations.datasets.dicomStores.deidentify({          
          sourceStore: sourceStore,
          destinationStore: destinationStore,
          resource: { 
            config: {
             dicom: {  
               filterProfile: 'DEIDENTIFY_TAG_CONTENTS' 
             }, 
             text: {
              transformations: [
                {
                  infoTypes:['PERSON_NAME'],
                  redactConfig:{}, 
                },
                 
              ]
            },  
             image: {
               textRedactionMode: 'REDACT_SENSITIVE_TEXT',
             }, 
           }, 
           filterConfig: { 
           },  
          },
        }); 

Test Code #5:

const res = await healthcare.projects.locations.datasets.dicomStores.deidentify({          
          sourceStore: sourceStore,
          destinationStore: destinationStore,
          resource: { 
            config: {
             dicom: {  
               filterProfile: 'DEIDENTIFY_TAG_CONTENTS' 
             }, 
             text: {
              transformations: [
                {
                  infoTypes:[],
                  redactConfig:{}, 
                }, 
              ]
            },  
             image: {
               textRedactionMode: 'REDACT_SENSITIVE_TEXT',
             }, 
           }, 
           filterConfig: { 
           },  
          },
        }); 

Test Code #6:

const res = await healthcare.projects.locations.datasets.dicomStores.deidentify({         
          sourceStore: sourceStore,
          destinationStore: destinationStore,
          resource: { 
            config: {
             dicom: { 
               filterProfile: 'DEIDENTIFY_TAG_CONTENTS' 
             }, 
             text: {
              transformations: [                  
              ]
            },  
             image: {
               textRedactionMode: 'REDACT_SENSITIVE_TEXT',
             }, 
           }, 
           filterConfig: { 
           },  
          },
        }); 

Related google de-ide docs: https://cloud.google.com/healthcare-api/docs/reference/rest/v1/DeidentifyConfig#TagFilterProfile https://cloud.google.com/healthcare-api/docs/how-tos/dicom-deidentify#default_dicom_infotypes

Any help is appreciated !

GaryY
  • 1
  • I tested out a few of your examples and options #2 and #3 worked for me. Is it possible that the operation failed for another reason? There may be something in Cloud Logging (you can find the link in the logsUrl field of the operation). Another option is maybe the operation hadn't finished yet when you checked the destination store? – Nik Klassen Aug 20 '22 at 14:56
  • Hi, Nik: Thank you so much for your time and effort to test sample code! I tried again, but still same thing to me. #2 and # 3 not work for me: patient name is not changed. Which version of google healthcare client lib (node.js)? I used "V1". How did you create the client object? This is what I did: – GaryY Aug 22 '22 at 17:00
  • const google = require('@googleapis/healthcare'); const healthcare = google.healthcare({ version: 'v1', auth: new google.auth.GoogleAuth({ scopes: [GOOGLE_APIS_CLOUD_PLATFORM], keyFile: 'C:/Discover-Test-Acct/ipi-anonymizationservice.json' }), }); – GaryY Aug 22 '22 at 17:03
  • I checked operation status in Cloud logging, didn't find any error. The de-id operation seems finished successfully. Event after a while, when I can call "healthcare.projects.locations.datasets.dicomStores.searchForInstances())" to get all instances from destination store, the patient name is still SAME, no change. – GaryY Aug 22 '22 at 17:06
  • Step 1: Create a multipart image file using https://cloud.google.com/healthcare-api/docs/how-tos/dicomweb#storing_dicom_data Step 2: Replace the instance metadata with the metadata sample here https://cloud.google.com/healthcare-api/docs/how-tos/dicom-deidentify#de-identifying_dicom_tags Step 3: Run the following code https://pastebin.com/sAKwVTUM – Nik Klassen Aug 22 '22 at 19:24
  • Hi, Nik: Thank you so much for the detailed steps. I have my own way to store DICOM instance to DICOM store. Now the code for de-identification is working as expected! Really appreciate your help! – GaryY Aug 28 '22 at 04:43

0 Answers0