Exemple #1
0
    def loadData(self, eventId):
        record = None
        db = QtGui.qApp.db
        tableAction = db.table('Action')

        propertyDefList = []
        for row in xrange(self.rowCount()):
            for column in xrange(self.columnCount()):
                propertyName = self.getPropertyName(row, column)
                if propertyName is not None:
                    propertyDefList.append({'name' : propertyName,
                                         'descr' : None,
                                         'unit' : None,
                                         'typeName' : 'String',
                                         'valueDomain' : None,
                                         'isVector' : False,
                                         'norm' : None,
                                         'sex' : None,
                                         'age' : None
                                         })

        actionTypeFlatCode = u'calfTeeth' if self._isCalf else u'permanentTeeth'
        ensureActionTypePresence(actionTypeFlatCode, propTypeList = propertyDefList, isUseFlatCode=True)
        actionType = CActionTypeCache.getByFlatCode(actionTypeFlatCode)
        if eventId:
            cond  = [tableAction['deleted'].eq(0),
                     tableAction['event_id'].eq(eventId),
                     tableAction['actionType_id'].eq(actionType.id)]

            record = db.getRecordEx(tableAction,
                                    '*',
                                    cond,
                                    order = 'idx')
        self._dentalNotationAction = CAction(record = record if record else None,
                                             actionType = actionType)
Exemple #2
0
 def __init__(self, parent=None):
     QtGui.QDialog.__init__(self, parent)
     self.setupUi(self)
     self.setBusynessEnabled(False)
     self.setMKBFilterEnabled(False)
     try:
         actionType = CActionTypeCache.getByFlatCode('deathCurcumstance')
     except:
         actionType = None
     self.preparePropertyComboBox(self.cmbPlace, actionType, u'Смерть последовала')
     self.preparePropertyComboBox(self.cmbCause, actionType, u'Смерть произошла')
     self.preparePropertyComboBox(self.cmbFoundBy,    actionType, u'Причина установлена')
     self.preparePropertyComboBox(self.cmbFoundation, actionType, u'Основание')
     self.cmbSocStatusType.setTable('vrbSocStatusType', True)
     self.cmbSocStatusType.setShowFields(CRBComboBox.showNameAndCode)
Exemple #3
0
def addCondForDeathCurcumstance(cond, tableEvent, place, cause, foundBy, foundation):
    db = QtGui.qApp.db
    try:
        actionType = CActionTypeCache.getByFlatCode('deathCurcumstance')
    except:
        actionType = None
    tableAction = db.table('Action')
    table = tableAction
    condActionProperties = []
    table, condActionProperties = addCondActionProperties(tableAction, table, condActionProperties, actionType, u'Смерть последовала', place)
    table, condActionProperties = addCondActionProperties(tableAction, table, condActionProperties, actionType, u'Смерть произошла', cause)
    table, condActionProperties = addCondActionProperties(tableAction, table, condActionProperties, actionType, u'Причина установлена', foundBy)
    table, condActionProperties = addCondActionProperties(tableAction, table, condActionProperties, actionType, u'Основание', foundation)
    if condActionProperties:
        condActionProperties.append(tableAction['event_id'].eq(tableEvent['id']))
        cond.append(db.existsStmt(table, condActionProperties))