Exemplo n.º 1
0
    def __init__(self, parent):
        CEventEditDialog.__init__(self, parent)
        self.diagnosticRecord = None
        self.availableDiagnostics = []
        self.mapSpecialityIdToDiagFilter = {}

        self.actEditClient = QtGui.QAction(u'Изменить описание клиента', self)
        self.actEditClient.setObjectName('actEditClient')
        self.setupUi(self)
        self.setWindowFlags(QtCore.Qt.Dialog
                            | QtCore.Qt.WindowMaximizeButtonHint
                            | QtCore.Qt.WindowCloseButtonHint)
        self.setWindowTitleEx(u'"Карточка травматика" Ф.025')

        if not QtGui.qApp.isEventLockEnabled():
            self.lblLock.setVisible(False)
            self.chkLock.setVisible(False)
        elif QtGui.qApp.userHasAnyRight((urAdmin, urEventLock)):
            self.chkLock.setEnabled(True)

        self.cmbTraumaType.setTable('rbTraumaType', False)

        self.txtClientInfoBrowser.actions.append(self.actEditClient)
        self.actEditClient.setEnabled(
            QtGui.qApp.userHasAnyRight([urAdmin, urRegTabWriteRegistry]))

        self.setupDirtyCather()
        self.setIsDirty(False)

        self.cmbResult.setShowFields(CRBComboBox.showCodeAndName)
Exemplo n.º 2
0
 def setRecord(self, record):
     self.cmbResult.setTable('rbResult', True)
     CEventEditDialog.setRecord(self, record)
     setLineEditValue(self.edtNumber, record, 'externalId')
     setDatetimeEditValue(self.edtEndDate, self.edtEndTime, record,
                          'setDate')
     setRBComboBoxValue(self.cmbPerson, record, 'execPerson_id')
     setDatetimeEditValue(self.edtBegDate, self.edtBegTime, record,
                          'execDate')
     setRBComboBoxValue(self.cmbPerson2, record, 'setPerson_id')
     self.chkAutopsy.setChecked(forceInt(record.value('isPrimary')) == 1)
     self.setPersonId(self.cmbPerson.value())
     self.setContract()
     setRBComboBoxValue(self.cmbResult, record, 'result_id')
     setRBComboBoxValue(self.cmbContract, record, 'contract_id')
     setTextEditValue(self.edtNote, record, 'note')
     self.loadDiagnostics(self.modelPreliminaryDiagnostics)
     self.loadDiagnostics(self.modelFinalDiagnostics)
     self.loadActions()
     self.tabCash.load(self.itemId())
     self.tabNotes.setNotes(record)
     self.tabNotes.setEventEditor(self)
     self.tabNotes.updateReferralPeriod(self.edtBegDate.date())
     self.initFocus()
     self.setIsDirty(False)
     self.blankMovingIdList = []
     self.setEditable(self.getEditable())
     setOrgStructureIdToCmbPerson(self.cmbPerson)
Exemplo n.º 3
0
 def setEventTypeId(self, eventTypeId):
     CEventEditDialog.setEventTypeId(self, eventTypeId, u'Ф.025Тр')
     showTime = getEventShowTime(eventTypeId)
     self.edtBegTime.setVisible(showTime)
     self.edtEndTime.setVisible(showTime)
     self.cmbResult.setTable('rbResult', False,
                             'eventPurpose_id=\'%d\'' % self.eventPurposeId)
Exemplo n.º 4
0
 def setEventTypeId(self, eventTypeId):
     CEventEditDialog.setEventTypeId(self, eventTypeId, u'Ф.106')
     self.tabCash.windowTitle = self.windowTitle()
     showTime = getEventShowTime(eventTypeId)
     self.edtBegTime.setVisible(showTime)
     self.edtEndTime.setVisible(showTime)
     if self.cmbResult.value() is None:
         if self.inheritResult == True:
             self.cmbResult.setValue(
                 self.defaultEventResultId.get(self.eventPurposeId))
     self.updateResultFilter()
     self.diagnosisSetDateVisible = forceBool(
         getDiagnosisSetDateVisible(eventTypeId))
     if self.diagnosisSetDateVisible == False:
         self.tblFinalDiagnostics.setColumnHidden(2, True)
         self.tblPreliminaryDiagnostics.setColumnHidden(2, True)
