~ubuntu-branches/ubuntu/trusty/ginkgocadx/trusty

« back to all changes in this revision

Viewing changes to src/cadxcore/commands/secondarycapturedicomizecommand.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2013-07-21 11:58:53 UTC
  • mfrom: (7.2.1 sid)
  • Revision ID: package-import@ubuntu.com-20130721115853-44e7n1xujqglu78e
Tags: 3.4.0.928.29+dfsg-1
* New upstream release [July 2013]
  + new B-D: "libjsoncpp-dev".
  + new patch "unbundle-libjsoncpp.patch" to avoid building bundled
    "libjsoncpp-dev".
  + new patch "fix-wx.patch" to avoid FTBFS due to missing
    "-lwx_gtk2u_html-2.8".
* Removed unnecessary versioned Build-Depends.
* Removed obsolete lintian override.
* Reference get-orig-source implementation for orig.tar clean-up and
  DFSG-repackaging.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *
 
3
 *  $Id: dicomizecommand.cpp $
 
4
 *  Ginkgo CADx Project
 
5
 *
 
6
 *  Copyright 2008-12 MetaEmotion S.L. All rights reserved.
 
7
 *  http://ginkgo-cadx.com
 
8
 *
 
9
 *  This file is licensed under LGPL v3 license.
 
10
 *  See License.txt for details
 
11
 *
 
12
 *
 
13
 */
 
14
#include "secondarycapturedicomizecommand.h"
 
15
#include <api/ivista.h>
 
16
#include <api/controllers/icontroladorlog.h>
 
17
#include <api/ientorno.h>
 
18
#include <api/dicom/dcmdictionary.h>
 
19
#include <export/tagsprivadoscomunes.h>
 
20
#include <main/controllers/dicommanager.h>
 
21
#include <main/controllers/controladoreventos.h>
 
22
#include <api/integration/dict.h>
 
23
#include <api/internationalization/internationalization.h>
 
24
#include <eventos/scgenerated.h>
 
25
 
 
26
#include <wx/datetime.h>
 
27
 
 
28
GADAPI::SecondaryCaptureDicomizeCommandParameters::SecondaryCaptureDicomizeCommandParameters(GNC::GCS::IVista* pView, const std::string& screenShot) : GADAPI::DicomizeCommandParams(GNC::GCS::Ptr<GNC::GUI::ImportationData>()),
 
29
        m_pView(pView),
 
30
        m_screenShot(screenShot)
 
31
{
 
32
        m_originalImagePath = m_pView->GetCurrentDICOM();
 
33
        m_openAfterDicomize = false;
 
34
}
 
35
 
 
36
GADAPI::SecondaryCaptureDicomizeCommand::SecondaryCaptureDicomizeCommand(::GADAPI::SecondaryCaptureDicomizeCommandParameters* pParams) : ::GADAPI::DicomizeCommand(pParams),
 
37
        m_pSecondaryParams(pParams)
 
38
{
 
39
}
 
40
 
 
41
void GADAPI::SecondaryCaptureDicomizeCommand::Update()
 
42
{
 
43
        DicomizeCommand::Update();
 
44
 
 
45
        //send an event to the view and add current series...
 
46
        GNC::GCS::ControladorEventos::Instance()->ProcesarEvento(new GNC::GCS::Events::SCGeneratedEvent(m_pSecondaryParams->m_pView, m_pIntegracionParams->m_InsertedSeries));
 
47
}
 
48
 
 
49
bool GADAPI::SecondaryCaptureDicomizeCommand::ImportarFicherosOriginales()
 
50
{
 
51
        //fill in parameters...
 
52
        GIL::DICOM::DICOMManager manager;
 
53
        GIL::DICOM::DicomDataset base;
 
54
        manager.CargarFichero(m_pSecondaryParams->m_originalImagePath, base);
 
55
        
 
56
        GNC::GCS::Ptr<GNC::GUI::ImportationData>& ImportData = m_pSecondaryParams->m_pImportData;
 
57
                //patient module atributes
 
58
        ImportData->baseImages.tags[GKDCM_PatientName] = base.getTag(GKDCM_PatientName); 
 
59
        ImportData->baseImages.tags[GKDCM_PatientID] = base.getTag(GKDCM_PatientID); 
 
60
        ImportData->baseImages.tags[GKDCM_PatientBirthDate] = base.getTag(GKDCM_PatientBirthDate); 
 
61
        ImportData->baseImages.tags[GKDCM_PatientSex] = base.getTag(GKDCM_PatientSex);  
 
62
        ImportData->baseImages.tags[GKDCM_IssuerOfPatientID] = base.getTag(GKDCM_IssuerOfPatientID);  
 
63
                //study module atributes
 
64
        ImportData->baseImages.tags[GKDCM_StudyInstanceUID] = base.getTag(GKDCM_StudyInstanceUID);  
 
65
        ImportData->baseImages.tags[GKDCM_StudyDate] = base.getTag(GKDCM_StudyDate);  
 
66
        ImportData->baseImages.tags[GKDCM_StudyTime] = base.getTag(GKDCM_StudyTime);  
 
67
        ImportData->baseImages.tags[GKDCM_StudyDescription] = base.getTag(GKDCM_StudyDescription);  
 
68
        ImportData->baseImages.tags[GKDCM_ReferringPhysicianName] = base.getTag(GKDCM_ReferringPhysicianName);  
 
69
        ImportData->baseImages.tags[GKDCM_StudyID] = base.getTag(GKDCM_StudyID);  
 
70
        ImportData->baseImages.tags[GKDCM_AccessionNumber] = base.getTag(GKDCM_AccessionNumber);
 
71
                //series module attributes
 
72
        ImportData->baseImages.tags[GKDCM_Modality] = "SC";
 
73
        ImportData->baseImages.tags[GKDCM_SeriesDescription] = _Std("Ginkgo CADx Secondary Capture");
 
74
        ImportData->baseImages.tags[GKDCM_Laterality] = base.getTag(GKDCM_Laterality);
 
75
        wxDateTime date = wxDateTime::Now();
 
76
        ImportData->baseImages.tags[GKDCM_InstanceCreationDate] = ImportData->baseImages.tags[GKDCM_SeriesDate] =  std::string(date.Format(wxT("%Y%m%d")).ToUTF8());
 
77
        ImportData->baseImages.tags[GKDCM_InstanceCreationTime] = ImportData->baseImages.tags[GKDCM_SeriesTime] =std::string(date.Format(wxT("%H%M%S")).ToUTF8());
 
78
 
 
79
                //sc module
 
80
        ImportData->baseImages.tags[GKDCM_ConversionType] = "DI";
 
81
        
 
82
                //fill in image file
 
83
        ImportData->m_SourceFiles.push_back(m_pSecondaryParams->m_screenShot);
 
84
        //call original operation!
 
85
        return GADAPI::DicomizeCommand::ImportarFicherosOriginales();
 
86
}
 
87
 
 
88
//on update add to view!
 
 
b'\\ No newline at end of file'