Ejemplo n.º 1
0
 def getRecord(self, record):
     dateTime = QDateTime(self.edtDate.date(), QTime().currentTime())
     record.setValue('dateTime', dateTime)
     i = self.cmbSocCodes.currentIndex()
     socCode = forceString(self.cmbSocCodes.itemData(i))
     record.setValue('socCode', socCode)
     pregCard = forceInt(self.edtPregCard.text())
     if pregCard > 0:
         record.setValue('pregCard', pregCard)
     else:
         record.setNull('pregCard')
     getRBComboBoxValue(self.cmbFinance, record, 'finance_id')
     record.setValue('mkb', toVariant(self.cmbMKB.text()))
     getRBComboBoxValue(self.cmbDrug, record, 'formularyItem_id')
     getLineEditValue(self.edtDosage, record, 'dosage')
     getSpinBoxValue(self.spbQnt, record, 'qnt')
     getLineEditValue(self.edtSigna, record, 'signa')
     getSpinBoxValue(self.spbDuration, record, 'duration')
     getSpinBoxValue(self.spbNumPerDay, record, 'numPerDay')
     record.setValue('isVk', int(self.rbtnVkYes.isChecked()))
     record.setValue('printMnn', int(self.rbtnPrintMNN.isChecked()))
     record.setValue('percentage',
                     int(50 if self.rbtn50proc.isChecked() else 100))
     getComboBoxValue(self.cmbTerm, record, 'term')
     record.setValue(
         'status',
         self.modelRecipeStatus.getCode(self.cmbStatus.currentIndex()))
     record.setValue('deleted', 0)
Ejemplo n.º 2
0
Archivo: MKB.py Proyecto: dio4/vista_1
    def getRecord(self):
        db = QtGui.qApp.db
        record = CItemEditorBaseDialog.getRecord(self)
        getLineEditValue(self.edtCode, record, 'DiagID')
        record.setValue(
            'Prim', QtCore.QVariant('*' if self.chkPrim.isChecked() else ''))
        getTextEditValue(self.edtName, record, 'DiagName')
        if self.cmbMKBSubclass.isEnabled():
            getRBComboBoxValue(self.cmbMKBSubclass, record, 'MKBSubclass_id')
        else:
            record.setValue('MKBSubclass_id', QtCore.QVariant())
        getComboBoxValue(self.cmbCharacters, record, 'characters')
        getComboBoxValue(self.cmbSex, record, 'sex')
        record.setValue(
            'age',
            toVariant(
                composeAgeSelector(self.cmbBegAgeUnit.currentIndex(),
                                   forceStringEx(self.edtBegAgeCount.text()),
                                   self.cmbEndAgeUnit.currentIndex(),
                                   forceStringEx(self.edtEndAgeCount.text()))))
        getSpinBoxValue(self.edtDuration, record, 'duration')
        self.modelServiceSpecialty.saveItems(self.itemId())
        record.setValue('begDate', toVariant(self.edtBegDate.date()))
        record.setValue('endDate', toVariant(self.edtEndDate.date()))
        record.setValue('OMS', toVariant(self.chkOMS.isChecked()))
        record.setValue('MTR', toVariant(self.chkMTR.isChecked()))
        record.setValue('parent_code', toVariant(self.parentCode))

        clearCache()
        return record
Ejemplo n.º 3
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getLineEditValue(self.edtCode, record, rbCode)
     getLineEditValue(self.edtName, record, rbName)
     getRBComboBoxValue(self.cmbTestGroup, record, 'testGroup_id')
     getSpinBoxValue(self.edtPosition, record, 'position')
     return record
Ejemplo n.º 4
0
    def getRecord(self):
        record = CItemEditorBaseDialog.getRecord(self)
        getLineEditValue(self.edtCode, record, 'code')
        getLineEditValue(self.edtName, record, 'name')
        getRBComboBoxValue(self.cmbUnit, record, 'unit_id')
        getRBComboBoxValue(self.cmbGroup, record, 'group_id')

        if self.otherTable:
            getLineEditValue(self.edtMnn, record, 'MNN')
            getLineEditValue(self.edtMnnLat, record, 'latinMNN')
        else:
            getLineEditValue(self.edtMnn, record, 'mnn')
            getLineEditValue(self.edtMnnLat, record, 'latinMnn')

        getLineEditValue(self.edtTradeName, record, 'tradeName')
        getLineEditValue(self.edtIssueForm, record, 'issueForm')
        getLineEditValue(self.edtIssueFormLat, record, 'latinIssueForm')
        getLineEditValue(self.edtConcentration, record, 'concentration')
        record.setValue('isDrugs', self.rbtnIsDrugYes.isChecked())
        getRBComboBoxValue(self.cmbBaseUnit, record, 'baseUnit_id')
        getRBComboBoxValue(self.cmbMinIndivUnit, record,
                           'minIndivisibleUnit_id')
        getLineEditValue(self.edtBaseUnitsInMinIndiv, record,
                         'baseUnitsInMinIndivisibleUnit')
        getLineEditValue(self.edtMinIndivInPacking, record,
                         'minIndivisibleUnitsInPackingUnit')
        getRBComboBoxValue(self.cmbPackingUnit, record, 'packingUnit_id')
        return record
