The following code might be useful to other Integrated Data Infrastructure (IDI) users in the Virtual Health Information Network (VHIN).

Catalyst projects

Costs of cardiovascular disease in NZ

This is the SAS code file from the first stage of the VHIN catalyst project ‘Costs of cardiovascular disease in NZ’. The code creates a file with:
– individual-level health costs from PHO, NMDS, NNPAC, labs and pharmaceuticals
– flags and dates for cardiovascular events
– basic demographic information

Risk factors for congenital malformations in NZ

This is the SAS code file from the VHIN catalyst project ‘Risk factors for congenital malformations in NZ’. The code creates a data file for use in the VHIN ‘Congenital Malformations’ catalyst project. It includes code for linking babies to parents via birth records and creating flags for pharmaceuticals prescribed during pregnancy.

Getting the denominator right

This is the first of the SAS code files from the VHIN catalyst project ‘Getting the denominator right’. The code creates a list of the resident population of NZ for a given date, with basic demographic information attached. The methodology is based on that used by Statistics NZ’s Census Transformation team (selects people into the population if they have had activity in health, tax, or education data in the last 12 months, then removes people who died or moved overseas).

This is the second of two SAS code files from the VHIN catalyst project ‘Getting the denominator right’. This code creates a dataset with a range of demographic, geographic, health (mostly cardiovascular) and pharmaceutical variables for everyone in the NZ resident population.

See the page Identifying the NZ ERP in the IDI  for more information about identifying a population in the IDI.


The above code documents are also available on the IDI Wiki and on Meetadata. You can request to access Meetadata by emailing You can access Meetadata outside of the IDI using a RealMe login.

Examples of IDI code are also publically accessible from Statistics New Zealand and on GitHub – StatisticsNZ/IDI – an IDI code sharing website used by NZ government agencies.