56 #include <ThirdPartyWarningsDisable.h>
57 #include "dcmtk/config/osconfig.h"
58 #include "dcmtk/ofstd/ofstream.h"
59 #include "dcmtk/dcmdata/dcfilefo.h"
60 #include <ThirdPartyWarningsRestore.h>
126 void _addMainParameterFields();
129 void _addMainDICOMTagFields();
136 void _setUpContentParameters(DSRDocument &doc)
const;
144 void _setUpContentTree(DSRDocument &doc,
149 void _doFinalDocumentSettings(DSRDocument &doc)
const;
153 template <
typename DCMTK_OBJECT_TYPE>
154 void _setBaseTagValues(DCMTK_OBJECT_TYPE &doc)
const
156 OFString studyIDODStr = toOFString(_generalStudyModule._studyIDFld->getStringValue());
157 if (!studyIDODStr.empty()){
158 doc.setStudyID(studyIDODStr);
159 doc.createNewSeriesInStudy(studyIDODStr);
161 doc.setStudyDescription (toOFString(_generalStudyModule._studyDescriptionFld ->getStringValue()));
162 doc.setSeriesDescription (toOFString(_generalSeriesModule._seriesDescriptionFld ->getStringValue()));
163 doc.setPatientName (toOFString(_patientModule._patientsNameFld ->getStringValue()));
164 doc.setPatientBirthDate (toOFString(_patientModule._patientBirthDateYearStringFld ->getStringValue() +
165 _patientModule._patientBirthDateMonthStringFld ->getStringValue() +
166 _patientModule._patientBirthDateDayStringFld ->getStringValue()));
167 doc.setPatientSex (toOFString(_patientModule._patientSexStringFld ->getStringValue()));
168 doc.setPatientID (toOFString(_patientModule._patientIDFld ->getStringValue()));
170 doc.setManufacturer (toOFString(_generalEquipmentModule.manufacturerAddOn .getValueFld().getStringValue()));
171 doc.setManufacturerModelName (toOFString(_generalEquipmentModule.manufacturersModelNameAddOn.getValueFld().getStringValue()));
172 doc.setReferringPhysicianName (toOFString(_generalStudyModule._referringPhysicianNameFld ->getStringValue()));
173 doc.setDeviceSerialNumber (toOFString(_generalEquipmentModule.deviceSerialNumberAddOn .getValueFld().getStringValue()));
174 doc.setSoftwareVersions (toOFString(_generalEquipmentModule.softwareVersionsAddOn .getValueFld().getStringValue()));
175 doc.setContentDate (toOFString(_generalImageModule._contentDateFld ->getStringValue()));
176 doc.setContentTime (toOFString(_generalImageModule._contentTimeFld ->getStringValue()));
177 doc.setSeriesNumber (toOFString(_generalSeriesModule._seriesNumberFld ->getStringValue()));
178 doc.setInstanceNumber (toOFString(_generalImageModule._instanceNumberFld ->getStringValue()));
179 doc.setAccessionNumber (toOFString(_generalStudyModule._accessionNumberFld ->getStringValue()));
183 #define _SR_PRINT_DOC_SAVE(A) \
184 shortStream << #A << ":" << ((doc.get##A(tmp,-1) == EC_Normal) ? tmp : "") << std::endl;
193 template <
typename DCMTK_OBJECT_TYPE>
194 static void _createDumps(DCMTK_OBJECT_TYPE &doc,
195 std::string &shortInfo,
196 std::string &longXMLInfo)
200 std::ostringstream fullXMLStream;
202 doc.writeXML(fullXMLStream, 0);
203 fullXMLStream << std::endl;
204 longXMLInfo = fullXMLStream.str();
208 std::ostringstream shortStream;
209 shortStream <<
"DICOM Information from file:" << std::endl;
239 shortStream << std::endl;
240 shortInfo = shortStream.str();
243 #undef _SR_PRINT_DOC_SAVE
248 BoolField *_saveAsHTMLFld;
251 StringField *_longHTMLInfoFld;
254 BoolField *_saveAsDCMFld;
257 BoolField *_saveAsXMLFld;
260 StringField *_shortInfoFld;
263 StringField *_longXMLInfoFld;
266 EnumField *_documentTypeFld;
269 DicomPatientModuleTagInterface _patientModule;
272 DicomGeneralStudyModuleTagInterface _generalStudyModule;
275 DicomGeneralSeriesModuleTagInterface _generalSeriesModule;
278 DicomGeneralEquipmentModuleTagInterface _generalEquipmentModule;
281 DicomGeneralImageModuleTagInterface _generalImageModule;
285 BoolField *_completeDocumentFld;
287 StringField *_docCompletionDescriptionFld;
291 BoolField *_verifyDocumentFld;
293 StringField *_verifyDocumentObserverNameFld;
295 StringField *_verifyDocumentOrganizationFld;
299 BoolField *_finalizeDocumentFld;
302 BoolField *_preliminaryFlagFld;
305 StringField *_documentTitleFld;
308 StringField *_documentIntroTitleFld;
311 StringField *_documentIntroFld;
314 void _addTextSectionFields();
317 NumDocumentSections = 5
320 EnumField *_codingValueAndMeaningFld[NumDocumentSections];
322 StringField *_codeMeaningFld[NumDocumentSections];
324 BoolField *_openSubSectionFld[NumDocumentSections];
326 BoolField *_closeSubSectionFld[NumDocumentSections];
328 StringField *_subSectionContainerTitleFld[NumDocumentSections];
330 StringField *_subSectionTitleFld[NumDocumentSections];
332 StringField *_subSectionTextFld[NumDocumentSections];
334 StringField *_sectionTextFld[NumDocumentSections];
338 void _addInputConnectorFields();
342 NumInputConnectorFields = 10
346 StringField *_inputFld[NumInputConnectorFields];
Project global and OS specific declarations.
#define MLDICOMOUTPUTS_EXPORT
DLL export macro definition.
Creates and composes a DICOM structured report and exports it to different file formats or fields....
Field to encapsulate a boolean value.
std::string _checkConsistency() const override
Checks for invalid parameters which could cause problems in document creation and return textual desc...
void _save() override
Creates a structured report DICOM objects and saves it in the file given by _fileNameFld.
DicomSRSave()
Constructor.
StringField & getLongXMLInfoField() const
Field access, see corresponding field for details.
static void checkOFCondition(const OFCondition &cond, const std::string &loc)
Check the passed condition cond for bad(), and if yes, then an ML error message is generated includin...
StringField & getShortInfoField() const
void _inheritFieldValuesFromDCMTree(DCMTree::Const_TreePtr dcmTree) override
Overloads base class field inheritance and adds the additional tags needed by this class.
void activateAttachments() override
Updates the internal module state after loading or cloning the module, and enables notification handl...
const BoolField & getSaveAsXMLField() const
void handleNotification(Field *field) override
Handles field changes of the field field.
static OFString toOFString(std::string str)
Converts an std::string to an OFString and replaced tabs by four spaces.
const BoolField & getSaveAsDCMField() const
virtual std::string _setUpTreeContent()=0
Allows the user to apply changes to the tree before it is saved; called after _updateInputState() and...
Base class for all fields used in the ML.
Class which represents an image, which manages properties of an image and image data which is located...
Field to encapsulate a string value.
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.
Header file for the ML module base class DicomGeneralEquipmentModuleTagInterface.
Header file for the ML module base class DicomGeneralImageModuleTagInterface.
Header file for the ML module base class DicomGeneralSeriesModuleTagInterface.
Header file for the ML module base class DicomGeneralStudyModuleTagInterface.
Header file for the ML module base class DicomPatientModuleTagInterface.
#define _SR_PRINT_DOC_SAVE(A)
Helper macro to print an attribute of the document.
Header file for the ML module base class DicomSaveBase.
boost::shared_ptr< const Tree > Const_TreePtr