def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setLineEditValue(self.edtCode, record, 'code') setLineEditValue(self.edtName, record, 'name') setLineEditValue(self.edtMKB, record, 'MKB') setRBComboBoxValue(self.cmbQuotaType, record, 'quotaType_id') setCheckBoxValue(self.chkIsObsolete, record, 'isObsolete') self.modelTypeMetodCure.loadItems(self.itemId())
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setLineEditValue(self.edtCode, record, 'code') setLineEditValue(self.edtName, record, 'name') setLineEditValue(self.edtTicketPrefix, record, 'ticketPrefix') setRBComboBoxValue(self.edtOrgStructure, record, 'orgStructure_id') setCheckBoxValue(self.chkImmediatelyReady, record, 'isImmediatelyReady')
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setComboBoxValue(self.cmbType, record, 'type') setDateEditValue(self.edtBegDate, record, 'begDate') setDateEditValue(self.edtEndDate, record, 'endDate') setCheckBoxValue(self.chkIsActive, record, 'isActive') if forceInt(record.value('isReadOnly')): self.tblItems.model().setEditable(False) self.modelItems.loadItems(self.itemId())
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setComboBoxValue(self.cmbType, record, 'type') setLineEditValue(self.edtCode, record, 'code') setLineEditValue(self.edtName, record, 'name') setCheckBoxValue(self.checkBox, record, 'requiredDiagnosis') setComboBoxValue(self.cmbGrouping, record, 'grouping') setSpinBoxValue(self.spinPrimary, record, 'primary') setSpinBoxValue(self.spinProlongate, record, 'prolongate') setSpinBoxValue(self.spinRestriction, record, 'restriction')
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setLineEditValue(self.edtCode, record, 'code') setLineEditValue(self.edtFederalCode, record, 'federalCode') setLineEditValue(self.edtRegionalCode, record, 'regionalCode') setLineEditValue(self.edtName, record, 'name') setRBComboBoxValue(self.cmbGroup, record, 'group_id') setComboBoxValue(self.cmbSerialFormat, record, 'serial_format') setCheckBoxValue(self.chkDefault, record, 'isDefault') setCheckBoxValue(self.chkForeigner, record, 'isForeigner') self.setIsDirty(False)
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setDateEditValue(self.edtDate, record, 'date') setDatetimeEditValue(self.edtDeadlineDate, self.edtDeadlineTime, record, 'deadline') setCheckBoxValue(self.chkRevoked, record, 'revoked') setRBComboBoxValue(self.cmbSupplier, record, 'supplier_id') setRBComboBoxValue(self.cmbRecipient, record, 'recipient_id') setLineEditValue(self.edtNote, record, 'note') self.modelItems.loadItems(self.itemId()) self.setIsDirty(False)
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setLineEditValue(self.edtCode, record, 'code') setLineEditValue(self.edtName, record, 'name') setComboBoxValue(self.cmbSex, record, 'sex') setCheckBoxValue(self.chkCounterManualInput, record, 'counterManualInput') setComboBoxValue(self.cmbCounterResetType, record, 'counterResetType') setLineEditValue(self.edtExternalIdLimit, record, 'issueExternalIdLimit') self.tissueId = forceInt(record.value('id')) self.edtCounterValue.setText(str(self.getCounterValue()))
def setRecord(self, record): CItemEditorDialog.setRecord(self, record) setLineEditValue(self.edtContext, record, 'context') setLineEditValue(self.edtFileName, record, 'fileName') setTextEditValue(self.edtDefault, record, 'default') setComboBoxValue(self.cmbDPD, record, 'dpdAgreement') setComboBoxValue(self.cmbType, record, 'type') setComboBoxValue(self.cmbBanUnkeptData, record, 'banUnkeptDate') setRBComboBoxValue(self.cmbCounter, record, 'counter_id') setRBComboBoxValue(self.cmbIEMKDoc, record, 'documentType_id') setCheckBoxValue(self.chkPatientApply, record, 'isPatientAgreed') setLineEditValue(self.edtGroup, record, 'groupName') self.setIsDirty(False)
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setLineEditValue(self.edtCode, record, 'code') setLineEditValue(self.edtName, record, 'name') setComboBoxValue(self.cmbSex, record, 'sex') (begUnit, begCount, endUnit, endCount) = parseAgeSelector(forceString(record.value('age'))) self.cmbBegAgeUnit.setCurrentIndex(begUnit) self.edtBegAgeCount.setText(str(begCount)) self.cmbEndAgeUnit.setCurrentIndex(endUnit) self.edtEndAgeCount.setText(str(endCount)) # Полю flags можно сделать битовым и хранить в нем несколько разных состояний. Пока там одно, поэтому работаем # как с обычным полем со значениями 0-1 setCheckBoxValue(self.chkUseInCreateClients, record, 'flags')
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) self.tableId = forceInt(record.value('rcTable_id')) self.loadAvaliableFields(self.tableId) setLineEditValue(self.edtName, record, 'name') setTextEditValue(self.edtDescription, record, 'description') setCheckBoxValue(self.chkVisible, record, 'visible') currentField = forceString(record.value('field')) for index, field in enumerate(self.fields): if field == currentField: self.cmbField.setCurrentIndex(index) break ref_id = forceInt(record.value('ref_id')) self.chkHasReference.setChecked(forceBool(ref_id)) self.setReferenceValue(ref_id)
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())
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setCheckBoxValue(self.chkInsuranceOfficeMark, record, 'insuranceOfficeMark') self.closed = forceInt(record.value('closed')) self.clientId = forceRef(record.value('client_id')) self.diagnosisId = forceRef(record.value('diagnosis_id')) self.setType(forceInt(record.value('type'))) setRBComboBoxValue(self.cmbDoctype, record, 'doctype_id') setRBComboBoxValue(self.cmbReason, record, 'tempInvalidReason_id') setRBComboBoxValue(self.cmbExtraReason, record, 'tempInvalidExtraReason_id') setWidgetValue(self.cmbBusyness, record, 'busyness') setLineEditValue(self.edtPlaceWork, record, 'placeWork') setLineEditValue(self.edtNumber, record, 'number') setComboBoxValue(self.cmbOtherSex, record, 'sex') setSpinBoxValue(self.edtOtherAge, record, 'age') setCheckBoxValue(self.chkGovEmoploymentService, record, 'employmentService') setLineEditValue(self.edtMainNumber, record, 'mainNumber') self.modelPeriods.loadItems(self.itemId()) self.setEnabledWidget(self.chkInsuranceOfficeMark.isChecked(), [ self.cmbDoctype, self.cmbReason, self.cmbExtraReason, self.edtNumber, self.edtDiagnosis, self.cmbDiseaseCharacter, self.chkInsuranceOfficeMark, self.tblPeriods ]) db = QtGui.qApp.db MKB = forceString( db.translate('Diagnosis', 'id', self.diagnosisId, 'MKB')) self.edtDiagnosis.setText(MKB) table = db.table('TempInvalid') condDeleted = table['deleted'].eq(0) condClient = table['client_id'].eq(self.clientId) prevCond = [ condDeleted, condClient, table['closed'].eq(2), table['endDate'].eq( forceDate(record.value('begDate')).addDays(-1)) ] prevRecord = db.getRecordEx(table, '*', prevCond, 'endDate DESC') self.setPrev(prevRecord) self.updateLength() self.btnTempInvalidProlong.setEnabled(self.closed == 0) self.prolonging = False self.defaultBlankMovingId = None
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setLineEditValue(self.edtCode, record, 'code') setLineEditValue(self.edtName, record, 'name') setCheckBoxValue(self.chkEditable, record, 'isEditable') setCheckBoxValue(self.chkShowInClientInfo, record, 'showInClientInfo') setCheckBoxValue(self.chkIsUnique, record, 'isUnique') setCheckBoxValue(self.chkAutoIdentificator, record, 'autoIdentificator') setRBComboBoxValue(self.cmbCounter, record, 'counter_id')
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setLineEditValue(self.edtCode, record, 'code') setLineEditValue(self.edtName, record, 'name') setBigIntSpinBoxValue(self.edtValue, record, 'value') setLineEditValue(self.edtPrefix, record, 'prefix') setLineEditValue(self.edtPostfix, record, 'postfix') setLineEditValue(self.edtSeparator, record, 'separator') setCheckBoxValue(self.chkSequenceFlag, record, 'sequenceFlag') setComboBoxValue(self.cmbReset, record, 'reset') setDateEditValue(self.edtStartDate, record, 'startDate') try: self.oldCounterCode = self.edtCode.text() if self.edtCode.text()[0] == 'p': self.cmbCompulsoryPolisCompany.setValue(int(self.edtCode.text()[1:])) self.btnAddOrgCounter.setChecked(True) self.on_btnAddOrgCounter_click() except: self.btnAddOrgCounter.setChecked(False) self.on_btnAddOrgCounter_click()
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setLineEditValue(self.edtCode, record, 'code') setLineEditValue(self.edtName, record, 'name') setCheckBoxValue(self.chkShowInClientInfo, record, 'isShowInClientInfo') setCheckBoxValue(self.chkTightControl, record, 'tightControl') if u'онко' in QtGui.qApp.currentOrgInfis(): setCheckBoxValue(self.chkSoftControl, record, 'softControl') else: self.chkSoftControl.setVisible(False) setCheckBoxValue(self.chkAutoDateClose, record, 'autoCloseDate') self.groupId = forceRef(record.value('group_id')) self.modelTypes.loadItems(self.itemId()) self.setIsDirty(False)
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) self.groupId = forceRef(record.value('group_id')) setLineEditValue(self.edtCode, record, 'code') setLineEditValue(self.edtRegionalCode, record, 'regionalCode') setLineEditValue(self.edtName, record, 'name') setLineEditValue(self.edtListContext, record, 'listContext') setComboBoxValue(self.cmbActionStatusChanger, record, 'actionStatusChanger') setComboBoxValue(self.cmbActionPersonChanger, record, 'actionPersonChanger') setComboBoxValue(self.cmbActionDateChanger, record, 'actionDateChanger') setSpinBoxValue(self.edtTicketDuration, record, 'ticketDuration') self.modelJobTypeActions.loadItems(self.itemId()) self.modelJobTypeQuotes.loadItems(self.itemId()) setCheckBoxValue(self.chkShowOnlyPayed, record, 'showOnlyPayed') # atronah for issue 317 setSpinBoxValue(self.edtDurationVisibility, record, 'durationVisibility') setComboBoxValue(self.cmbTicketAssignWay, record, 'ticketAssignWay') setComboBoxValue(self.cmbJobStatusModifier, record, 'jobStatusModifier')
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setRBComboBoxValue(self.cmbServiceGroup, record, 'group_id') setLineEditValue(self.edtCode, record, rbCode) setTextEditValue(self.edtName, record, rbName) setCheckBoxValue(self.chkeisLegacy, record, 'eisLegacy') setCheckBoxValue(self.chkNomenclatureLegacy, record, 'nomenclatureLegacy') setComboBoxValue(self.cmbLicense, record, 'license') setRBComboBoxValue(self.cmbCaseCast, record, 'caseCast_id') setLineEditValue(self.edtInfis, record, 'infis') setDateEditValue(self.edtBegDate, record, 'begDate') setDateEditValue(self.edtEndDate, record, 'endDate') setDoubleBoxValue(self.edtUetAdultDoctor, record, 'adultUetDoctor') setDoubleBoxValue(self.edtUetChildDoctor, record, 'childUetDoctor') setDoubleBoxValue(self.edtUetAdultAvarageMedWorker, record, 'adultUetAverageMedWorker') setDoubleBoxValue(self.edtUetChildAvarageMedWorker, record, 'childUetAverageMedWorker') setDoubleBoxValue(self.edtQualityLevel, record, 'qualityLevel') setDoubleBoxValue(self.edtSuperviseComplexityFactor, record, 'superviseComplexityFactor') if isComplexService(self.edtCode.text()): self.modelServices.loadItems(self.itemId()) self.tblServices.show() else: self.tblServices.hide() setRBComboBoxValue(self.cmbMedicalAidProfile, record, 'medicalAidProfile_id') setRBComboBoxValue(self.cmbMedicalAidKind, record, 'medicalAidKind_id') setRBComboBoxValue(self.cmbMedicalAidType, record, 'medicalAidType_id') setRBComboBoxValue(self.cmbServiceCategory, record, 'category_id') self.modelMedicalAidProfiles.loadItems(self.itemId()) self.modelGoals.loadItems(self.itemId()) self.modelMKB.loadItems(self.itemId())
def _initByAction(self, action): self.action = action record = action.getRecord() CItemEditorBaseDialog.setRecord(self, record) self.eventId = forceRef(record.value('event_id')) self.eventTypeId = forceRef(QtGui.qApp.db.translate('Event', 'id', self.eventId, 'eventType_id')) self.idx = forceInt(record.value('idx')) self.clientId = self.getClientId(self.eventId) actionType = self.action.getType() setActionPropertiesColumnVisible(actionType, self.tblProps) showTime = actionType.showTime self.edtDirectionTime.setVisible(showTime) self.edtPlannedEndTime.setVisible(showTime) self.edtCoordTime.setVisible(showTime) self.edtBegTime.setVisible(showTime) self.edtEndTime.setVisible(showTime) self.lblAssistant.setVisible(actionType.hasAssistant) self.cmbAssistant.setVisible(actionType.hasAssistant) self.setWindowTitle(actionType.code + '|' + actionType.name) setCheckBoxValue(self.chkIsUrgent, record, 'isUrgent') setDatetimeEditValue(self.edtDirectionDate, self.edtDirectionTime, record, 'directionDate') setDatetimeEditValue(self.edtPlannedEndDate, self.edtPlannedEndTime, record, 'plannedEndDate') setDatetimeEditValue(self.edtCoordDate, self.edtCoordTime, record, 'coordDate') setLabelText(self.lblCoordText, record, 'coordText') setDatetimeEditValue(self.edtBegDate, self.edtBegTime, record, 'begDate') setDatetimeEditValue(self.edtEndDate, self.edtEndTime, record, 'endDate') setComboBoxValue(self.cmbStatus, record, 'status') setDoubleBoxValue(self.edtAmount, record, 'amount') setDoubleBoxValue(self.edtUet, record, 'uet') setRBComboBoxValue(self.cmbPerson, record, 'person_id') setRBComboBoxValue(self.cmbSetPerson, record, 'setPerson_id') setLineEditValue(self.edtOffice, record, 'office') self.cmbAssistant.setValue(self.action.getAssistantId('assistant')) setLineEditValue(self.edtNote, record, 'note') self.edtDuration.setValue(forceInt(record.value('duration'))) self.edtPeriodicity.setValue(forceInt(record.value('periodicity'))) self.edtAliquoticity.setValue(forceInt(record.value('aliquoticity'))) mkbVisible = bool(actionType.defaultMKB) mkbEnabled = actionType.defaultMKB in [1, 2, 5] self.cmbMKB.setVisible(mkbVisible) self.lblMKB.setVisible(mkbVisible) self.cmbMKB.setEnabled(mkbEnabled) self.cmbMKB.setText(forceString(record.value('MKB'))) morphologyMKBVisible = bool(actionType.defaultMorphology) and QtGui.qApp.defaultMorphologyMKBIsVisible() morphologyEnabled = actionType.defaultMorphology in [1, 2, 5] self.cmbMorphologyMKB.setVisible(morphologyMKBVisible) self.lblMorphologyMKB.setVisible(morphologyMKBVisible) self.cmbMorphologyMKB.setEnabled(morphologyEnabled) self.cmbMorphologyMKB.setText(forceString(record.value('morphologyMKB'))) self.cmbOrg.setValue(forceRef(record.value('org_id'))) if (self.cmbPerson.value() is None and actionType.defaultPersonInEditor in (CActionType.dpUndefined, CActionType.dpCurrentUser) and QtGui.qApp.userSpecialityId): self.cmbPerson.setValue(QtGui.qApp.userId) self.setPersonId(self.cmbPerson.value()) self.updateClientInfo() self.edtAmount.setEnabled(actionType.amountEvaluation == 0) self.modelActionProperties.setAction(self.action, self.clientId, self.clientSex, self.clientAge) self.modelActionProperties.reset() self.tblProps.init() self.tblProps.resizeRowsToContents() context = actionType.context if actionType else '' customizePrintButton(self.btnPrint, context) if QtGui.qApp.userHasRight(urLoadActionTemplate): personId = forceRef(record.value('person_id')) actionTemplateTreeModel = self.actionTemplateCache.getModel(actionType.id, personId if personId else forceRef( record.value('setPerson_id'))) self.btnLoadTemplate.setModel(actionTemplateTreeModel) else: self.btnLoadTemplate.setEnabled(False) self.btnSaveAsTemplate.setEnabled(QtGui.qApp.userHasRight(urSaveActionTemplate)) self.edtDuration.setEnabled( QtGui.qApp.userHasRight(urCopyPrevAction) and bool(QtGui.qApp.userId == self.cmbSetPerson.value()) and bool( not self.action.getExecutionPlan()) and bool(self.cmbStatus.currentIndex() in [0, 5]) and bool( not self.edtEndDate.date())) self.edtPeriodicity.setEnabled( QtGui.qApp.userHasRight(urCopyPrevAction) and bool(QtGui.qApp.userId == self.cmbSetPerson.value()) and bool( not self.action.getExecutionPlan()) and bool(self.cmbStatus.currentIndex() in [0, 5]) and bool( not self.edtEndDate.date())) self.edtAliquoticity.setEnabled( QtGui.qApp.userHasRight(urCopyPrevAction) and bool(QtGui.qApp.userId == self.cmbSetPerson.value()) and bool( not self.action.getExecutionPlan()) and bool(self.cmbStatus.currentIndex() in [0, 5]) and bool( not self.edtEndDate.date())) canEdit = not self.action.isLocked() if self.action else True for widget in [self.edtPlannedEndDate, self.edtPlannedEndTime, self.cmbStatus, self.edtBegDate, self.edtBegTime, self.edtEndDate, self.edtEndTime, self.cmbPerson, self.edtOffice, self.cmbAssistant, self.edtAmount, self.edtUet, self.edtNote, self.cmbOrg, self.buttonBox.button(QtGui.QDialogButtonBox.Ok) ]: widget.setEnabled(canEdit) if not canEdit: self.btnLoadTemplate.setEnabled(False) canEditPlannedEndDate = canEdit and actionType.defaultPlannedEndDate not in [CActionType.dpedBegDatePlusAmount, CActionType.dpedBegDatePlusDuration] self.edtPlannedEndDate.setEnabled(canEditPlannedEndDate) self.edtPlannedEndTime.setEnabled(canEditPlannedEndDate) if self.edtDuration.value() > 0 and not self.edtEndDate.date(): self.btnNextAction.setEnabled(True) else: self.btnNextAction.setEnabled(False) if self.edtDuration.value() > 0: self.btnPlanNextAction.setEnabled(True) else: self.btnPlanNextAction.setEnabled(False) self.on_edtDuration_valueChanged(forceInt(record.value('duration')))
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setLineEditValue(self.edtFullName, record, 'fullName') setLineEditValue(self.edtShortName, record, 'shortName') setLineEditValue(self.edtTitle, record, 'title') setLineEditValue(self.edtAddress, record, 'address') setRBComboBoxValue(self.cmbNet, record, 'net_id') setLineEditValue(self.edtInfisCode, record, 'infisCode') setLineEditValue(self.edtObsoleteInfisCode, record, 'obsoleteInfisCode') setLineEditValue(self.edtMiacCode, record, 'miacCode') setLineEditValue(self.edtOKVED, record, 'OKVED') setLineEditValue(self.edtINN, record, 'INN') setLineEditValue(self.edtKPP, record, 'KPP') setLineEditValue(self.edtOGRN, record, 'OGRN') setLineEditValue(self.edtFSS, record, 'FSS') setLineEditValue(self.edtOKATO, record, 'OKATO') setLineEditValue(self.edtOKPO, record, 'OKPO') setLineEditValue(self.edtNetricaCode, record, 'netrica_Code') setRBComboBoxValue(self.cmbOKPF, record, 'OKPF_id') setRBComboBoxValue(self.cmbOKFS, record, 'OKFS_id') setLineEditValue(self.edtChief, record, 'chief') setLineEditValue(self.edtPhone, record, 'phone') setLineEditValue(self.edtAccountant, record, 'accountant') setCheckBoxValue(self.chkIsInsurer, record, 'isInsurer') setCheckBoxValue(self.chkIsCompulsoryInsurer, record, 'isCompulsoryInsurer') setCheckBoxValue(self.chkIsVoluntaryInsurer, record, 'isVoluntaryInsurer') setCheckBoxValue(self.chkCompulsoryServiceStop, record, 'compulsoryServiceStop') setCheckBoxValue(self.chkVoluntaryServiceStop, record, 'voluntaryServiceStop') setCheckBoxValue(self.chkCanOmitPolicyNumber, record, 'canOmitPolicyNumber') self.cmbArea.setCode(forceString(record.value('area'))) setComboBoxValue(self.cmbIsMedical, record, 'isMedical') setTextEditValue(self.edtNotes, record, 'notes') setRBComboBoxValue(self.cmbHead, record, 'head_id') self.modelOrganisationAccounts.loadItems(self.itemId()) self.modelOrganisationPolicySerials.loadItems(self.itemId())
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setLineEditValue(self.edtCode, record, 'code') setLineEditValue(self.edtName, record, 'name') setCheckBoxValue(self.chkObserved, record, 'observed')
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setLineEditValue(self.edtCode, record, rbCode) setLineEditValue(self.edtFlatCode, record, 'flatCode') setLineEditValue(self.edtName, record, rbName) setCheckBoxValue(self.chkIsSelectable, record, 'isSelectable')
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setRBComboBoxValue(self.cmbOrganisation, record, 'organisation_id') setRBComboBoxValue(self.cmbParent, record, 'parent_id') setLineEditValue(self.edtCode, record, 'code') setLineEditValue(self.edtName, record, 'name') setLineEditValue(self.edtAddress, record, 'address') setWidgetValue(self.cmbType, record, 'type', forceInt) setRBComboBoxValue(self.cmbNet, record, 'net_id') setRBComboBoxValue(self.cmbChief, record, 'chief_id') setRBComboBoxValue(self.cmbHeadNurse, record, 'headNurse_id') setLineEditValue(self.edtInfisCode, record, 'infisCode') setLineEditValue(self.edtAttachCode, record, 'attachCode') setLineEditValue(self.edtBookkeeperCode, record, 'bookkeeperCode') setLineEditValue(self.edtInfisInternalCode, record, 'infisInternalCode') setLineEditValue(self.edtInfisDepTypeCode, record, 'infisDepTypeCode') setLineEditValue(self.edtInfisTariffCode, record, 'infisTariffCode') setLineEditValue(self.edtStorageCode, record, 'storageCode') setLineEditValue(self.edtDayLimit, record, 'dayLimit') setLineEditValue(self.edtSyncGUID, record, 'syncGUID') setLineEditValue(self.edtMiacCode, record, 'miacCode') self.edtSalaryPercentage.setValue( forceDouble(record.value('salaryPercentage'))) self.edtQuota.setValue(forceInt(record.value('quota'))) # if len(self.edtSalaryPercentage.value()) == 0: # self.edtSalaryPercentage.setText('0') setComboBoxValue(self.cmbIsArea, record, 'isArea') setRBComboBoxValue(self.cmbMiacHead, record, 'miacHead_id') setCheckBoxValue(self.chkHasHospitalBeds, record, 'hasHospitalBeds') setCheckBoxValue(self.chkHasStocks, record, 'hasStocks') setCheckBoxValue(self.chkHasDS, record, 'hasDayStationary') setCheckBoxValue(self.chkAvailableForExternal, record, 'availableForExternal') setCheckBoxValue(self.chkInheritEventTypes, record, 'inheritEventTypes') setCheckBoxValue(self.chkInheritGaps, record, 'inheritGaps') setCheckBoxValue(self.chkInheritActionTypes, record, 'inheritActionTypes') setCheckBoxValue(self.chkVisibleInDR, record, 'isVisibleInDR') self.modelAddress.loadData(self.itemId()) self.modelHospitalBeds.loadItems(self.itemId()) self.modelJobs.loadItems(self.itemId()) self.modelGaps.loadItems(self.itemId()) self.modelEventTypes.loadItems(self.itemId()) self.modelActionTypes.loadItems(self.itemId()) self.modelDisabledAttendance.loadItems(self.itemId()) self.modelStocks.loadItems(self.itemId()) self.modelEquipments.loadItems(self.itemId()) self.cmbChief.setOrgStructureId(self.itemId()) self.cmbHeadNurse.setOrgStructureId(self.itemId())
def setRecord(self, record): CItemEditorBaseDialog.setRecord(self, record) setLineEditValue(self.edtName, record, 'name') setLineEditValue(self.edtFunction, record, 'function') setTextEditValue(self.edtDescription, record, 'description') setCheckBoxValue(self.chkHasSpace, record, 'hasSpace')
def setRecord(self, record): super(CRBActionAssistantTypeEditor, self).setRecord(record) setCheckBoxValue(self.chkFreeInput, record, 'isEnabledFreeInput')
def setNotes(self, record): self.edtPlannedDate.setDate(QtCore.QDate()) self.edtDate.setDate(QtCore.QDate()) self.cmbRelegateOrg.setValue(forceRef(record.value('relegateOrg_id'))) self.setId(self.lblEventIdValue, record, 'id') self.setId(self.edtEventExternalIdValue, record, 'externalId') setRBComboBoxValue(self.cmbEventAssistant, record, 'assistant_id') setRBComboBoxValue(self.cmbEventCurator, record, 'curator_id') self.setDateTime(self.lblEventCreateDateTimeValue, record, 'createDatetime') self.setPerson(self.lblEventCreatePersonValue, record, 'createPerson_id') self.setDateTime(self.lblEventModifyDateTimeValue, record, 'modifyDatetime') self.setPerson(self.lblEventModifyPersonValue, record, 'modifyPerson_id') setTextEditValue(self.edtEventNote, record, 'note') setRBComboBoxValue(self.cmbPatientModel, record, 'patientModel_id') self.on_cmbPatientModel_currentIndexChanged(None) setRBComboBoxValue(self.cmbCureType, record, 'cureType_id') setRBComboBoxValue(self.cmbCureMethod, record, 'cureMethod_id') self._originalEventResultId = forceRef(record.value('result_id')) if QtGui.qApp.isReferralRequired(): db = QtGui.qApp.db ref_id = forceInt(record.value('referral_id')) tableReferral = db.table('Referral') ref_record = db.getRecordEx(tableReferral, '*', [ tableReferral['id'].eq(ref_id), tableReferral['isSend'].eq(0) ]) if ref_record: self.chkLPUReferral.setChecked(True) setLineEditValue(self.edtPerson, ref_record, 'person') self.edtNumber.setText(forceString(ref_record.value('number'))) self.cmbRelegateOrg.setValue( forceRef(ref_record.value('relegateOrg_id'))) self.cmbMKB.setText(forceString(ref_record.value('MKB'))) self.cmbSpeciality.setValue( forceInt(ref_record.value('speciality_id'))) self.cmbReferralType.setValue( forceInt(ref_record.value('type'))) self.edtDate.setDate(forceDate(ref_record.value('date'))) self.edtPlannedDate.setDate( forceDate(ref_record.value('hospDate'))) if not ref_record.value('freeInput').isNull(): setLineEditValue(self.edtFreeInput, ref_record, 'freeInput') self.chkFreeInput.setChecked(True) else: self.edtFreeInput.setText('') self.chkFreeInput.setChecked(False) else: self.chkLPUReferral.setChecked(False) armyRef_id = forceInt(record.value('armyReferral_id')) armyRef_record = db.getRecordEx(tableReferral, '*', [ tableReferral['id'].eq(armyRef_id), tableReferral['type'].eq(1) ]) if armyRef_record: self.chkArmyReferral.setChecked(True) self.cmbArmyOrg.setValue( forceRef(armyRef_record.value('relegateOrg_id'))) if not armyRef_record.value('freeInput').isNull(): setLineEditValue(self.edtArmyFreeInput, armyRef_record, 'freeInput') self.chkArmyFreeInput.setChecked(True) else: self.edtArmyFreeInput.setText('') self.chkArmyFreeInput.setChecked(False) setDateEditValue(self.edtArmyDate, armyRef_record, 'date') self.cmbArmyNumber.setValue( forceInt(armyRef_record.value('id'))) else: self.chkArmyReferral.setChecked(False) setRBComboBoxValue(self.cmbClientPolicy, record, 'clientPolicy_id') self.cmbClientPolicy.setPolicyFromRepresentative( isLittleStranger(forceRef(record.value('client_id')), forceDate(record.value('setDate')), forceDate(record.value('execDate')))) self.updateClientPolicy(record) if QtGui.qApp.isEventLockEnabled(): setCheckBoxValue(self.chkLock, record, 'locked')
def _load(self, actionTypeId): record = QtGui.qApp.db.getRecord(self._table, '*', actionTypeId) setComboBoxValue(self.cmbSex, record, 'sex') (begUnit, begCount, endUnit, endCount) = parseAgeSelector(forceString(record.value('age'))) self.cmbBegAgeUnit.setCurrentIndex(begUnit) self.edtBegAgeCount.setText(str(begCount)) self.cmbEndAgeUnit.setCurrentIndex(endUnit) self.edtEndAgeCount.setText(str(endCount)) setComboBoxValue(self.cmbDefaultStatus, record, 'defaultStatus') setComboBoxValue(self.cmbDefaultDirectionDate, record, 'defaultDirectionDate') setComboBoxValue(self.cmbDefaultPlannedEndDate, record, 'defaultPlannedEndDate') setComboBoxValue(self.cmbDefaultBeginDate, record, 'defaultBeginDate') setComboBoxValue(self.cmbDefaultEndDate, record, 'defaultEndDate') setRBComboBoxValue(self.cmbDefaultExecPerson, record, 'defaultExecPerson_id') setComboBoxValue(self.cmbDefaultPersonInEvent, record, 'defaultPersonInEvent') setComboBoxValue(self.cmbDefaultPersonInEditor, record, 'defaultPersonInEditor') self.cmbDefaultOrg.setValue(forceRef(record.value('defaultOrg_id'))) setComboBoxValue(self.cmbDefaultMKB, record, 'defaultMKB') setComboBoxValue(self.cmbDefaultMorphology, record, 'defaultMorphology') setComboBoxValue(self.cmbIsMorphologyRequired, record, 'isMorphologyRequired') setLineEditValue(self.edtOffice, record, 'office') setCheckBoxValue(self.chkShowInForm, record, 'showInForm') setCheckBoxValue(self.chkShowTime, record, 'showTime') setCheckBoxValue(self.chkShowAPOrg, record, 'showAPOrg') setCheckBoxValue(self.chkShowAPNotes, record, 'showAPNotes') setCheckBoxValue(self.chkRequiredCoordination, record, 'isRequiredCoordination') setComboBoxValue(self.cmbAssistantRequired, record, 'hasAssistant') setLineEditValue(self.edtContext, record, 'context') setCheckBoxValue(self.chkIsPreferable, record, 'isPreferable') setSpinBoxValue(self.edtAmount, record, 'amount') setSpinBoxValue(self.edtMaxOccursInEvent, record, 'maxOccursInEvent') setComboBoxValue(self.cmbServiceType, record, 'serviceType') setCheckBoxValue(self.chkPropertyAssignedVisible, record, 'propertyAssignedVisible') setCheckBoxValue(self.chkPropertyUnitVisible, record, 'propertyUnitVisible') setCheckBoxValue(self.chkPropertyNormVisible, record, 'propertyNormVisible') setCheckBoxValue(self.chkPropertyEvaluationVisible, record, 'propertyEvaluationVisible') setSpinBoxValue(self.edtRecommendationExpirePeriod, record, 'recommendationExpirePeriod') setCheckBoxValue(self.chkRecommendationControl, record, 'recommendationControl') setCheckBoxValue(self.chkExecRequiredForEventExec, record, 'isExecRequiredForEventExec') setCheckBoxValue(self.chkIgnoreEventEndDate, record, 'isIgnoreEventExecDate')