Extract Drug File

Version 2.22

This XSL stylesheet produces the Drug extract file (Drug yyyymmdd.txt) from a PBS XML document. Only ready prepared and infusible items are extracted.

The source document must be a PBS XML document.

The result document is a text file.

The default field delimeter in this file is the exclamation mark (!).

Field Name Format Maximum Length Description
Program Code Character 2 two character alphabetic, see separate table below
ATC Code Character 8 refer to file ATC yyyymmdd.txt
ATC Type Character 1

one character alphabetic, one value:

  • P - primary reference
ATC Print Option Character 1

determines how THIS drug item listed under THIS ATC code is printed in the Schedule of Pharmaceutical Benefits - one character numeric, one value:

  • 1 - print full entry ONLY
PBS Code Character 5 Five or six character in format (n)nnnna; for allocations of PBS code blocks see separate table below
Restriction Flag Character 1

one character alphabetic, three possible values:

  • U - unrestricted
  • R - restricted benefit
  • A - authority required
Caution Flag Character 1 one character alphabetic, C if Caution attached, otherwise blank
Note Flag Character 1 one character alphabetic, N if Note(s) attached,otherwise blank
Maximum Quantity (Maximum Amount for infusible items) Character 5 the maximum quantity (units-of-use) published in the Schedule
Number of Repeats Character 2 the maximum number of repeats published in the Schedule
Manufacturer's Code Character 2 two character alphabetic, refer to file Mnfr yyyymmdd.txt
Pack Size Character 4 the quantity contained in the manufacturer's pack
Mark-up Code Character 1

one character alphabetic (current rates in file Fees yyyymmdd.txt), four values:

  • A - no mark-up (section 100 drug types)
  • B - 50% (not currently in use)
  • C - standard six-tier ready-prepared mark-up; the price to pharmacist for maximum quantity determines which tier applies
  • D - HSD four-tier ready-prepared mark-up; the price to pharmacist for maximum quantity determines which tier applies
  • E - one-tier ready-prepared mark-up
Dispense Fee Type Code Character 2

two characters alphabetic (current rates in file Fees yyyymmdd.txt), four values:

  • NF - no fee (section 100 drug types)
  • RP - ready-prepared
  • EP - extemporaneously-prepared
  • EW - extemporaneously-prepared + purified water
Dangerous Drug Fee Code Character 2 DD (current rate in file Fees yyyymmdd.txt) if dangerous drug fee payable, otherwise blank
Brand Premium Character 10
Therapeutic Group Premium Character 10 This is the Therapeutic Group Premium (or Special Patient Contribution)
Commonwealth Price to Pharmacist Character 10 Reimbursement price-to-pharmacist for manufacturer's pack. For S100 programs this value is the price ex-manufacturer.
Commonwealth Dispensed Price for Maximum Quantity (Maximum Amount for infusible items) Character 10
Therapeutic Group Manufacturer's Price to Pharmacist Character 10 This is the Therapeutic Group Manufacturer's Price to Pharmacist (or Special Patient Contribution Manufacturer's Price to Pharmacist) (for manufacturer's pack). For S100 programs this value is the price ex-manufacturer.
Therapeutic Group Manufacturer's Dispensed Price for Maximum Quantity Character 10 This is the Therapeutic Group Manufacturer's Dispensed Price for Maximum Quantity (or Special Patient Contribution Manufacturer's Dispensed Price for Maximum Quantity) (for manufacturer's pack).
Manufacturer's Price to Pharmacist Character 10 For manufacturer's pack. For S100 programs this value is the price ex-manufacturer.
Manufacturer's Dispensed Price for Maximum Quantity (Maximum Amount for infusible items Character 10
Maximum Recordable Value for Safety Net Character 10 Maximum Recordable Value for Safety Net
Bioequivalence Indicator Character 1 Bioequivalence Indicator
Brand Name Character 45 MAY be truncated at 45 characters
Drug (MP) Name Character 80 MAY be truncated at 80 characters
AMT MPP preferred term Character 150 MAY be truncated at 150 characters

