Skip to content

qie.convertToDICOM

Signature: qie.convertToDICOM(input, encoding*)

Returns: DICOM Message dicomMessage - the associated DICOM message object

Parse the XML or JSON DICOM formatted input string or message object as a DICOM message and return the associated DICOM message object.

Note

The return value CAN NEVER be assigned to the bound-in message object; it should be assigned to a locally declared variable.

Parameters

Type Name Description Default
Object input one of the following: XML string formatted DICOM, JSON string formatted DICOM, XML Message formatted DICOM, JSON Message formatted DICOM
String encoding* (optional) the character encoding for the XML or JSON input string UTF-8

Example

// Example converting JSON DICOM to DICOM Message
var jsonDicomString =`
{
    "00100010": {
        "vr": "PN",
        "Value": [
            {
                "Alphabetic": "John^Doe"
            }
        ]
    },
    "00100020": {
        "vr": "LO",
        "Value": [
            "12345"
        ]
    },
    "00100030": {
        "vr": "DA",
        "Value": [
            "19800101"
        ]
    },
    "0020000D": {
        "vr": "UI",
        "Value": [
            "1.2.3.4.5.6.7.8"
        ]
    },
    "00200010": {
        "vr": "LO",
        "Value": [
            "Chest X-Ray"
        ]
    },
    "0020000E": {
    "vr": "UI",
    "Value": [
    "1.2.3.4.5.6.7.9"
    ]
    },
    "00200011": {
    "vr": "LO",
    "Value": [
    "Chest X-Ray - PA View"
    ]
    },
    "00080060": {
    "vr": "CS",
    "Value": [
    "CR"
    ]
    },
    "00080018": {
    "vr": "UI",
    "Value": [
    "1.2.3.4.5.6.7.10"
    ]
    },
    "00080016": {
    "vr": "UI",
    "Value": [
    "1.2.840.10008.5.1.4.1.1.1"
    ]
    },
    "7FE00010": {
    "vr": "OB",
    "InlineBinary": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wQAAwAB/ocL1QAAAABJRU5ErkJggg=="
    }
}
`;
var dicomMessage = qie.convertToDICOM(jsonDicomString); // DICOM Message