Primary maternity service data collection (PMSDC) file specifications

These file specifications describe the:

  • electronic file format used to send data to us, including layout
  • error messages
  • business rules used to validate the data fields with the maternity records file.

The following XSD schema documents the set of rules to which the XML files must conform in order to be considered 'valid'.

XSD schema documents

This service guide helps hospitals send primary maternity data to Health NZ.

PMDCS service guide

NBRS, NMDS and NNPAC file specifications

The following file specification information is for the:

  • National Booking Reporting System (NBRS)
  • National Minimum Dataset (NMDS)
  • National Non-admitted Patient Collection (NNPAC).

These file specifications include the:

  • file layout
  • business rules used for validating the data items within the file, to a lesser extent.

There are 2 audiences for this document.

  • Software developers designing, implementing and altering provider systems to make sure they export information in a format suitable for loading into the national collection.
  • Business analysts verifying that all required data elements are present and specified correctly.

Processing information and error messages

The pre-processor checks the basic integrity of hospitals' data files. Assuming all the records can be read, the whole batch is checked along with the header. All errors and warnings are then reported back to the originating facility in the error report.

Files are loaded in chronological order. If an agency sends an update to the same health event in consecutive files, all earlier information is already loaded. If the file passes the pre-processor, it moves on to the processor.

The following checks are carried out.

  1. The pre-processor identifies the format of the file and confirms that the file header is the first record and that it is readable.
  2. Several checks are carried out within the header record to make sure that the record type and processing environment are correct. These are checks on date sent, that health agency is a valid one and that it matches the abbreviation.
  3. The pre-processor checks the records accompanying the header record are correct record types and have the correct number of fields.

If any of these errors are found an error file is created and further processing stops.

The contents of each data file are checked against the business rules and loaded it into holding tables. A record is also kept of the number of existing records that have been affected by this file, including:

  • events inserted and deleted
  • number of records with errors and warnings
  • other operating information such as processing time.

There are several fields stored in the data collections that are derived from other fields, including the DRG. These are calculated during this part of the editing process. The edit/error module also maps ICD-10-AM and ICD-9-CM-A diagnosis codes.

The data is then moved from the load tables into the databases.

Error number

This number consists of 3 parts.

Application_code
A 3-letter code assigned to identify each software application — in this case NAP for the NNPAC datamart, or NMS for NMDS.
Error_ID
This is a unique number, for example 1003.
Error_type:
Severity of message:
  • E — error
  • W — warning
  • C — caution).

Currently, there are no warnings in NNPAC validation. From 1 July 2008, a caution is used to describe why data is considered invalid. Data producing a caution will be accepted and loaded.

Error type description

A detailed description of the error and suggestions for why it may have arisen. Lists of allowed values can be found in the file specification.

Error and warning message

This is the message that is sent back to providers. It may contain substitution parameters, prefixed with '%', which the program fills in with the particular value. For example, the value '%2' is not a valid value for the field '%1'.

If the error or warning message is listed as 'to be assigned', the number is not currently used.

NBRS, NMDS and NNPAC file specification downloads

NBRS file specification for file version 04.5

The NBRS file specification should be read together with the NBRS data dictionary.

Data dictionaries

NMDS file specification

NMDS file specification v16.3 for file version 015.0

The NMDS file specification should be read together with the NMDS (hospital event) data dictionary.

Data dictionaries

NMDS error messages

NMDS collection error messages

Programme for the Integration of Mental Health Data (PRIMHD) file specifications

This document is the principal reference for all providers who submit data to PRIMHD. This may be:

  • business and data quality analysts involved in supporting and maintaining the PRIMHD collection
  • vendors and software suppliers developing or delivering the technical capability to districts or non-government organisations.

It describes the electronic file format used to send data to PRIMHD, including:

  • layout
  • error messages
  • business rules used to validate the data fields in the PRIMHD records file.

These schemas for the PRIMHD extract make up part of the PRIMHD file specification.

PRIMHD legal status and referral discharge schema

Private hospital file specifications

Private hospitals supply discharge data to Health NZ for around 130,000 health events each year.

This document provides a generic file layout to use when sending data to us.

The layout allows for both coded and uncoded data to be submitted — at least one field must be populated. This is because some private hospitals code data while others send descriptions which we translate into valid codes.

The following file layout is modelled on the information that private hospitals supply on the paper form ADF96. Some fields are mandatory and these are indicated by the value 'M' in column 2 of the table.

