     amp.bnf_code,
     amp.descr AS name,
     form_route
-  FROM ebmdatalab.dmd.amp
+  FROM {project}.{dmd}.amp
   INNER JOIN vmps ON amp.vmp = vmps.vpid
   WHERE vmp in (SELECT vpid FROM vmps) AND amp.bnf_code IS NOT NULL
 ),

    vmpp.bnf_code,
    vmpp.nm AS name,
    form_route
  FROM ebmdatalab.dmd.vmpp
  INNER JOIN vmps ON vmpp.vmp = vmps.vpid
  WHERE vmp in (SELECT vpid FROM vmps) AND vmpp.bnf_code IS NOT NULL
),

    bnf_code,
    nm AS name,
    ontformroute.descr AS form_route
  FROM {project}.{dmd}.vmp
  INNER JOIN {project}.{dmd}.ont ON vmp.id = ont.vmp
  INNER JOIN {project}.{dmd}.ontformroute ON ont.form = ontformroute.cd
),

amps AS (
