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
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
def getRecord(self): record = CItemEditorBaseDialog.getRecord(self) getRBComboBoxValue(self.cmbServiceGroup, record, 'group_id') getLineEditValue(self.edtCode, record, rbCode) getTextEditValue(self.edtName, record, rbName) getCheckBoxValue(self.chkeisLegacy, record, 'eisLegacy') getCheckBoxValue(self.chkNomenclatureLegacy, record, 'nomenclatureLegacy') getComboBoxValue(self.cmbLicense, record, 'license') getRBComboBoxValue(self.cmbCaseCast, record, 'caseCast_id') getLineEditValue(self.edtInfis, record, 'infis') getDateEditValue(self.edtBegDate, record, 'begDate') getDateEditValue(self.edtEndDate, record, 'endDate') getDoubleBoxValue(self.edtUetAdultDoctor, record, 'adultUetDoctor') getDoubleBoxValue(self.edtUetChildDoctor, record, 'childUetDoctor') getDoubleBoxValue(self.edtUetAdultAvarageMedWorker, record, 'adultUetAverageMedWorker') getDoubleBoxValue(self.edtUetChildAvarageMedWorker, record, 'childUetAverageMedWorker') getDoubleBoxValue(self.edtQualityLevel, record, 'qualityLevel') getDoubleBoxValue(self.edtSuperviseComplexityFactor, record, 'superviseComplexityFactor') getRBComboBoxValue(self.cmbMedicalAidProfile, record, 'medicalAidProfile_id') getRBComboBoxValue(self.cmbMedicalAidKind, record, 'medicalAidKind_id') getRBComboBoxValue(self.cmbMedicalAidType, record, 'medicalAidType_id') getRBComboBoxValue(self.cmbServiceCategory, record, 'category_id') return record
def getRecord(self): record = CItemEditorBaseDialog.getRecord(self) record.setValue('orgStructure_id', toVariant(QtGui.qApp.currentOrgStructureId())) getComboBoxValue(self.cmbType, record, 'type') getDateEditValue(self.edtBegDate, record, 'begDate') getDateEditValue(self.edtEndDate, record, 'endDate') getCheckBoxValue(self.chkIsActive, record, 'isActive') record.setValue('deleted', toVariant(0)) return record
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
def getRecord(self): record = CItemEditorBaseDialog.getRecord(self) if self.btnAddOrgCounter.isChecked(): self.edtCode.setText('p%s' % self.cmbCompulsoryPolisCompany.value()) self.edtName.setText(u'[Счетчик ИФ] %s' % self.cmbCompulsoryPolisCompany.currentText()) self.edtPrefix.setText('') self.edtPostfix.setText('') self.edtSeparator.setText('') getLineEditValue(self.edtCode, record, 'code') getLineEditValue(self.edtName, record, 'name') getSpinBoxValue(self.edtValue, record, 'value') getLineEditValue(self.edtPrefix, record, 'prefix') getLineEditValue(self.edtPostfix, record, 'postfix') getLineEditValue(self.edtSeparator, record, 'separator') getCheckBoxValue(self.chkSequenceFlag, record, 'sequenceFlag') getComboBoxValue(self.cmbReset, record, 'reset') getDateEditValue(self.edtStartDate, record, 'startDate') return record
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
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
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
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())