Exemplo n.º 5
0
 def setRecord(self, record):
     CEventEditDialog.setRecord(self, record)
     setLineEditValue(self.edtCardNo, record, 'externalId')
     setDatetimeEditValue(self.edtBegDate, self.edtBegTime, record,
                          'setDate')
     setDatetimeEditValue(self.edtEndDate, self.edtEndTime, record,
                          'execDate')
     setRBComboBoxValue(self.cmbPerson, record, 'execPerson_id')
     setRBComboBoxValue(self.cmbResult, record, 'result_id')
     # setComboBoxValue(self.cmbOrder,         record, 'order')
     self.cmbOrder.setCode(forceString(record.value('order')))
     setCheckBoxValue(self.chkLock, record, 'locked')
     self.setPersonId(self.cmbPerson.value())
     self.loadDiagnostics()
     self.initFocus()
     self.setIsDirty(False)
     self.setEditable(self.getEditable())
Exemplo n.º 6
0
 def getEventInfo(self, context):
     result = CEventEditDialog.getEventInfo(self, context)
     # ручная инициализация свойств
     result._isPrimary = False
     # ручная инициализация таблиц
     result._actions = CActionInfoProxyList(
         context,
         [self.tabStatus.modelAPActions, self.tabMisc.modelAPActions],
         result)
     result._diagnosises = CDiagnosticInfoProxyList(
         context,
         [self.modelPreliminaryDiagnostics, self.modelFinalDiagnostics])
     return result
Exemplo n.º 7
0
    def getRecord(self):
        record = CEventEditDialog.getRecord(self)
        showTime = getEventShowTime(self.eventTypeId)

        getLineEditValue(self.edtCardNo, record, 'externalId')
        getDatetimeEditValue(self.edtBegDate, self.edtBegTime, record,
                             'setDate', showTime)
        getDatetimeEditValue(self.edtEndDate, self.edtEndTime, record,
                             'execDate', showTime)
        getRBComboBoxValue(self.cmbPerson, record, 'execPerson_id')
        getRBComboBoxValue(self.cmbResult, record, 'result_id')
        # getComboBoxValue(self.cmbOrder,         record, 'order')
        record.setValue('order', toVariant(self.cmbOrder.code()))
        getCheckBoxValue(self.chkLock, record, 'locked')
        return record
Exemplo n.º 8
0
    def getRecord(self):
        record = CEventEditDialog.getRecord(self)
        showTime = getEventShowTime(self.eventTypeId)
        #перенести в exec_ в случае успеха или в accept?
        getRBComboBoxValue(self.cmbContract, record, 'contract_id')
        #        getDateEditValue(self.edtPrevDate,      record, 'prevEventDate')
        getLineEditValue(self.edtNumber, record, 'externalId')
        getDatetimeEditValue(self.edtEndDate, self.edtEndTime, record,
                             'setDate', showTime)
        getRBComboBoxValue(self.cmbPerson2, record, 'setPerson_id')
        getDatetimeEditValue(self.edtBegDate, self.edtBegTime, record,
                             'execDate', showTime)
        getRBComboBoxValue(self.cmbPerson, record, 'execPerson_id')
        getRBComboBoxValue(self.cmbResult, record, 'result_id')
        record.setValue('isPrimary',
                        toVariant(1 if self.chkAutopsy.isChecked() else 2))
        self.tabNotes.getNotes(record, self.eventTypeId)
        # getTextEditValue(self.edtNote,          record, 'note')
        ###  payStatus

        return record