Parameters

Parameter: "include-header"

Default value: "0"

Header row

Whether to include a header row. Often useful for debugging purposes.

Parameter: "delimiter"

Default value: ""!""

Delimiter

The character to use to separate fields.

Parameter: "qnames"

Default value: "true()"

QNames

Whether to use QNames or expanded URIs.

Parameter: "testing-mode"

Default value: "false()"

Testing

Indicates testing mode. Currently this inserts a markup code where one can not be determined from the data

Parameter: "truncate"

Default value: "true()"

Truncate

Indicates whether or not to truncate fields to fit the maximum length. Default is true (truncate fields).

Revision History

Version Release date Changes
2.22 31 October 2013 Use common template for translating characters to ASCII.
2.21.2 30 August 2013 Further fix to brand-substitution when TPP is deleted.
2.21.1 08 August 2013 Fixed brand-substitution when TPP is deleted.
2.21 22 July 2013 Change sorting of TPPs to make infusible entries more stable. Remove rwt:prescriber-instruction content from notes.
2.20.3 29 April 2013 Update documentation.
2.20.2 05 March 2013 Fix MRVSN in no-premium pricing model.
2.20.1 08 January 2013 Fix unstable bioequivalence indicator.
2.20 19 December 2012 Added parameter option to choose to not truncate fields.
2.19.2 18 December 2012 Fixed brand substitution indicator
2.19.1 22 November 2012 Fixed translation of #233 character from y to e
2.19 08 November 2012 Added sorting of results.
2.18.3 07 November 2012 Added documentation.
2.18.2 23 October 2012 Fixed error in determining bioequivalence indicator. When determining DD fee code also consider whether fee is defined in dispensing rule. Moved default dispensing rule to common module.
2.17 17 September 2012 Fixed error in determining manufacturer DPMQ.
2.16.1 10 September 2012 Fixed errors in determining bioequivalence flag.
2.16 22 August 2012 Changed determination of bioequivalence flag for LBSGs.
2.15 15 August 2012 Added in parameter and code for testing purposes to insert a markup code where one isn't able to be determined from the data.
2.14 14 August 2012 Fixed bug for finding notes where administrative-advice-reference children of restrictions weren't considered.
2.13.2 18 July 2012 Performance optimisation.
2.13.1 30 May 2012 Check MPP for dangerous drug group membership.
2.13 16 May 2012 Use both QNames and URIs for dispensing rules. Use named templates to allow customisation.
2.12 01 December 2011 Fix the Ready-prepared Therapeutic Group Manufacturer's dpmq value
2.11 29 November 2011 Allocate bio-equivalence brand substitution group values (a or b)
2.10 24 November 2011 Fix note inclusion plus exclude notes with non-numeric codes (e.g. cto and scm)
2.9 24 November 2011 Fixed caution identification
2.8 22 November 2011 Assign ATC type value based on postion in classification
2.7 22 November 2011 Fixed incorrect truncation of drug-name to be 80 characters instead 150. Added new dispensing rule variable for special access items and changed determination of the dr.this variable for TY and TZ program codes.
2.6 18 November 2011 Fixes for infusible drugs and caution flags
2.5 14 November 2011 Modified keys to address performance issues
2.4 31 October 2011 Fee type code now correctly handles infusibles.
2.3 21 October 2011 Updated for PBS XML v2.6.
2.2.2 11 October 2011 Fixed MRVSN for infusible items.
2.2.1 06 October 2011 Fixed markup code.
2.2 27 September 2011 Changed URIs for dispensing rules.
2.1 22 June 2011 Added support for infusibles.
2.0.1 14 June 2011 Fixed blank dollar values. Fixed note flag.
2.0 15 February 2011 Updated for PBS XML Schema v2.4.
1.1 25 September 2009 Updating for new pricing model.
1.0 27 August 2009 Initial version.