Ejemplo n.º 5
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getLineEditValue(self.edtCode, record, 'code')
     getLineEditValue(self.edtName, record, 'name')
     getLineEditValue(self.edtRegionalCode, record, 'regionalCode')
     getRBComboBoxValue(self.cmbDocumentType, record, 'documentType_id')
     return record
Ejemplo n.º 6
0
    def getRecord(self):
        record = CItemEditorBaseDialog.getRecord(self)
        pType = '%.2d' % (self.cmbPaymentType.currentIndex() + 1)
        codePart = '%.2d' % (self.cmbCodePart.currentIndex() + 1)

        if (pType, codePart) in self.codes.keys():
            code = '%s.%s.%.3d' % (pType, codePart, self.codes[(pType,
                                                                codePart)])
        else:
            code = '%s.%s.%.3d' % (pType, codePart, 1)

        record.setValue(rbCode, toVariant(code))
        record.setValue('type', toVariant(self.type))
        getRBComboBoxValue(self.cmbOKPF, record, 'OKPF_id')
        getRBComboBoxValue(self.cmbOrgId, record, 'org_id')
        getLineEditValue(self.edtContractNumber, record, 'contractNumber')
        getDateEditValue(self.edtDate, record, 'contractDate')
        getDateEditValue(self.edtEndDate, record, 'contractEndDate')
        getLineEditValue(self.edtContractSum, record, 'contractSum')
        if QtGui.qApp.checkGlobalPreference('68', u'нет') and type == 2:
            getLineEditValue(self.edtContragent, record, 'contragent')
            getLineEditValue(self.edtProtocolNum, record, 'protocolNumber')
            getLineEditValue(self.edtProtocolPhase, record, 'protocolPhase')
            getLineEditValue(self.edtProtocolName, record, 'protocolName')
            getComboBoxValue(self.cmbRecPatients, record, 'protocolRecruit')
        elif QtGui.qApp.checkGlobalPreference('68', u'нет') and type == 1:
            getLineEditValue(self.edtContragent, record, 'contragent')
            getLineEditValue(self.edtContractItem, record, 'contractItem')
            getLineEditValue(self.edtAddress, record, 'address')
        return record
Ejemplo n.º 7
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getDatetimeEditValue(self.edtDate, self.edtTime, record, 'date', True)
     getRBComboBoxValue(self.cmbSupplier, record, 'supplier_id')
     getRBComboBoxValue(self.cmbSupplierPerson, record, 'supplierPerson_id')
     getLineEditValue(self.edtNote, record, 'note')
     return record
Ejemplo n.º 8
0
    def getLocalContractRecord(self, eventId):
        record = self.localContractRecord
        if self.isControlsCreate and self.grpLocalContract.isChecked():
            record = self.localContractRecord if self.localContractRecord else QtGui.qApp.db.record(
                self.localContractTableName)
            record.setValue('master_id', toVariant(eventId))

            record.setValue(
                'deleted',
                QtCore.QVariant(0 if self.grpLocalContract.isChecked() else 1))

            getDateEditValue(self.edtCoordDate, record, 'coordDate')
            getLineEditValue(self.edtCoordAgent, record, 'coordAgent')
            getLineEditValue(self.edtCoordInspector, record, 'coordInspector')
            getTextEditValue(self.edtCoordText, record, 'coordText')

            getDateEditValue(self.edtContractDate, record, 'dateContract')
            getLineEditValue(self.edtContractNumber, record, 'numberContract')
            getLineEditValue(self.edtSumLimit, record, 'sumLimit')
            getLineEditValue(self.edtLastName, record, 'lastName')
            getLineEditValue(self.edtFirstName, record, 'firstName')
            getLineEditValue(self.edtPatrName, record, 'patrName')
            getDateEditValue(self.edtBirthDate, record, 'birthDate')
            getRBComboBoxValue(self.cmbDocType, record, 'documentType_id')
            getLineEditValue(self.edtDocSerialLeft, record, 'serialLeft')
            getLineEditValue(self.edtDocSerialRight, record, 'serialRight')
            getLineEditValue(self.edtDocNumber, record, 'number')
            getLineEditValue(self.edtRegAddress, record, 'regAddress')
            getRBComboBoxValue(self.cmbOrganisation, record, 'org_id')
        return record
