Web server

  • As I have read qido is used in queries. Retrieve dicom objets uses wado-rs and retrieve instances uses wado-uri. https://www.dicomstandard.org/using/dicomweb

  • Does this look good (WIP)


    x = DicomObject:new()

    x.PatientID = "a123"

    x.SeriesInstanceUID= "123.123.123"

    x.InstanceNumber=100

    print(x:Serialize(true, true, true))


    {"00100020": { "vr": "LO", "Value":"a123"},"0020000e": { "vr": "UI", "Value":"123.123.123"},"00200013": { "vr": "IS", "Value":"100 "}}\\


    dgate.zip


    Marcel

  • Thank you,

    I will try it.

    Does the third parameter in serialize mean dicomweb result?

    Do I have to put this new dgate.exe into remote conquest server or only in my backend api?

    On conquest remote server I use dgate64.

    I have tried the next code and I get no results:


  • Hi,


    you can download zerobrane studio and run install.lua to get a proper debugger. I fixed a few bugs in your code below.


    The serialiser runs in the server so the new dgate should be there. If you use the old one it just returns the original format.


    Marcel


  • Sample output:


    Code
    [{"00020010": { "vr": "UI", "Value":"1.2.840.10008.1.2"},"00080052": { "vr": "CS
    ", "Value":"STUDY"},"00100020": { "vr": "LO", "Value":"0009703828"},"0020000d":
    { "vr": "UI", "Value":"1.3.46.670589.5.2.10.2156913941.892665384.993397"}}]


    to use dgate.exe instead of dgate64.exe rename dgate64.exe and copy dgate.exe to the dicomserver folder.


    Marcel

  • try this one:


    dgate.zip


    Code
    [{"00020010": { "vr": "UI", "Value":["1.2.840.10008.1.2"]},"00080052": { "vr": "
    CS", "Value":["STUDY"]},"00100020": { "vr": "LO", "Value":["0009703828"]},"00200
    00d": { "vr": "UI", "Value":["1.3.46.670589.5.2.10.2156913941.892665384.993397"]
    }}]
  • try this one:


    dgate.zip


    Code
    [{"00020010": { "vr": "UI", "Value":["1.2.840.10008.1.2"]},"00080052": { "vr": "
    CS", "Value":["STUDY"]},"00100020": { "vr": "LO", "Value":["0009703828"]},"00200
    00d": { "vr": "UI", "Value":["1.3.46.670589.5.2.10.2156913941.892665384.993397"]
    }}]

    Hi, Marcel


    It starts to work.


    But, the docs say in https://dicom.nema.org/medical…part18/sect_10.6.3.3.html about response payload.

    I can´t get many of these tags in the response.


    "For each matching Study, the origin server response shall contain Attributes in accordance with Table 10.6.3-3. The "Type" column in the table below refers to the Query/Retrieve Attribute Types defined in Section C.2.2.1 “Attribute Types” in PS3.4. The unique key for a Study resource Search response is the Study Instance UID (0020,000D)."


    In addition, the response shall contain:


    All other Study level Attributes passed as match or includefield parameters in the request that are supported by the origin server.

    If the includefield parameter has been specified in the request, and its value is "all", all available Study Level Attributes.

    If a Private Data Element has been specified as an include parameter and it is supported by the origin server, the Private Data Element and its corresponding Private Creator Element.

    Series or Instance Level Attributes contained in includefield parameters shall not be returned."


    Response payload


    Legend

    R=required

    U=Unique

    C=Conditional


    Study Date (0008,0020) R

    Study Time(0008,0030) R

    Accession Number (0008,0050) R

    Instance Availability (0008,0056) C Shall be present if known

    Modalities in Study (0008,0061) R

    Referring Physician's Name (0008,0090) R

    Timezone Offset From UTC (0008,0201) C Shall be present if known Retrieve

    URL (0008,1190) C Shall be present if the Instance is retrievable by the Retrieve transaction

    Patient's Name (0010,0010) R

    Patient ID (0010,0020) R

    Patient's Birth Date (0010,0030)R

    Patient's Sex (0010,0040) R

    Study Instance UID (0020,000D) U

    Study ID (0020,0010) R

    Number of Study Related Series (0020,1206) R

    Number of Study Related Instances (0020,1208) R

  • Hi, Marcel

    I am doing connection test with the API and Remote Conquest Server 1.5.0b.

    I have a conquest server in Amazon AWS.

    The AE, IP and Port are: CONQUESTLOCAL, 15.ZZZ.73.XXX and 3010

    IP and Port are opened in firewall



    In my local windows PC, I do in the command console:

    Code
    dgate.exe -p3010 -hCONQUESTLOCAL -q15.ZZZ.73.XXX "--dolua:dofile([[queryfunctions.lua]]);echo([[CONQUESTLOCAL]])"

    I have no response. The command doesn´t appears in the remote conquest log

    Do I have to configure something more?

    All is working if running conquest in my local PC


    Code
    // remote conquest dicom providers
    CONQUESTLOCAL 127.0.0.1 3010 un
    S* * 5678 un
    .....
    ...


  • >>> 2) can you test you can query the AMAZON server?

    yes, I do.

    If I do a http post from my local PC to copy api running on remote server as: https://15.CCC73.CCCC:3002/api/dicom/dicomImages I get:

        "data": [
    {
                "TransferSyntaxUID": "1.2.840.10008.1.2",
                "SOPInstanceUID": "1.2.392.200036.9107.307.31295.20220527.171921.1051137",
                "ConquestImageDate": "20220527",
                "ConquestImageTime": "172233",
                "QueryRetrieveLevel": "IMAGE",

    .....



    But dgate command line from my dev PC as:

    Code
    dgate.exe -p3010 -hCONQUESTLOCAL -q15.ZZZ.73.XXX "--dolua:dofile([[queryfunctions.lua]]);echo([[CONQUESTLOCAL]])"

    doesn´t work

  • >> 1) to get more items in the answers you have to ask from them, just say e.g. "StudyID":""

    Maybe I has misunderstood the docs, But I think some tags are mandatory even if you doesn´t ask in the query.

    The tags marked as "R" are Required as showing below( https://dicom.nema.org/medical…part18/sect_10.6.3.3.html ). Am I wrong?


  • Yes, therefore you have to add them to the query in the code if they are not there. E.g. as follows


    q=DicomObject:new()

    q.StudyId="" -- add all mandatory items this way

    q=q:Copy(jsonstring) -- overwrites existing empty elements


    Marcel

  • Hi, Marcel,


    I think the json response is not well formed. I am getting a parse error converting the response to JSON.

    A sample response is:

    [{"00020010": { "vr": "UI", "Value":["1.2.840.10008.1.2"]},"00080020": { "vr": "DA", "Value":["20170404"]},"00080030": { "vr": "TM", "Value":["145901.734000"]},"00080050": { "vr": "SH", "Value":"","00080052": { "vr": "CS", "Value":["STUDY"]},"00080061": { "vr": "CS", "Value":["CR"]},"00080090": { "vr": "PN", "Value":"","00100010": { "vr": "PN", "Value":["paciente008"]},"00100020": { "vr": "LO", "Value":["86542"]},"00100030": { "vr": "DA", "Value":["20170404"]},"0020000d": { "vr": "UI", "Value":["1.3.46.670589.30.1.6.1.116520970982.1491317778640.1"]},"00200010": { "vr": "SH", "Value":["S-J13O3MJ4.1"]}}]


    There is one more curly bracket in '.....3MJ4.1"]}}]


    In my API I get:

    Code
    [{"00020010": { "vr": "UI", "Value":["1.2.840.10008.1.2"]},"00080020": { "vr": "DA", "Value":["20170404"]},"00080030": { "vr": "TM", "Value":["145901.734000"]},"00080050": { "vr": "SH", "Value":"","00080052": { "vr": "CS", "Value":["STUDY"]},"00080061": { "vr": "CS", "Value":["CR"]},"00080090": { "vr": "PN", "Value":"","00100010": { "vr": "PN", "Value":["paciente008"]},"00100020": { "vr": "LO", "Value":["86542"]},"00100030": { "vr": "DA", "Value":["20170404"]},"0020000d": { "vr": "UI", "Value":["1.3.46.670589.30.1.6.1.116520970982.1491317778640.1"]},"00200010": { "vr": "SH", "Value":["S-J13O3MJ4.1"]}}]
    SyntaxError: Unexpected token ] in JSON at position 608
    at JSON.parse (<anonymous>)
  • Hi, Marcel,

    It´s working now.


    I already have some qidos, wadouri and wado-rs endpoints working


    I have some questions, please:

    1. How can adapt lua script to get only metadatas as specified in qido as:

    Study Metadata

    /studies/{study}/metadata


    Series Metadata

    /studies/{study}/series/{series}/metadata


    Instance Metadata

    /studies/{study}/series/{series}/instances/{instance}/metadata


    Notes from docs:

    The Metadata describes the corresponding Resource, not any Representation of it that might be separately retrieved, hence includes only the DICOM Dataset (without Bulkdata), and in particular does not include any Group 0002 File Meta Information Data Elements.


    Some Attributes of the DICOM Dataset may depend on the Representation, not the Resource, especially those that describe the Pixel Data, so may differ from those encoded in a particular retrieved Representation. E.g., Photometric Interpretation (0028,0004) may differ depending on the Transfer Syntax.


    Information related to Transfer Syntax UID (0002,0010) in the File Meta Information, which might be expected to be of interest for retrieval of the Representation of the Resource in a particular Media Type, may be available using the Available Transfer Syntax UID (0008,3002) in a Search Transaction.


    2. And Bulkdata as:

    Study Bulkdata

    /studies/{study}/bulkdata


    Series Bulkdata

    /studies/{study}/series/{series}/bulkdata


    Instance Bulkdata

    /studies/{study}/series/{series}/instances/{instance}/bulkdata


    Bulkdata

    {bulkdataURI}


    3. Is possible I add tags from json objects to query using the format '00231003' as showing below:

    Code
    /studies?00230010=AcmeCompany&00231001=001239&includefield=00231002&includefield=00231003
  • Hi,


    to only get the metadata, read the object


    x:Read(patientid..':'..sopistanceuid)


    and then clear the pixel data


    x.PixelData=nil


    To query on number say:


    q["00231001"]=""


    or q[string]="", where you fill the string with eg 00231001


    Marcel

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!