00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef DSRCODVL_H
00032 #define DSRCODVL_H
00033
00034 #include "dcmtk/config/osconfig.h"
00035
00036 #include "dcmtk/dcmsr/dsrtypes.h"
00037
00038 #include "dcmtk/ofstd/ofstring.h"
00039
00040
00041
00042
00043
00044
00047 class DSRCodedEntryValue
00048 {
00049
00050 friend class DSRContentItem;
00051
00052 public:
00053
00056 DSRCodedEntryValue();
00057
00068 DSRCodedEntryValue(const OFString &codeValue,
00069 const OFString &codingSchemeDesignator,
00070 const OFString &codeMeaning);
00071
00086 DSRCodedEntryValue(const OFString &codeValue,
00087 const OFString &codingSchemeDesignator,
00088 const OFString &codingSchemeVersion,
00089 const OFString &codeMeaning);
00090
00094 DSRCodedEntryValue(const DSRCodedEntryValue &codedEntryValue);
00095
00098 virtual ~DSRCodedEntryValue();
00099
00104 DSRCodedEntryValue &operator=(const DSRCodedEntryValue &codedEntryValue);
00105
00112 OFBool operator==(const DSRCodedEntryValue &codedEntryValue) const;
00113
00117 virtual void clear();
00118
00123 virtual OFBool isValid() const;
00124
00129 virtual OFBool isEmpty() const;
00130
00142 void print(STD_NAMESPACE ostream &stream,
00143 const OFBool printCodeValue = OFTrue,
00144 const OFBool printInvalid = OFFalse) const;
00145
00156 OFCondition readSequence(DcmItem &dataset,
00157 const DcmTagKey &tagKey,
00158 const OFString &type);
00159
00165 OFCondition writeSequence(DcmItem &dataset,
00166 const DcmTagKey &tagKey) const;
00167
00173 OFCondition readXML(const DSRXMLDocument &doc,
00174 DSRXMLCursor cursor);
00175
00181 OFCondition writeXML(STD_NAMESPACE ostream &stream,
00182 const size_t flags) const;
00183
00193 OFCondition renderHTML(STD_NAMESPACE ostream &stream,
00194 const size_t flags,
00195 const OFBool fullCode = OFTrue,
00196 const OFBool valueFirst = OFFalse) const;
00197
00201 inline const DSRCodedEntryValue &getValue() const
00202 {
00203 return *this;
00204 }
00205
00210 OFCondition getValue(DSRCodedEntryValue &codedEntryValue) const;
00211
00216 inline const OFString &getCodeValue() const
00217 {
00218 return CodeValue;
00219 }
00220
00228 inline const OFString &getCodingSchemeDesignator() const
00229 {
00230 return CodingSchemeDesignator;
00231 }
00232
00238 inline const OFString &getCodingSchemeVersion() const
00239 {
00240 return CodingSchemeVersion;
00241 }
00242
00248 inline const OFString &getCodeMeaning() const
00249 {
00250 return CodeMeaning;
00251 }
00252
00259 OFCondition setValue(const DSRCodedEntryValue &codedEntryValue);
00260
00277 OFCondition setCode(const OFString &codeValue,
00278 const OFString &codingSchemeDesignator,
00279 const OFString &codeMeaning);
00280
00301 OFCondition setCode(const OFString &codeValue,
00302 const OFString &codingSchemeDesignator,
00303 const OFString &codingSchemeVersion,
00304 const OFString &codeMeaning);
00305
00306
00307 protected:
00308
00312 inline DSRCodedEntryValue *getValuePtr()
00313 {
00314 return this;
00315 }
00316
00322 OFCondition readItem(DcmItem &dataset,
00323 const char *moduleName = NULL);
00324
00329 OFCondition writeItem(DcmItem &dataset) const;
00330
00340 OFBool checkCode(const OFString &codeValue,
00341 const OFString &codingSchemeDesignator,
00342 const OFString &codeMeaning) const;
00343
00344
00345 private:
00346
00348 OFString CodeValue;
00350 OFString CodingSchemeDesignator;
00352 OFString CodingSchemeVersion;
00354 OFString CodeMeaning;
00355 };
00356
00357
00358 #endif
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436