
**********************************************************************
*                                                                    *
*			     PERCALC.EXE   			     *
*                                                                    *
*   FEV1 and height reference curves for Cystic Fibrosis patients    *
*                                                                    *
*                (c) Michal Kulich, October 2005                     *
*                                                                    *
*                                                                    *
**********************************************************************


A command-line Windows executable converting between:

1. FEV1 [L] and CF FEV1 percentiles (given gender and height and/or
   age)
2. Height [cm] and CF height percentiles (given gender and height and/or
   age)

(This tool was compiled on Windows XP machine with Pentium 4 processor.
It may not work with other hardware/other versions of Windows.)


				Usage:
				------

percalc CASE GENDER ARG1 ARG2 [ARG3]

				where

CASE             ...  one of the values 1,2,...,8
		      determines what will be calculated (see below)
GENDER           ...  gender: 0 = female, 1 = male
ARG1, ARG2, ARG3 ...  other patient data (see below)


			       Output:
			       -------

2 or 4 numbers (calculated value, error code, sometimes adjusted
height and error code for height calculation - see the cases below)


				CASES
				-----


Height quantiles:

   CASE=1
      Calculation of height [cm] given height quantile, age, gender
      ARG1=ht quantile [0.01-0.99], ARG2=age [yrs]

      Returns height [cm], error code

   CASE=2
      Calculation of height quantile given height [cm], age, gender
      ARG1=ht [cm], ARG2=age [yrs]

      Returns height quantile [0.01-0.99], error code


FEV1 quantiles:

   FEV-for-age quantiles:

      CASE=3
	  Calculation of FEV1 [L] given FEV1 quantile, age, gender
	  ARG1=FEV1 quantile [0.01-0.99], ARG2=age [yrs]

	  Returns FEV1 [L], error code

      CASE=4
	  Calculation of FEV1 quantile given FEV1 [L], age, gender
	  ARG1=FEV1 [L], ARG2=age [yrs]

	  Returns FEV1 quantile [0.01-0.99], error code


   FEV-for-height quantiles:

      CASE=5
          Calculation of FEV1 [L] given FEV1 quantile, height, gender
	  ARG1=FEV1 quantile [0.01-0.99], ARG2=height [cm]

	  Returns FEV1 [L], error code

      CASE=6
          Calculation of FEV1 quantile given FEV1 [L], height, gender
	  ARG1=FEV1 [L], ARG2=height [cm]

	  Returns FEV1 quantile [0.01-0.99], error code


   FEV-for-age-and-height quantiles:

      CASE=7
          Calculation of FEV1 [L] given FEV1 quantile, height, age,
	  gender 
	  ARG1=FEV1 quantile [0.01-0.99], ARG2=height [cm], ARG3=age [y]

	  Returns FEV1 [L], error code, adjusted height, height error
	  code

      CASE=8
          Calculation of FEV1 quantile given FEV1 [L], height, age,
          gender
	  ARG1=FEV1 [L], ARG2=height [cm], ARG3=age [y]

	  Returns FEV1 quantile [0.01-0.99], error code, 
		  adjusted height, height error code

      For cases 7 and 8: height is adjusted up or down if it lies
      outside the "normal" height range for CF patients of given age.


***********************************************************************


ERROR codes:

     0 ... OK
     1 ... percentile outside the range 0.01-0.99
     3 ... age over 40
     4 ... age under 6
     5 ... height below 105 cm
     6 ... height over 180/190 cm
    11 ... FEV_1 below 1st percentile
    22 ... FEV_1 above 99th percentile
    77 ... indeterminate percentile (lower and upper bound
                   more than 0.01 apart)

HEIGHT ERROR codes:

     0 ... OK
    44 ... height was too low -> adjusted up
    55 ... height was too high -> adjusted down


***********************************************************************

Reference: 

Kulich, M., Rosenfeld, M., Campbell, J., Kronmal, R., Gibson, R.G.,
Goss, C.H., and Ramsey, B. (2005) Disease-specific reference equations
for lung function in patients with cystic fibrosis. American Journal
of Respiratory and Critical Care Medicine, 172, 885-891.

***********************************************************************