Ejemplo n.º 9
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getLineEditValue(self.edtCode, record, 'code')
     getLineEditValue(self.edtRegionalCode, record, 'regionalCode')
     getLineEditValue(self.edtEISRegionalCode, record, 'eisCode')
     getLineEditValue(self.edtName, record, 'name')
     getRBComboBoxValue(self.cmbService, record, 'service_id')
     return record
Ejemplo n.º 10
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getRBComboBoxValue(self.cmbFirstActionType, record,
                        'firstActionType_id')
     getRBComboBoxValue(self.cmbSecondActionType, record,
                        'secondActionType_id')
     getTextEditValue(self.edtReason, record, 'reason')
     return record
Ejemplo n.º 11
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getLineEditValue(self.edtCode,        record, 'code')
     getLineEditValue(self.edtName,        record, 'name')
     getLineEditValue(self.edtMKB,         record, 'MKB')
     getRBComboBoxValue(self.cmbQuotaType, record, 'quotaType_id')
     getCheckBoxValue(self.chkIsObsolete, record, 'isObsolete')
     return record
Ejemplo n.º 12
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getLineEditValue(self.edtCode, record, 'code')
     getLineEditValue(self.edtName, record, 'name')
     setLineEditValue(self.edtTicketPrefix, record, 'ticketPrefix')
     getRBComboBoxValue(self.edtOrgStructure, record, 'orgStructure_id')
     getCheckBoxValue(self.chkImmediatelyReady, record,
                      'isImmediatelyReady')
     return record
Ejemplo n.º 13
0
    def getRecord(self):
        record = CItemEditorBaseDialog.getRecord(self)
        getLineEditValue(  self.edtCode,                      record, rbCode)
        getLineEditValue(  self.edtName,                      record, rbName)
        record.setValue('color', QtCore.QVariant(self.cmbColor.colorName()))
        getDoubleBoxValue(self.edtAmount, record, 'amount')
        getRBComboBoxValue(   self.cmbUnit,   record, 'unit_id')

        return record
Ejemplo n.º 14
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getDateEditValue(self.edtDate, record, 'date')
     getDatetimeEditValue(self.edtDeadlineDate, self.edtDeadlineTime,
                          record, 'deadline', True)
     getCheckBoxValue(self.chkRevoked, record, 'revoked')
     getRBComboBoxValue(self.cmbSupplier, record, 'supplier_id')
     getRBComboBoxValue(self.cmbRecipient, record, 'recipient_id')
     getLineEditValue(self.edtNote, record, 'note')
     return record
Ejemplo n.º 15
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getLineEditValue(self.edtCode, record, 'code')
     getLineEditValue(self.edtName, record, 'name')
     getCheckBoxValue(self.chkEditable, record, 'isEditable')
     getCheckBoxValue(self.chkShowInClientInfo, record, 'showInClientInfo')
     getCheckBoxValue(self.chkIsUnique, record, 'isUnique')
     getCheckBoxValue(self.chkAutoIdentificator, record,
                      'autoIdentificator')
     getRBComboBoxValue(self.cmbCounter, record, 'counter_id')
     return record
Ejemplo n.º 16
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getRBComboBoxValue(self.cmbType, record, 'type_id')
     getLineEditValue(self.edtCode, record, 'code')
     getLineEditValue(self.edtRegionalCode, record, 'regionalCode')
     getLineEditValue(self.edtName, record, 'name')
     getLineEditValue(self.edtProducer, record, 'producer')
     getLineEditValue(self.edtATC, record, 'ATC')
     getSpinBoxValue(self.spnPackSize, record, 'packSize')
     record.setValue('analog_id',
                     toVariant(self.modelAnalogs.correctAlanogId()))
     return record
Ejemplo n.º 17
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getLineEditValue(self.edtCode, record, 'code')
     getLineEditValue(self.edtFederalCode, record, 'federalCode')
     getLineEditValue(self.edtRegionalCode, record, 'regionalCode')
     getLineEditValue(self.edtName, record, 'name')
     getRBComboBoxValue(self.cmbGroup, record, 'group_id')
     getComboBoxValue(self.cmbSerialFormat, record, 'serial_format')
     getCheckBoxUniqueValue(self.chkDefault, record, rbDocumentType,
                            'isDefault')
     getCheckBoxValue(self.chkForeigner, record, 'isForeigner')
     return record