Exemplo n.º 9
0
 def checkDataEntered(self):
     result = CEventEditDialog.checkDataEntered(self)
     begDate = self.edtBegDate.date()
     endDate = self.edtEndDate.date(
     ) if self._isClosedEventCheck else QtCore.QDate()
     result = result and (forceStringEx(self.edtCardNo)
                          or self.checkInputMessage(u'номер карты', False,
                                                    self.edtCardNo))
     result = result and (not begDate.isNull() or self.checkInputMessage(
         u'дату происшествия', False, self.edtBegDate))
     result = result and (not endDate.isNull() or self.checkInputMessage(
         u'дату обращения', False, self.edtEndDate))
     result = result and (self.cmbPerson.value() or self.checkInputMessage(
         u'врач', False, self.cmbPerson))
     result = result and (self.cmbOrder.currentIndex()
                          or self.checkInputMessage(u'порядок поступления',
                                                    False, self.cmbOrder))
     result = result and (self.cmbTraumaType.value()
                          or self.checkInputMessage(u'тип травмы', False,
                                                    self.cmbTraumaType))
     result = result and self.checkDiagnosticDataEntered()
     # result = result and (self.cmbResult.value()   or self.checkInputMessage(u'результат',   False, self.cmbResult))
     return result
Exemplo n.º 10
0
    def __init__(self, parent):
        CEventEditDialog.__init__(self, parent)
        self.mapSpecialityIdToDiagFilter = {}

        #прим: '8' - код типа диагноза "предв. причина смерти", '9' код типа диагноза "предв.соп."
        self.addModels('PreliminaryDiagnostics',
                       CF106DiagnosticsModel(self, '8', '10'))
        #прим: '4' - код типа диагноза "причина смерти", '9' код типа диагноза "сопутствующий"
        self.addModels('FinalDiagnostics',
                       CF106DiagnosticsModel(self, '4', '9'))

        self.actEditClient = QtGui.QAction(u'Изменить описание клиента', self)
        self.actEditClient.setObjectName('actEditClient')
        self.setupUi(self)

        self.setWindowFlags(QtCore.Qt.Dialog
                            | QtCore.Qt.WindowMaximizeButtonHint
                            | QtCore.Qt.WindowCloseButtonHint)
        self.setWindowTitleEx(u'Ф.106/у')

        self.tabToken.setFocusProxy(self.tblPreliminaryDiagnostics)

        self.tabStatus.setEventEditor(self)
        self.tabMisc.setEventEditor(self)
        self.tabCash.setEventEditor(self)
        self.tabStatus.setActionTypeClass(0)
        self.tabMisc.setActionTypeClass(3)
        self.cmbContract.setCheckMaxClients(True)

        # мы полагаем, что cmbPerson - свой врач,
        # мы полагаем, что cmbPerson2 - любой паталогоанатом (код специальности - 51)
        self.cmbPerson2.setOrgId(None)
        self.cmbPerson2.setSpecialityId(
            forceRef(
                QtGui.qApp.db.translate('rbSpeciality', 'code', '51',
                                        'id')))  # magic!
        # мы полагаем, что cmbStatusPerson - свой врач,
        # мы полагаем, что cmbMiscPerson - свой врач,

        self.tblPreliminaryDiagnostics.setModel(
            self.modelPreliminaryDiagnostics)
        self.tblFinalDiagnostics.setModel(self.modelFinalDiagnostics)
        self.tabCash.addActionModel(self.tabStatus.modelAPActions)
        self.tabCash.addActionModel(self.tabMisc.modelAPActions)

        self.markEditableTableWidget(self.tblPreliminaryDiagnostics)
        self.markEditableTableWidget(self.tblFinalDiagnostics)

        self.tblPreliminaryDiagnostics.addCopyDiagnos2Final(self)
        self.txtClientInfoBrowser.actions.append(self.actEditClient)
        self.actEditClient.setEnabled(
            QtGui.qApp.userHasAnyRight([urAdmin, urRegTabWriteRegistry]))

        self.setupDirtyCather()
        self.setIsDirty(False)
        self.blankMovingIdList = []
        self.tabNotes.setEventEditor(self)
        self.cmbResult.setShowFields(CRBComboBox.showCodeAndName)

        self.edtNote.setDocument(self.tabNotes.edtEventNote.document())

        self.postSetupUi()
Exemplo n.º 11
0
 def exec_(self):
     result = CEventEditDialog.exec_(self)
     if result:
         self.print_()
     return result