%{ /* * Copyright (c) 1995, 1996 Gunther Schadow. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * C DECLARATIONS */ #include "abl300.h" #include "results.h" extern "C" { void yyerror(const char *); int yylex(); } class Header *the_header; class Battery *the_battery; %} %union { long integer; char *string; char chr; void *object; int symbol; bool boolean; struct Job *message; struct Header *header; struct Batteries *batteries; struct Battery *battery; struct Result *result; struct TimeStamp *timestamp; struct Date *date; struct Time *time; } /* * TOKENS */ %token COPY %token PROG %token TIME %token DATE %token OPID %token PTID %token SPEC /* The following four blocks of terminals are used as coded values. Thus * they are presented as tables. Each of them begin with a symbol named * like "_ORG" and "
_END" (e.g. MEASUREMENT_ORG and * MEASUREMENT_END). It is assumed that the yacc (or bison) program will * make integer macros from the %token directives preserving the sequence * of occurence in the yacc source. Thus, the ..._ORG and ..._END symbols * denotes the origins and ends of the tables and are not used as terminal * tokens by themselves nor do they have any other meaning apart from a mere * offset. * * The tables are: * 1. SPECIMEN CODE * 2. MEASUREMENT CODE * 3. UNIT CODE while units are already translated to ISO+ units * by the scanner (returning a string rather than a symbol) * 4. ANALYZER CODE */ %token SPECIMEN_ORG /* SPEC CODE */ %token BLANK_SPEC %token CAPILLARY_SPEC %token ARTERIAL_SPEC %token VENOUS_SPEC %token GAS_SPEC /* quality check codes */ %token QC_UNKNOWN_SPEC %token QC_S2030_SPEC %token QC_S2040_SPEC %token QC_S2050_SPEC %token QC_S2060_SPEC /* implicit specimen for entered values */ %token IHG_SPEC /* inhaled gas: FIO2 */ %token PAT_SPEC /* patient: TEMP */ %token BLD_SPEC /* where artherial/venous is meaningless (E'lytes) */ %token SPECIMEN_END %token MEASUREMENTS_ORG /* MEASUREMENTS * * ABL MEANING FORMAT * ----- --------------------------------- -----------------*/ %token ABE /* actual base excess value G% MM/L */ %token BARO /* barometric pressure value MMHG KPA */ %token CA /* actual calcium value value MM/L */ %token CA_S /* corrected calcium value value MM/L */ %token CO2 /* CO2 content value % */ %token FCO2 /* CO2 content (fraction) value */ %token FO2 /* O2 content (fraction) value */ %token H /* free protons value NM/L */ %token HB /* hemoglobin value value G% MM/L */ %token HBCO /* HBCO value value % */ %token HBO2 /* oxygenated hemoglobin value value % */ %token HCO3 /* bicarbonate value value MM/L */ %token K /* potassium value value MM/L */ %token METHB /* methemoglobin value value % */ %token NA /* sodium value value MM/L */ %token O2 /* O2 content value % */ %token O2CT /* oxigen content value value VOL% MM/L */ %token P50E /* P50 value if entered value MMHG KPA */ %token P50C /* calculated P50 value value MMHG KPA */ %token PCO2 /* pCO2 value value MMHG KPA */ %token PH /* pH value value */ %token PO2 /* pO2 value value MMGH KPA PA */ %token SAT /* oxigen saturation value value % */ %token SBC /* standard bicarbonate value value MM/L */ %token SBE /* standard base excess value value MM/L */ %token TCO2 /* total CO2 value value MM/L */ %token FIO2 /* fraction of inspired oxygen value */ %token TEMP /* patient temperature value C F */ %token MEASUREMENTS_END %token UNITS_ORG /* UNITS * * ABL ISO(HL7) * -------- --------------*/ %token C_UN /* CEL */ %token F_UN /* DEGF */ %token MMHG_UN /* MM(HG) */ %token KPA_UN /* KPAL */ %token PA_UN /* PAL */ %token PC_UN /* % */ %token GPC_UN /* % */ %token VOLPC_UN /* % */ %token NMPL_UN /* NM/L */ %token MMPL_UN /* MMOL/L */ %token ONE_UN /* 1 -- implicit unit */ %token UNITS_END %token ANALYZERS_ORG /* ANALYZERS */ %token PRE_ANA /* pre observations: FIO2 and TEMP */ %token DEF_ANA /* default analyzer */ %token OSM_ANA /* Hemoximeter */ %token ICA_ANA /* Calcium */ %token KNA_ANA /* Sodium, Potassium */ %token ANALYZERS_END /* MONTHNAMES */ %token JAN_MON %token FEB_MON %token MAR_MON %token APR_MON %token MAY_MON %token JUN_MON %token JUL_MON %token AUG_MON %token SEP_MON %token OCT_MON %token NOV_MON %token DEC_MON /* VALUES */ %token INT1 %token INT2 %token INT3 %token INT4 %token INT5_ %token REAL %token STRINGH %token STRING %token PTIDVAL /* MISCELLANEOUS TERMINALS */ %token EOLN %token SPACE %token QMARK %token COLON %token EMPTYLINE %token SPACES %token DISCARD %token END_OF_FILE /* * NONTERMNINAL SYMBOL TYPES */ %type message %type results_message %type eom %type eob %type
header %type
head_block %type samp_no %type intnum %type errormsg %type errorline %type time_stamp %type