dcmjs-org / dcmjs

Javascript implementation of DICOM manipulation
https://dcmjs.netlify.com/
MIT License
293 stars 111 forks source link

structured report for measurements with google healthcare API #249

Closed muhammedmokbel closed 2 years ago

muhammedmokbel commented 2 years ago

hi everyone , I already generated structured report for measurements using dcmjs const toolState = cornerstoneTools.globalImageIdSpecificToolStateManager.toolState const { MeasurementReport } = dcmjs.adapters.Cornerstone; const report = MeasurementReport.generateReport(toolState, cornerstone.metaData); const dataset = report .dataset const dicomDict = dcmjs.data.datasetToDict(dataset); const buffer = Buffer.from(dicomDict.write()) then i used dicomweb-client to store my SR in right way with google healthcare const client = new api.DICOMwebClient({ url: GOOGLE_HEALTHCARE_API }) client.storeInstances({ datasets: [buffer] }) but unfortunately I found that google return 409 conflict request <NativeDicomModel><DicomAttribute tag="00081190" vr="UR" keyword="RetrieveURL"><Value number="1">https://healthcare.googleapis.com/v1/projects/mypacs/locations/europe-west3/datasets/Germany-test-dataset/dicomStores/mystore/dicomWeb/studies/1.3.6.1.4.1.50525.1.2.20211027.201716.647.12391.1</Value></DicomAttribute><DicomAttribute tag="00081198" vr="SQ" keyword="FailedSOPSequence"><Item number="1"><DicomAttribute tag="00081197" vr="US" keyword="FailureReason"><Value number="1">272</Value></DicomAttribute><DicomAttribute tag="00090097" vr="LT" keyword="FailureDetail" privateCreator="GOOGLE"><Value number="1">already exists</Value></DicomAttribute><DicomAttribute tag="00081150" vr="UI" keyword="ReferencedSOPClassUID"><Value number="1">1.2.840.10008.5.1.4.1.1.88.22</Value></DicomAttribute><DicomAttribute tag="00081155" vr="UI" keyword="ReferencedSOPInstanceUID"><Value number="1">2.25.716717189280151754459567217453695503599</Value></DicomAttribute></Item></DicomAttribute></NativeDicomModel>

so please can i anyone explain to me if there're any problem in my logic or why google prevent my Post request to update metadata ??

pieper commented 2 years ago

Can you try storing to a different server as a test? (e.g. dcm4chee). Also try running dciodvfy on the instance.

fedorov commented 2 years ago

Looking at the error, you may already have an instance with SOPInstanceUID in the dicom store.

muhammedmokbel commented 2 years ago

thanks everyone for respond

I got the problem which is as @fedorov said I should generate new SOPInstanceUID to store my SR in google dicom store