Ejemplo n.º 18
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getLineEditValue(self.edtName, record, 'name')
     getLineEditValue(self.edtCode, record, 'code')
     getLineEditValue(self.edtText, record, 'title')
     if self.edtRbTableName.isVisible():
         getLineEditValue(self.edtRbTableName, record, 'tableName')
     else:
         record.setValue('tableName', toVariant(u''))
     getRBComboBoxValue(self.cmbValueType, record, 'valueType_id')
     getRBComboBoxValue(self.cmbParamType, record, 'type_id')
     return record
Ejemplo n.º 19
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getLineEditValue(self.edtCode, record, 'code')
     getLineEditValue(self.edtName, record, 'name')
     getRBComboBoxValue(self.cmbRecipientPerson, record, 'recipientPerson_id')
     getDateEditValue(self.edtReleaseDate, record, 'releaseDate')
     getDateEditValue(self.edtSupplyDate, record, 'supplyDate')
     getDateEditValue(self.edtStartOperationDate, record, 'startOperationDate')
     getDateEditValue(self.edtExpiryDate, record, 'expiryDate')
     getSpinBoxValue(self.edtPlanTestQuantity, record, 'planTestQuantity')
     getLineEditValue(self.edtManufacturer, record, 'manufacturer')
     getLineEditValue(self.edtStorageConditions, record, 'storageConditions')
     return record
Ejemplo n.º 20
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getLineEditValue(self.edtCode, record, 'code')
     getLineEditValue(self.edtName, record, 'name')
     getLineEditValue(self.edtShortName, record, 'shortName')
     getLineEditValue(self.edtOKSOName, record, 'OKSOName')
     getLineEditValue(self.edtOKSOCode, record, 'OKSOCode')
     getLineEditValue(self.edtFederalCode, record, 'federalCode')
     getLineEditValue(self.edtRegionalCode, record, 'regionalCode')
     getLineEditValue(self.edtSyncGUID, record, 'syncGUID')
     getRBComboBoxValue(self.cmbLocalService, record, 'service_id')
     getRBComboBoxValue(self.cmbProvinceService, record,
                        'provinceService_id')
     getRBComboBoxValue(self.cmbOtherService, record, 'otherService_id')
     getRBComboBoxValue(self.cmbFundingService, record, 'fundingService_id')
     getComboBoxValue(self.cmbSex, record, 'sex')
     record.setValue(
         'age',
         toVariant(
             composeAgeSelector(self.cmbBegAgeUnit.currentIndex(),
                                forceStringEx(self.edtBegAgeCount.text()),
                                self.cmbEndAgeUnit.currentIndex(),
                                forceStringEx(self.edtEndAgeCount.text()))))
     record.setValue(
         'versSpec',
         toVariant({
             0: '',
             1: 'V004',
             2: 'V015'
         }.get(self.cmbVersSpec.currentIndex(), '')))
     getLineEditValue(self.edtMKBFilter, record, 'mkbFilter')
     return record
Ejemplo n.º 21
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
Ejemplo n.º 22
0
 def getRecord(self):
     record = CItemEditorDialog.getRecord(self)
     #        getLineEditValue( self.edtCode,      record, 'code')
     #        getLineEditValue( self.edtName,      record, 'name')
     getLineEditValue(self.edtContext, record, 'context')
     getLineEditValue(self.edtFileName, record, 'fileName')
     getTextEditValue(self.edtDefault, record, 'default')
     getComboBoxValue(self.cmbDPD, record, 'dpdAgreement')
     getComboBoxValue(self.cmbType, record, 'type')
     getComboBoxValue(self.cmbBanUnkeptData, record, 'banUnkeptDate')
     getRBComboBoxValue(self.cmbCounter, record, 'counter_id')
     getRBComboBoxValue(self.cmbIEMKDoc, record, 'documentType_id')
     getCheckBoxValue(self.chkPatientApply, record, 'isPatientAgreed')
     getLineEditValue(self.edtGroup, record, 'groupName')
     CPrintTemplatesDataCache.reset()
     return record
Ejemplo n.º 23
0
    def getRecord(self):
        record = CItemEditorBaseDialog.getRecord(self)
        getLineEditValue(self.edtCode, record, 'code')
        getLineEditValue(self.edtRegionalCode, record, 'regionalCode')
        getLineEditValue(self.edtFederalCode, record, 'federalCode')
        getLineEditValue(self.edtName, record, 'name')
        getRBComboBoxValue(self.cmbPurpose, record, 'eventTypePurpose_id')

        leftCount, rightCount = forceStringEx(
            self.edtVisitCount.text()).split(u'-')
        leftCount = leftCount.strip()
        rightCount = rightCount.strip()
        if leftCount and rightCount:
            if forceInt(leftCount) > forceInt(rightCount):
                leftCount, rightCount = rightCount, leftCount
        record.setValue(
            'visitCount',
            QtCore.QVariant(leftCount + u'-' +
                            rightCount if leftCount or rightCount else u''))
        return record
