dm d data model - bennettoxford/openprescribing GitHub Wiki

We have written a blog on what is the NHS dm+d which is useful introductory reading.

Further useful reading: https://archive.psnc.org.uk/pages/dmd.html

The dmd app has the following models:

  • DMDProduct
    • each row is either a VMP or an AMP
    • databaset table: dmd_product
    • key fields:
      • dmdid: the primary key
      • vpid: identifier of VMP; matches dmdid if concept_class is 1
      • concept_class: 1 if product is VMP; 2 if AMP
      • bnf_code: BNF code of product -- note that a BNF code may be used for multiple VMPs
      • name
  • DMDVmpp
    • each row is a combination of virtual product and pack size
    • database table: dmd_vmpp
    • key fields:
      • vppid: the primary key
      • vpid: reference to dmd_vmp.vpid (note that we don't have a DMDVmp model, but the database table exists)
      • nm: the name plus pack size (eg "Paracetamol 500mg effervescent tablets sugar free 24 tablet")
  • NCSOConcession
    • database table: dmd_ncsoconcession
    • key fields:
      • id: the primary key
      • vmpp/vmpp_id: the vppid of the corresponding DMDVmpp object
        • this is set by reconciling the drug and pack_size against DMDVmpp.nm
      • drug: name of the drug according to the NCSO website
      • pack_size: size of pack
      • date: date of concession