miracum / dicom-fhir-converter

Converts DICOM Resources to FHIR Resources
Apache License 2.0
0 stars 1 forks source link

Feature: SNOMED-CT Mapping for body-part examined #2

Open kapsner opened 1 year ago

kapsner commented 1 year ago

In function gen_bodysite_cr (https://github.com/miracum/dicom-fhir-converter/blob/master/dicom2fhir/dicom2fhirutils.py#L199) add mapping to map the provided value from the dicom-header (argument bd) to SNOMED-CT.

I'd suggest to do this in a stepwise manner: 1) first, copy the mapping table from here to mapping csv file and add this to the repo (should be sufficient to add 2 columns: "CodeValue" and "Body Part Examined") 2) if the first thing works, everything should be temporarily fine. to make it nice, in a second step the mapping via the csv-table could be replaced by a scraping of the webpage to always retrieve the latest version of the mapping table.

alexa-ian commented 1 year ago

Resolved with pull request: https://github.com/kapsner/dicom-fhir-converter/pull/2

alexa-ian commented 1 year ago

Ich habe beim weiteren Testen gemerkt, dass es bei den Test-Daten vorkommt, dass "Body Part Examined" zwar befüllt ist, aber mit einem nicht-DICOM-konformen Wert. Z.B. habe ich gefunden: "LEG" (gibt es gar nicht) oder "ABD PELVIS" (erwartet wäre "ABDOMENPELVIS"). Demnach gibt es für solche Fälle natürlich kein SNOMED-Mapping und der BodyPart in der FHIR-Ressource bleibt leer. Ich sehe dafür 3 Möglichkeiten:

Was sagst Du? @kapsner

kapsner commented 1 year ago

Ich würde vorschlagen, diese Fälle irgendwie zu kennzeichnen.

Z.B. https://github.com/alexa-ian/dicom-fhir-converter/blob/main/dicom2fhir/dicom2fhirutils.py#L61C1-L64C69

def _get_snomed(dicom_bodypart, sctmapping):
    # codes are strings
    sct_val = sctmapping.loc[sctmapping['Body Part Examined']
                          == dicom_bodypart]["Code Value"].values[0]
    if sct_val = "" or sct_val is None:
        sct_val = "ERROR: SCT for " + dicom_bodypart + " not found"
    return sct_val