Ejemplo n.º 24
0
    def getRecord(self):
        record = self.record()
        showTime = self.action.getType().showTime

        getDatetimeEditValue(self.edtPlannedEndDate, self.edtPlannedEndTime, record, 'plannedEndDate', showTime)
        getDatetimeEditValue(self.edtBegDate, self.edtBegTime, record, 'begDate', showTime)
        getDatetimeEditValue(self.edtEndDate, self.edtEndTime, record, 'endDate', showTime)
        getComboBoxValue(self.cmbStatus, record, 'status')
        getDoubleBoxValue(self.edtAmount, record, 'amount')
        getDoubleBoxValue(self.edtUet, record, 'uet')
        getRBComboBoxValue(self.cmbPerson, record, 'person_id')
        getRBComboBoxValue(self.cmbSetPerson, record, 'setPerson_id')
        getLineEditValue(self.edtOffice, record, 'office')
        getLineEditValue(self.edtNote, record, 'note')
        record.setValue('MKB', QtCore.QVariant(self.cmbMKB.text()))
        record.setValue('morphologyMKB', QtCore.QVariant(self.cmbMorphologyMKB.validText()))
        record.setValue('org_id', QtCore.QVariant(self.cmbOrg.value()))
        record.setValue('duration', toVariant(self.edtDuration.value()))
        record.setValue('periodicity', toVariant(self.edtPeriodicity.value()))
        record.setValue('aliquoticity', toVariant(self.edtAliquoticity.value()))
        return record
Ejemplo n.º 25
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getLineEditValue(self.edtSerial, record, 'serial')
     getLineEditValue(self.edtNumber, record, 'number')
     getDateEditValue(self.edtDate, record, 'date')
     getRBComboBoxValue(self.cmbPerson, record, 'person_id')
     getRBComboBoxValue(self.cmbExpert, record, 'expert_id')
     getLineEditValue(self.edtDestination, record, 'destination')
     getRBComboBoxValue(self.cmbReason, record, 'reason_id')
     getTextEditValue(self.edtNote, record, 'note')
     getCheckBoxValue(self.chkInsuranceOfficeMark, record,
                      'insuranceOfficeMark')
     record.setValue('tempInvalid_id', toVariant(self.tempInvalidId))
     getLineEditValue(self.edtPlaceWork, record, 'placeWork')
     if not self.defaultBlankMovingId:
         blankMovingId = self.edtSerial.value()
     else:
         blankMovingId = self.defaultBlankMovingId
     if blankMovingId:
         db = QtGui.qApp.db
         tableBlankTempInvalidMoving = db.table('BlankTempInvalid_Moving')
         recordMoving = db.getRecordEx(tableBlankTempInvalidMoving, u'*', [
             tableBlankTempInvalidMoving['deleted'].eq(0),
             tableBlankTempInvalidMoving['id'].eq(blankMovingId)
         ])
         if recordMoving:
             used = forceInt(recordMoving.value('used'))
             recordMoving.setValue('used', toVariant(used + 1))
             db.updateRecord(tableBlankTempInvalidMoving, recordMoving)
     return record
Ejemplo n.º 26
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     getLineEditValue(self.edtCode, record, rbCode)
     getLineEditValue(self.edtName, record, rbName)
     getRBComboBoxValue(self.cmbEquipmentType, record, 'equipmentType_id')
     getSpinBoxValue(self.edtTripod, record, 'tripod')
     getSpinBoxValue(self.edtTripodCapacity, record, 'tripodCapacity')
     getLineEditValue(self.edtInventoryNumber, record, 'inventoryNumber')
     getLineEditValue(self.edtModel, record, 'model')
     getDateEditValue(self.edtReleaseDate, record, 'releaseDate')
     getDateEditValue(self.edtStartupDate, record, 'startupDate')
     getComboBoxValue(self.cmbStatus, record, 'status')
     getSpinBoxValue(self.edtEmploymentTerm, record, 'employmentTerm')
     getSpinBoxValue(self.edtWarrantyTerm, record, 'warrantyTerm')
     getSpinBoxValue(self.edtMaintenancePeriod, record, 'maintenancePeriod')
     getComboBoxValue(self.cmbMaintenanceSingleInPeriod, record,
                      'maintenanceSingleInPeriod')
     getLineEditValue(self.edtManufacturer, record, 'manufacturer')
     getComboBoxValue(self.cmbProtocol, record, 'protocol')
     getLineEditValue(self.edtAddress, record, 'address')
     getLineEditValue(self.edtOwnName, record, 'ownName')
     getLineEditValue(self.edtLabName, record, 'labName')
     return record
