Error SQL FROM-clause ???

  • Hi all,


    here is my config :
    X86_64
    dgate 1.4.16k
    ubuntu server 9.04


    I've got this error from time to time :
    *** ERROR: missing FROM-clause entry for table "dicomimages"
    LINE 1: SELECT DICOMImages.SopInstanc FROM dicom_dicomimage WHERE DI...


    I don't understand because the dicoms are corrects.


    Any IDEA ???


    Thanks.

  • Hello Marcel,


    thanks for interest my topic.
    Dicom.ini :
    # This file contains configuration information for the DICOM server
    # Linux version using built-in PostgreSQL file driver


    # these settings control size of slice and series viewers, max size of transmitted dicom images (0=original),
    # compression for images sent to the activex (may be un,n1..4,j1,j2), and size of the icons in the image list
    # note: all items require at least one space left and right of the '=' !
    [webdefaults]
    size = 560
    dsize = 0
    #compress = n4
    compress = un
    iconsize = 48


    [sscscp]
    MicroPACS = sscscp
    Edition = Personal
    # WEB server
    WebServerFor = localhost
    # if set to 1, the web user cannot edit databases and (in future) other things
    WebReadonly = 1
    # web or local location of ActiveFormProj1.ocx for download (include trailing / or \)
    WebCodeBase = http://localhost/cgi-bin/
    # path to script engine: ocx will not download images if wrong - shows as black square with controls
    WebScriptAddress = http://localhost/cgi-bin/dgate.html
    # this is an optional virtual directory used to http: all images from mag0
    # this entry is experimental and unused except for manual calls to mode=seriesviewer2
    # in this mode (only) ocx will not download images if wrong - shows as black square with controls
    WebMAG0Address = http://localhost/media/mag0
    # Network configuration: server name and TCP/IP port#
    MyACRNema = MYPACS
    TCPPort = 10001
    # Reference to other files: known dicom servers; database layout; sops
    ACRNemaMap = /home/netpacs/data/acrnema.map
    kFactorFile = /home/netpacs/data/dicom.sql
    SOPClassList = /home/netpacs/data/dgatesop.lst
    # Configure database
    TruncateFieldNames = 10
    MaxFieldLength = 254
    FileNameSyntax = 3
    MaxFileNameLength = 255
    FixPhilips = 0
    FixKodak = 0
    DoubleBackSlashToDB = 1
    UIDPrefix = 9999.9999
    EnableReadAheadThread = 1
    PatientQuerySortOrder =
    StudyQuerySortOrder =
    SeriesQuerySortOrder =
    ImageQuerySortOrder =
    IndexDBF = 1
    PackDBF = 0
    LongQueryDBF = 1000
    TCPIPTimeOut = 300
    FailHoldOff = 60
    RetryDelay = 100
    QueueSize = 128
    WorkListMode = 0
    #DebugLevel = 2


    # Configuration of compression for incoming images and archival
    #DroppedFileCompression = j1
    #IncomingCompression = j1


    DroppedFileCompression = un
    IncomingCompression = un
    ArchiveCompression = as


    # Names of the database tables
    WorkListTableName = dicom_worklist
    PatientTableName = dicom_dicompatient
    StudyTableName = dicom_dicomstudy
    SeriesTableName = dicom_dicomserie
    ImageTableName = dicom_dicomimage
    DMarkTableName = DICOMAccessUpdates
    RegisteredMOPDeviceTable = RegisteredMOPIDs
    UIDToMOPIDTable = dicom_uidmod
    UIDToCDRIDTable = UIDToCDRID


    # Banner and host for debug information
    PACSName = MYPACS
    OperatorConsole = 127.0.0.1


    # Configuration of disk(s) to store images
    MAGDeviceThreshhold = 0
    #MAGDeviceFullThreshhold = 30
    MAGDevices = 2
    MAGDevice0 = /home/netpacs/dicom
    MAGDevice1 = /home/netpacs/dicom2
    DCMDICTPATH = /home/netpacs/data/


    # Host not used, name, username and password for ODBC data source
    SQLHost = localhost
    SQLServer = netpacs
    Username = netpacs
    Password = netpacs
    PostGres = 1


    Thanks.

  • Hi,


    you edited the table names, likely there is one place where the table name is hardcoded. This query will then fail because the table does not exist.


    I would use the default table names.


    Marcel

  • Hi,


    if you can find out which operation fails I can try and update (fix) the code that generates the SQL statement. However, it does not have a very high priority since you seem to be the first ever to change these names...


    Marcel

  • Hi all,


    in reality, i have found the problem...
    When there are too many directories in the storage directory of the studies, it can't create directory (new patient) anymore.
    It was my problem.
    I think it's a filesystem problem and not dgate problem...


    In order to not to have this problem anymore, i should create many directories for many MAGS :
    MAG0 = /home/toto/dicom1
    MAG1 = /home/toto/dicom2
    ...


    But i would like to know how to indicate when dgate have to change MAG0 to MAG1 with condition ?????
    For instance :
    - limit to a number of patient
    - limit to a directory size (if size of MAG0 = 2 To then use MAG1) ???


    Thanks.

  • Hi,


    Normal MAG switching to e.g. MAG1 occurs when MAG0 is full. You can use a Lua script to set Data.Storage which will force MAG switching by a script. However, counting folders is a very slow way to determine when to switch. You can more easily add more subdivisions to MAG0 using FileNameSyntax to reduce the number of subfolders on one level, for instance using FileNameSyntax = %id[0,0]\%id\%studyuid\%seriesuid\%sopuid.dcm


    Marcel

  • Hi Marcel and thanks,


    instead of counting studies in MAG to change MAG0 to MAG1, is it easily possible to do it by testing size og MAG0 ?
    eg :
    if size(MAG0) >= 1To then write on MAG1
    if size (MAG1) >= 1To then write on MAG2


    by doing that on a same volume, we do not have to create many differents partitions on disk to separate MAGx...


    Do you understand ?
    I think this option would be useful ???


    Many thanks.

  • Hi,


    if you ask for the disk space on a volume in standard lua you could script this. I do not think this call is currenyly available though. Most people use e.g. a substring of the studydate in the filename syntyax to distribute data of many folders rather than using multiple mag's.


    Marcel

Participate now!

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