Price structure and Contracts within GoodX

15. Hospital Prices

15.1. New Year Price Updates - Technical

Building the files

Requirements needed:


Setting up the environment

  • Install Postgresql.
  • Install Python 2.7.
  • Install MS Office.
  • Create a folder on the desktop (In the example it will be \builder).
  • Copy the two py files to this folder.
  • Copy and extract the xlrd folder into this folder.


  • Copy the nhn_compare.sql file into the full access folder (c:\goodx)


Building the dmnc files

  • Copy the NHN 2019 excel files into the desktop folder (\builder)
  • Exclude pricelist 100 WCA and also make sure there are no duplicate pricelists (example v1, v2, etc).


  • Hold in shift and right-click in the folder window on a open space and click Open Command window here.


  • Type the following command and hit the enter key: Build_nhn_dmfp_with_discription.py 2019.
    • Notice the [space] 2019 at the end. This will be the previous year.


  • The script will run through all the excels and build dmfp files. If there is an issue in the excel like the example below you first have to fix it then run the command again. The error will indicate the excel number, the line number and more or less an indication of the problem.


  • Once successful, the script will generate dmfp files per discipline. Copy these files into the full access folder (c:\goodx).
  • Follow the same process for the 2020 (new year) dmfp files using the new excel files and copy the dmfp files into the full access folder (c:\goodx).


  • Open the nhn_compare.sql in postgresql.
    • Confirm paths
    • Confirm years example 2019 = previous year; 2020 = this year.
    • Execute the script, if there is duplicate entries please fix first. The error should indicate the year, code, description.
    • Once executed successfully the script will generate the dmnc file per discipline accompanied by a csv with the differences per pricelist.


Building the dmfp files


  • Since the 2020 (new year) excels is already in the desktop folder (\builder) you can just do the following:
  • Type the following command and hit the enter key: Build_nhn_dmfp_without_discription.py 2020.
    • Notice the [space] 2020 at the end. This will be the new year.
  • This will generate the dmfp files for you.