Ejemplo n.º 27
0
Archivo: Orgs.py Proyecto: dio4/vista_1
    def getRecord(self):
        obsoleteInfisCode = forceString(self.edtObsoleteInfisCode.text())
        obsoleteInfisCode = forceStringEx(obsoleteInfisCode.replace(
            ',', ' ')).replace(' ', ',')

        record = CItemEditorBaseDialog.getRecord(self)
        getLineEditValue(self.edtFullName, record, 'fullName')
        getLineEditValue(self.edtShortName, record, 'shortName')
        getLineEditValue(self.edtTitle, record, 'title')
        getLineEditValue(self.edtAddress, record, 'address')
        getRBComboBoxValue(self.cmbNet, record, 'net_id')
        getLineEditValue(self.edtInfisCode, record, 'infisCode')
        record.setValue('obsoleteInfisCode', toVariant(obsoleteInfisCode))
        getLineEditValue(self.edtMiacCode, record, 'miacCode')
        getLineEditValue(self.edtOKVED, record, 'OKVED')
        getLineEditValue(self.edtINN, record, 'INN')
        getLineEditValue(self.edtKPP, record, 'KPP')
        getLineEditValue(self.edtOGRN, record, 'OGRN')
        getLineEditValue(self.edtFSS, record, 'FSS')
        getLineEditValue(self.edtOKATO, record, 'OKATO')
        getLineEditValue(self.edtOKPO, record, 'OKPO')
        getLineEditValue(self.edtNetricaCode, record, 'netrica_Code')
        getRBComboBoxValue(self.cmbOKPF, record, 'OKPF_id')
        getRBComboBoxValue(self.cmbOKFS, record, 'OKFS_id')
        getLineEditValue(self.edtChief, record, 'chief')
        getLineEditValue(self.edtPhone, record, 'phone')
        getLineEditValue(self.edtAccountant, record, 'accountant')
        getCheckBoxValue(self.chkIsInsurer, record, 'isInsurer')
        getCheckBoxValue(self.chkIsCompulsoryInsurer, record,
                         'isCompulsoryInsurer')
        getCheckBoxValue(self.chkIsVoluntaryInsurer, record,
                         'isVoluntaryInsurer')
        area = self.cmbArea.code()
        record.setValue('area', toVariant(area))
        getCheckBoxValue(self.chkCompulsoryServiceStop, record,
                         'compulsoryServiceStop')
        getCheckBoxValue(self.chkVoluntaryServiceStop, record,
                         'voluntaryServiceStop')
        getCheckBoxValue(self.chkCanOmitPolicyNumber, record,
                         'canOmitPolicyNumber')
        getComboBoxValue(self.cmbIsMedical, record, 'isMedical')
        getTextEditValue(self.edtNotes, record, 'notes')
        getRBComboBoxValue(self.cmbHead, record, 'head_id')
        return record