As a general rule, codes and descriptions may be supplied. But if no coded value is used in the local system, a description must be supplied.

Field name Mandatory Length Type Comment
ID M 14 Char Local system unique identifier for this record.
Purchaser code M 2 Char Code describing the organisation or person paying for this hospital event
Health agency M 4 Char Agency code — created for each hospital by Health NZ
Health agency facility M 4 Char Health Agency Facility (HAF) code — created for each hospital by Health NZ
NHI number n/a 7 Char National Health Index number — generally assigned by Health NZ, optionally assigned by hospital
Family name M 25 Char Surname
First name M 20 Char First given name
Second name n/a 20 Char Second given name
Third name n/a 20 Char Third given name
Address line 1[Note 1] M 35 Char 1st address line
Address line 2 n/a 30 Char 2nd address line
Address line 3 n/a 30 Char 3rd address line
Address line 4 n/a 30 Char 4th address line
Address line 5 n/a 30 Char 5th address line
Date of birth M 8 Char CCYYMMDD
Domicile code n/a 4 Char Generated by access to the NHI from the address
NZ residence status n/a 1 Char Y or N — is the patient a NZ resident?
Ethnic code 1[Note 1] n/a 2 Char Refer to the Ethnic code table
Ethnic description 1 n/a 20 Char Ethnic group description — first
Ethnic code 2 n/a 2 Char Refer to the Ethnic code table
Ethnic description 2 n/a 20 Char Ethnic group description — second
Ethnic code 3 n/a 2 Char Refer to the Ethnic code table
Ethnic description 3 n/a 20 Char Ethnic group description — third
Gender M 1 Char Sex of healthcare user — F or M
Admission source code[Note 1] n/a 1 Char Routine admission (R) or transferred to this hospital from another hospital (T).
Admission source description n/a 30 Char Description of above
Admission date M 8 Char CCYYMMDD
Discharge date M 8 Char CCYYMMDD
Event end type code[Note 1] M 2 Char Type of separation — refer to the code table
Event end type description n/a 25 Char Description of separation type
Weight on admission[Note 2] n/a 4 Char For infants less than (<) 29 days only.
Gestation period[Note 2] n/a 2 Char For infants born in hospital only
Age of mother[Note 2] n/a 2 Char For infants born in hospital only
Diagnosis type[Note 1] n/a 1 Char A code denoting whether the following fields pertain to a diagnosis, operation, or an accident. Enter A for principal diagnosis, B for other diagnosis, O for procedure and E for accident — external cause codes
Diagnosis, operation or accident description[Note 1] M 50 Char Diagnosis, operation, or accident description
Diagnosis, operation or accident code[Note 1] n/a 8 Char Diagnosis, operation, or accident ICD-10-AM code
Coding system code n/a 2 Char ‘06’ for ICD-9-CM-A, '10' for ICD-10-AM 1st Edition, '11' for ICD-10-AM 2nd Edition, '12' for ICD-10-AM 3rd Edition, '13' for ICD-10-AM 6th Edition
Operation or accident date[Note 1] n/a 8 Char Date of operation or accident (CCYYMMDD) Where the Diagnosis type is O or E the date of the operation or the accident is required

Note 1 — Load file layout notes

Field name Explanation
Address line 1 Supply sufficient address details including street and city or district. This allows us to derive a domicile code.
Ethnic code or description Try to to supply a code(s) or description. A code table is available if you want to use these codes in your system.
Admission source code Supply either a text description or a code. A code table is available if you want to use these codes in your system.
Event end type code Supply either a text description or a code. A code table is available if you want to use these codes in your system.
Diagnosis type
  • For an operation use ‘O’.
  • For an external cause, accident, use ‘E’.
  • For principal diagnoses use ‘A’.
  • If you are able to report more than one diagnosis code enter use ‘B’.
Diagnosis, operation or accident description Supply a description for each diagnosis, operation or accident, whether or not a code can be supplied.
Diagnosis, operation or accident code

Supply a code to indicate the version of codes that you are reporting.

  • ICD9-CM-A the code is '06'
  • ICD-10-AM 1st edition the code is '10'
  • ICD-10-AM 2nd edition the code is '11'
  • ICD-10-AM 3rd edition the code is '12'
  • ICD-10-AM 6th edition the code is '13'
Operation or accident date Supply a date for each operation and each accident.

Note 2 — Extra information for infants’ records

The following are only relevant for hospitals reporting maternity cases. Note that a separate discharge record is required for the mother and infant.

