Phase 2: Metadata Check Database Query

Back to Database Queries

         
        SELECT
          "institution"."name" as "Institution",                -- anonymized name of institution
          "machine"."id" as "Machine",                          -- anonymized name of machine
          "machineType"."model",                                -- type of machine
          "multileafCollimator"."model" as "Collimator",        -- HD or Millenium
          "output"."dataDate",                                  -- time and date that data was collected
       -- "output"."analysisDate",                              -- time and date that data was analyzed
          "metadataCheck"."beamName",                           -- name of beam in RTPLAN
          "metadataCheck"."gantryAnglePlan_deg",                -- planned gantry angle in degrees
          "metadataCheck"."gantryAnglePlanMinusImage_deg",      -- difference from planned gantry angle in degrees
          "metadataCheck"."collimatorAnglePlan_deg",            -- planned collimator angle in degrees
          "metadataCheck"."collimatorAnglePlanMinusImage_deg",  -- difference from planned collimator angle in degrees
          "metadataCheck"."x1JawPlan_mm",                       -- planned jaw position in mm
          "metadataCheck"."x1JawPlanMinusImage_mm",             -- difference from planned jaw position in mm
          "metadataCheck"."x2JawPlan_mm",                       -- planned jaw position in mm
          "metadataCheck"."x2JawPlanMinusImage_mm",             -- difference from planned jaw position in mm
          "metadataCheck"."y1JawPlan_mm",                       -- planned jaw position in mm
          "metadataCheck"."y1JawPlanMinusImage_mm",             -- difference from planned jaw position in mm
          "metadataCheck"."y2JawPlan_mm",                       -- planned jaw position in mm
          "metadataCheck"."y2JawPlanMinusImage_mm",             -- difference from planned jaw position in mm
          "metadataCheck"."energyPlan_kev",                     -- planned energy in kilo electron volts
          "metadataCheck"."energyPlanMinusImage_kev",           -- difference from planned energy in kilo electron volts
          "metadataCheck"."flatteningFilter"                    -- true if a flattening filter was present
        FROM
          public."metadataCheck",
          public."institution",
          public."machine",
          public."machineType",
          public."multileafCollimator",
          public."output"
        WHERE
              ("metadataCheck"."outputPK" = "output"."outputPK")
          AND ("output"."machinePK" = "machine"."machinePK")
          AND ("machine"."institutionPK" = "institution"."institutionPK")
          AND ("machine"."machineTypePK" = "machineType"."machineTypePK")
          AND ("machine"."multileafCollimatorPK" = "multileafCollimator"."multileafCollimatorPK")
        ORDER BY
          "institution"."name",
          "machine"."id",
          "output"."dataDate",
          "metadataCheck"."beamName"
        ASC LIMIT 10;