Ejemplo n.º 28
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
Ejemplo n.º 29
0
    def getNotes(self, record, eventTypeId):
        db = QtGui.qApp.db
        tbl = db.table('Referral')
        record.setValue('relegateOrg_id',
                        toVariant(self.cmbRelegateOrg.value()))
        getTextEditValue(self.edtEventNote, record, 'note')
        if getEventIsExternal(eventTypeId):
            getLineEditValue(self.edtEventExternalIdValue, record,
                             'externalId')
        if hasEventAssistant(eventTypeId):
            getRBComboBoxValue(self.cmbEventAssistant, record, 'assistant_id')
        if hasEventCurator(eventTypeId):
            getRBComboBoxValue(self.cmbEventCurator, record, 'curator_id')
        getRBComboBoxValue(self.cmbPatientModel, record, 'patientModel_id')
        getRBComboBoxValue(self.cmbCureType, record, 'cureType_id')
        getRBComboBoxValue(self.cmbCureMethod, record, 'cureMethod_id')
        getRBComboBoxValue(self.cmbClientPolicy, record, 'clientPolicy_id')
        if QtGui.qApp.isEventLockEnabled():
            getCheckBoxValue(self.chkLock, record, 'locked')
        refId = db.translate('Event', 'id', forceInt(record.value('id')),
                             'referral_id')
        if not refId:
            refId = db.translate('Referral', 'event_id',
                                 forceInt(record.value('id')), 'id')
        if QtGui.qApp.isReferralRequired() and not self.dontSaveReferral:
            if self.chkLPUReferral.isChecked() and not forceInt(refId):
                if not forceString(self.edtNumber.text()):
                    QtGui.QMessageBox.warning(self, u'Ошибка',
                                              u'Заполните номер направления')
                    return
                ref_record = db.getRecordEx(tbl, '*', [
                    tbl['type'].eq(forceInt(self.cmbReferralType.value())),
                    tbl['number'].eq(forceString(self.edtNumber.text())),
                    tbl['client_id'].eq(
                        forceInt(self._clientId if self._clientId else QtGui.
                                 qApp.currentClientId())), tbl['date'].eq(
                                     self.edtDate.date()),
                    tbl['isCancelled'].eq(0), tbl['deleted'].eq(0)
                ])
                if not ref_record:
                    ref_record = tbl.newRecord()
                ref_record.setValue('number',
                                    QtCore.QVariant(self.edtNumber.text()))
                ref_record.setValue(
                    'event_id',
                    QtCore.QVariant(
                        forceInt(record.value('id')
                                 ) if forceInt(record.value('id')) else self.
                        lblEventIdValue.text()))
                ref_record.setValue(
                    'relegateOrg_id',
                    QtCore.QVariant(self.cmbRelegateOrg.value()))
                ref_record.setValue(
                    'client_id',
                    QtCore.QVariant(self._clientId if self._clientId else QtGui
                                    .qApp.currentClientId()))
                ref_record.setValue('MKB', QtCore.QVariant(self.cmbMKB.text()))
                ref_record.setValue(
                    'speciality_id',
                    QtCore.QVariant(self.cmbSpeciality.value()))
                ref_record.setValue(
                    'type', QtCore.QVariant(self.cmbReferralType.value()))
                getDateEditValue(self.edtDate, ref_record, 'date')
                getDateEditValue(self.edtPlannedDate, ref_record, 'hospDate')
                getLineEditValue(self.edtPerson, ref_record, 'person')
                if self.chkFreeInput.isChecked():
                    getLineEditValue(self.edtFreeInput, ref_record,
                                     'freeInput')
                referralId = db.insertOrUpdate(db.table('Referral'),
                                               ref_record)
                record.setValue('referral_id', toVariant(referralId))
            elif forceInt(refId):
                if not forceString(self.edtNumber.text()):
                    QtGui.QMessageBox.warning(self, u'Ошибка',
                                              u'Заполните номер направления')
                    return
                record.setValue('referral_id', toVariant(refId))
                ref_record = db.getRecordEx(
                    tbl, '*', [tbl['id'].eq(refId), tbl['isSend'].eq(0)])
                if ref_record and not forceInt(ref_record.value('isSend')):
                    if self.chkLPUReferral.isChecked():
                        if ref_record:
                            ref_record.setValue(
                                'number',
                                QtCore.QVariant(self.edtNumber.text()))
                            ref_record.setValue(
                                'event_id',
                                QtCore.QVariant(
                                    forceInt(record.value('id')) if forceInt(
                                        record.value('id')) else self.
                                    lblEventIdValue.text()))
                            ref_record.setValue(
                                'relegateOrg_id',
                                QtCore.QVariant(self.cmbRelegateOrg.value()))
                            ref_record.setValue(
                                'client_id',
                                QtCore.QVariant(self._clientId if self.
                                                _clientId else QtGui.qApp.
                                                currentClientId()))
                            ref_record.setValue(
                                'MKB', QtCore.QVariant(self.cmbMKB.text()))
                            ref_record.setValue(
                                'speciality_id',
                                QtCore.QVariant(self.cmbSpeciality.value()))
                            ref_record.setValue(
                                'type',
                                QtCore.QVariant(self.cmbReferralType.value()))
                            ref_record.setValue(
                                'date', QtCore.QVariant(self.edtDate.date()))
                            ref_record.setValue(
                                'hospDate',
                                QtCore.QVariant(self.edtPlannedDate.date()))
                            ref_record.setValue(
                                'person',
                                QtCore.QVariant(self.edtPerson.text()))
                            db.updateRecord(tbl, ref_record)
                    else:
                        record.setValue('referral_id', QtCore.QVariant())
            else:
                record.setValue('referral_id', QtCore.QVariant())

            if self.chkArmyReferral.isChecked():
                armyCond = [
                    tbl['number'].eq(self.cmbArmyNumber.text()),
                    tbl['id'].eq(self.cmbArmyNumber.value())
                ]
                army_ref_record = db.getRecordEx(tbl, '*', where=armyCond)
                if not army_ref_record:
                    army_ref_record = tbl.newRecord()
                    new = True
                else:
                    new = False
                army_ref_record.setValue(
                    'number',
                    QtCore.QVariant(self.cmbArmyNumber.lineEdit().text()))
                army_ref_record.setValue(
                    'client_id',
                    QtCore.QVariant(self._clientId if self._clientId else QtGui
                                    .qApp.currentClientId()))
                army_ref_record.setValue('type', QtCore.QVariant(1))
                army_ref_record.setValue(
                    'relegateOrg_id', QtCore.QVariant(self.cmbArmyOrg.value()))
                getDateEditValue(self.edtArmyDate, army_ref_record, 'date')
                if self.chkArmyFreeInput.isChecked():
                    getLineEditValue(self.edtArmyFreeInput, army_ref_record,
                                     'freeInput')
                if new:
                    referralId = db.insertRecord(db.table('Referral'),
                                                 army_ref_record)
                else:
                    referralId = db.updateRecord(db.table('Referral'),
                                                 army_ref_record)
                record.setValue('armyReferral_id', toVariant(referralId))
                self.cmbArmyNumber.forceUpdate()
            else:
                record.setValue('armyReferral_id', QtCore.QVariant())