The infant’s record should contain the following additional information.

Field name Explantion
Weight on admission The weight of an infant, in grams, upon admission to hospital.
Gestation period This is the period of gestation, in weeks.
Age of mother This is the age of the mother at the time of the birth, in completed years.

File naming convention

When supplying a file to Health NZ, name it according to the following convention — AAAnnnnn.CSV

  • AAA is an acronym for each hospital which is supplied by the Ministry of Health.
  • nnnnn represents ‘0’ (zero) year and month of the latest discharge record included in the file. For example, 00506 is a file containing data up to June 2005.

File type

The load file should be sent as a comma-separated values (.csv) file. All character variables should be enclosed in double quotation marks. Below is a sample record containing one diagnosis, one operation and one accident. Note that we have included both coded values and their descriptions in the sample record.

Sample load file for a coded file using ICD-10-AM 6th edition coding

ID,PURCHASER CODE, HEALTH AGENCY, HAF,NHI,SURNAME,FIRSTNAM,SECNAME,THIRDNAM,ADD1,ADD2,ADD3,ADD4,ADD5,DOB,DOMCODE,NZRES,ETH1,ETHDESC1,ETH2,ETHDESC2,ETH3,ETHDESC3, GENDER,ADMSRC,ADMDESC,ADMDATE,DISDATE,DISTYPE,DISDESC,ADMWGT,GEST,MOTHAGE,DIAGTYPE01,DESC01,DIAGCODE01,CODESYS01,OPDATE01,DIAGTYPE02,DESC02,DIAGCODE02,CODESYS02,
OPDATE02,DIAGTYPE03,DESC03,DIAGCODE03,CODESYS03,OPDATE03

“1234567","13","8331","8331","AAA9999","FamilyName","FirstName","SecondName","ThirdName","Address Line 1","Address Line 2","Address Line 3","Address Line 4","Address Line 5","19510224","2077","Y","21","maori","43","indian","52","chinese","M","R","Routine admission","20080631","20080702","DR","Routine discharge",,,,"A","Fracture head of Femur","S7200","13",,"O","Total hip replacement","","13","20080631","E","Fell “,"W19","13","20080631"

“1234567","13","0001","9999","AAA9999","Smith","John","Henry","David","1 Seaview Drive","Hillcrest","Whakatane","","","19510224","9999","Y","21","","43","","52","","M","R","Routine admission","20080631","20080702","DR","Routine discharge","6754","24","36","A","Fracture head of Femur","S7200","13","","O","Total hip replacement","","","20080631","E","Fell out of bed in hosp","W069","13","20080631","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""
“1234568","06","8268","8268","AB01243","Te Rukuihi","Marenata","M","","112 Florence Drive","Morrinsville","","","","19510330","","","","English","","French","","","F","","Transfer from Tauranga hospital","20080722","20080724","","Routine Discharge","","","","O"," Rib resection / r trans axillary rib removal","","","20080722","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""
“1234569","06","8268","8268","","","","M","","12 Fiorenza Drive","Hamilton","","","","19661225","","","","German","","Russian","","","F","","Home","20080715","20080723","","Died","","","","O"," Rib resection / r trans axillary rib removal","","","20080722","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""

The code tables contain the standard codes used by Health NZ to code the following data elements:

  • ethnic group — race
  • admission source — source
  • event end type — separation type.

Ethnic group codes

Code Description
10 European not further defined
11 NZ European or Pakeha
12 Other European
21 NZ Māori
30 Pacific Island not further defined
31 Samoan
32 Cook Island Māori
33 Tongan
34 Niuean
35 Tokelauan
36 Fijian
37 Other Pacific Island
40 Asian not further defined
41 South East Asian
42 Chinese
43 Indian
44 Other Asian
51 Middle Eastern
52 Latin American or Hispanic
53 African
99 Not stated

Admission source codes

Code Description
R Routine admission
T Transferred from another facility

Event end type codes

Code Description
DA Discharge to acute facility
DC Psychiatric patient discharged to community care
DD Died
DI Self-discharge from hospital, indemnity signed
DL Psych patient on leave > 10 days from psych institution
DN Psych remand patient discharged w/o committal
DO Patient kept sustainable for organ donation
DP Psych patient transferred for further psychiatric care
DR Ended routinely
DS Self discharge from hospital
DT Non-psych patient tfrd to non-psych facility
DW Discharge to other service within same facility