/* * 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. */ #ifndef RESULTS_H_ #define RESULTS_H_ #pragma interface /* BTW: results.h+results.cc is the only compilation unit that depends * on HL7. If ASTM mapping is required, only these files have to be * changed! */ #include #include #include #include struct Result { friend class Battery; public: Result(int specimen_id, int observ_id, const char *value, int unit_id, bool error = false); private: ORUmsg::GRPgrp::OBRgrp::OBXgrp _obx; }; struct Battery { friend class Batteries; friend class Job; int type; char *error; public: void settype(int); void seterror(const char*); void append(const Result*); Battery(int t = 0) { error = NULL; settype(t); } Battery(const Battery &); ~Battery(); const Battery &operator=(const Battery &); private: ORUmsg::GRPgrp::OBRgrp _obr; }; struct Batteries { friend class Job; public: void append(const Battery*); private: repstruc _robr; }; struct Time : public TMtyp { public: Time(int h, int m) : TMtyp(h, m, 0) {} }; struct Date : public DTtyp { public: Date(int y, int m, int d) : DTtyp(y, m, d) {} }; struct TimeStamp : public TStyp { public: TimeStamp(const Date *d, const Time *t) : TStyp(*d, *t) {} }; struct Header { friend class Job; public: int sample_no; // OBR.FilOrderNum int operator_id; // OBR.Tec char *patient_id; // PID.PatIdExtId int specimen_type; // OBR.SpeSou struct TimeStamp *time_stamp; // OBR.SpeRecDateTime struct Battery *pre_observ; char *error; Header(); ~Header(); }; struct Job { friend void eject(Job *); public: Job(Header *h, Batteries *b); private: ORUmsg::GRPgrp _grp; }; void eject(Job *); void toLOINC(int iMs, int iUn, int iSp, NMtyp &val, Loinc &loinc, Unit &iso_unit); const char *analyzer(int); const char *specimen(int); #endif /* ! RESULTS_H_ */