Ejemplo n.º 30
0
 def getRecord(self):
     record = CItemEditorBaseDialog.getRecord(self)
     record.setValue('type', toVariant(self.type_))
     getRBComboBoxValue(self.cmbDoctype, record, 'doctype_id')
     record.setValue('client_id', toVariant(self.clientId))
     getRBComboBoxValue(self.cmbReason, record, 'tempInvalidReason_id')
     getRBComboBoxValue(self.cmbExtraReason, record,
                        'tempInvalidExtraReason_id')
     getWidgetValue(self.cmbBusyness, record, 'busyness')
     getLineEditValue(self.edtPlaceWork, record, 'placeWork')
     # getLineEditValue(self.edtSerial,    record, 'serial')
     getLineEditValue(self.edtNumber, record, 'number')
     getComboBoxValue(self.cmbOtherSex, record, 'sex')
     getSpinBoxValue(self.edtOtherAge, record, 'age')
     getCheckBoxValue(self.chkInsuranceOfficeMark, record,
                      'insuranceOfficeMark')
     getLineEditValue(self.edtMainNumber, record, 'mainNumber')
     fullLength, externalLength = self.modelPeriods.calcLengths()
     record.setValue('begDate', toVariant(self.modelPeriods.begDate()))
     record.setValue('endDate', toVariant(self.modelPeriods.endDate()))
     record.setValue('duration', toVariant(fullLength))
     date = self.modelPeriods.endDate()
     if not date:
         date = self.modelPeriods.begDate()
     diagnosisTypeId = 1  #diagnosisType = закл
     diagnosis = getDiagnosisId2(date, self.modelPeriods.lastPerson(),
                                 self.clientId, diagnosisTypeId,
                                 self.edtDiagnosis.text(), u'',
                                 self.cmbDiseaseCharacter.value(), None,
                                 None)
     record.setValue('diagnosis_id', toVariant(diagnosis[0]))
     if (self.prolonging or forceInt(record.value('closed'))
             == 2) and (not self.saveProlonging):
         closed = 2
     else:
         closed = self.modelPeriods.getTempInvalidClosedStatus()
     #self.closed = closed
     record.setValue('closed', toVariant(closed))
     record.setValue('prev_id', toVariant(self.prevId))
     record.setValue('person_id', toVariant(self.modelPeriods.lastPerson()))
     if not self.caseBegDate:
         self.caseBegDate = self.modelPeriods.begDate()
     record.setValue('caseBegDate', toVariant(self.caseBegDate))
     db = QtGui.qApp.db
     table = db.table('TempInvalid')
     tableBlankTempInvalidMoving = db.table('BlankTempInvalid_Moving')
     if not self.defaultBlankMovingId:
         blankMovingId = None
     else:
         blankMovingId = self.defaultBlankMovingId
     if blankMovingId:
         recordMoving = db.getRecordEx(tableBlankTempInvalidMoving, u'*', [
             tableBlankTempInvalidMoving['deleted'].eq(0),
             tableBlankTempInvalidMoving['id'].eq(blankMovingId)
         ])
         used = forceInt(recordMoving.value('used'))
         recordMoving.setValue('used', toVariant(used + 1))
         db.updateRecord(tableBlankTempInvalidMoving, recordMoving)
     if self.saveProlonging:
         recordTempInvalid = table.newRecord()
         recordTempInvalid.setValue('type', toVariant(self.type_))
         recordTempInvalid.setValue('client_id', toVariant(self.clientId))
         tempInvalidId = db.insertOrUpdate(table, recordTempInvalid)
         record.setValue('id', toVariant(tempInvalidId))
         self.modelPeriods.saveItems(tempInvalidId)
         self.saveProlonging = False
     else:
         self.tempInvalidId = db.insertOrUpdate(table, record)
         record.setValue('id', toVariant(self.tempInvalidId))
         self.modelPeriods.saveItems(self.tempInvalidId)
     return record