コード例 #1
0
ファイル: RBSpeciality.py プロジェクト: dio4/vista_1
 def setRecord(self, record):
     CItemEditorBaseDialog.setRecord(self, record)
     setLineEditValue(self.edtCode, record, 'code')
     setLineEditValue(self.edtName, record, 'name')
     setLineEditValue(self.edtShortName, record, 'shortName')
     setLineEditValue(self.edtOKSOName, record, 'OKSOName')
     setLineEditValue(self.edtOKSOCode, record, 'OKSOCode')
     setLineEditValue(self.edtFederalCode, record, 'federalCode')
     setLineEditValue(self.edtRegionalCode, record, 'regionalCode')
     setLineEditValue(self.edtSyncGUID, record, 'syncGUID')
     setRBComboBoxValue(self.cmbLocalService, record, 'service_id')
     setRBComboBoxValue(self.cmbProvinceService, record,
                        'provinceService_id')
     setRBComboBoxValue(self.cmbOtherService, record, 'otherService_id')
     setRBComboBoxValue(self.cmbFundingService, record, 'fundingService_id')
     setComboBoxValue(self.cmbSex, record, 'sex')
     (begUnit, begCount, endUnit,
      endCount) = parseAgeSelector(forceString(record.value('age')))
     versSpec = forceStringEx(record.value('versSpec'))
     self.cmbVersSpec.setCurrentIndex({
         'v004': 1,
         'v015': 2
     }.get(versSpec.lower(), 0))
     self.cmbBegAgeUnit.setCurrentIndex(begUnit)
     self.edtBegAgeCount.setText(str(begCount))
     self.cmbEndAgeUnit.setCurrentIndex(endUnit)
     self.edtEndAgeCount.setText(str(endCount))
     setLineEditValue(self.edtMKBFilter, record, 'mkbFilter')
     self.modelQueueShare.load(self.itemId())
コード例 #2
0
 def setRecord(self, record):
     CItemEditorBaseDialog.setRecord(self, record)
     setTextEditValue(self.edtName, record, 'name')
     setComboBoxValue(self.cmbClass, record, 'class')
     self.cmbGroup.setCode(forceString(record.value('group_code')))
     self.setInputCodeSettings()
     setLineEditValue(self.edtCode, record, 'code')
     self.oldCode = self.edtCode.text()
     self.setIsDirty(False)
コード例 #3
0
ファイル: RBDloFormularies.py プロジェクト: dio4/vista_1
 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())
コード例 #4
0
ファイル: RBLaboratory.py プロジェクト: dio4/vista_1
 def setRecord(self, record):
     CItemEditorBaseDialog.setRecord(self, record)
     setLineEditValue(   self.edtCode,      record, 'code')
     setLineEditValue(   self.edtName,      record, 'name')
     setComboBoxValue(   self.cmbProtocol,  record, 'protocol')
     setLineEditValue(   self.edtAddress,   record, 'address')
     setLineEditValue(   self.edtOwnName,   record, 'ownName')
     setLineEditValue(   self.edtLabName,   record, 'labName')
     self.modelTests.loadItems(self.itemId())
     self.setIsDirty(False)
コード例 #5
0
ファイル: RBTempInvalidReason.py プロジェクト: dio4/vista_1
 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')
コード例 #6
0
ファイル: RBDocumentType.py プロジェクト: dio4/vista_1
 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)
コード例 #7
0
ファイル: RBTissueType.py プロジェクト: dio4/vista_1
 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()))
コード例 #8
0
    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())
コード例 #9
0
ファイル: RBNet.py プロジェクト: dio4/vista_1
 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')
コード例 #10
0
    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
コード例 #11
0
ファイル: RBRelativeEditor.py プロジェクト: dio4/vista_1
 def setRecord(self, record):
     CItemEditorBaseDialog.setRecord(self, record)
     setLineEditValue(self.edtCode,         record, 'code')
     setLineEditValue(self.edtRegionalCode, record, 'regionalCode')
     setLineEditValue(self.edtRegionalReverseCode, record, 'regionalReverseCode')
     setLineEditValue(self.edtLeftName,     record, 'leftName')
     setLineEditValue(self.edtRightName,    record, 'rightName')
     setCheckBoxValue(self.chkDirectGeneticRelation,          record, 'isDirectGenetic')
     setCheckBoxValue(self.chkBackwardGeneticRelation,        record, 'isBackwardGenetic')
     setCheckBoxValue(self.chkDirectRepresentativeRelation,   record, 'isDirectRepresentative')
     setCheckBoxValue(self.chkBackwardRepresentativeRelation, record, 'isBackwardRepresentative')
     setCheckBoxValue(self.chkDirectEpidemicRelation,         record, 'isDirectEpidemic')
     setCheckBoxValue(self.chkBackwardEpidemicRelation,       record, 'isBackwardEpidemic')
     setCheckBoxValue(self.chkDirectDonationRelation,         record, 'isDirectDonation')
     setCheckBoxValue(self.chkBackwardDonationRelation,       record, 'isBackwardDonation')
     setComboBoxValue(self.cmbLeftSex, record, 'leftSex')
     setComboBoxValue(self.cmbRightSex, record, 'rightSex')
コード例 #12
0
ファイル: RBTissueType.py プロジェクト: dio4/vista_1
    def getCounterValue(self):
        db = QtGui.qApp.db
        record = db.getRecordEx(db.table('rbCounter'),
                                cols='value, reset',
                                where='code = "tis%s"' % self.tissueId)
        if not record:
            self.haveCounter = False
            return 0
        else:
            counter = forceInt(record.value('value'))

            if forceInt(record.value('reset')):
                setComboBoxValue(self.cmbCounterResetType, record, 'reset')

            self.chkIdentCounter.setEnabled(True)
            self.chkIdentCounter.setChecked(True)

            return counter
コード例 #13
0
ファイル: Orgs.py プロジェクト: dio4/vista_1
 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())
コード例 #14
0
ファイル: RBCounter.py プロジェクト: dio4/vista_1
    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()
コード例 #15
0
ファイル: MKB.py プロジェクト: dio4/vista_1
 def setRecord(self, record):
     CItemEditorBaseDialog.setRecord(self, record)
     setLineEditValue(self.edtCode, record, 'DiagID')
     self.chkPrim.setChecked(bool(forceString(record.value('Prim'))))
     setTextEditValue(self.edtName, record, 'DiagName')
     setRBComboBoxValue(self.cmbMKBSubclass, record, 'MKBSubclass_id')
     setComboBoxValue(self.cmbCharacters, record, 'characters')
     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))
     setSpinBoxValue(self.edtDuration, record, 'duration')
     self.modelServiceSpecialty.loadItems(self.itemId())
     self.edtBegDate.setDate(forceDate(record.value('begDate')))
     self.edtEndDate.setDate(forceDate(record.value('endDate')))
     self.chkOMS.setChecked(forceBool(record.value('OMS')))
     self.chkMTR.setChecked(forceBool(record.value('MTR')))
     self.prevCode = forceStringEx(self.edtCode.text())
     self.parentCode = forceString(record.value('parent_code'))
コード例 #16
0
 def setRecord(self, record):
     CItemEditorBaseDialog.setRecord(self, record)
     pType, codePart, cnt = forceString(record.value('code')).split('.')
     self.cmbPaymentType.setCurrentIndex(int(pType) - 1)
     self.cmbCodePart.setCurrentIndex(int(codePart) - 1)
     setRBComboBoxValue(self.cmbOKPF, record, 'OKPF_id')
     setRBComboBoxValue(self.cmbOrgId, record, 'org_id')
     setLineEditValue(self.edtContractNumber, record, 'contractNumber')
     setDateEditValue(self.edtDate, record, 'contractDate')
     setDateEditValue(self.edtEndDate, record, 'contractEndDate')
     self.edtEndDate.setMinimumDate(self.edtDate.date())
     setLineEditValue(self.edtContractSum, record, 'contractSum')
     if QtGui.qApp.checkGlobalPreference('68', u'нет') and self.type == 2:
         setLineEditValue(self.edtContragent, record, 'contragent')
         setLineEditValue(self.edtProtocolNum, record, 'protocolNumber')
         setLineEditValue(self.edtProtocolPhase, record, 'protocolPhase')
         setLineEditValue(self.edtProtocolName, record, 'protocolName')
         setComboBoxValue(self.cmbRecPatients, record, 'protocolRecruit')
     elif QtGui.qApp.checkGlobalPreference('68', u'нет') and self.type == 1:
         setLineEditValue(self.edtContragent, record, 'contragent')
         setLineEditValue(self.edtContractItem, record, 'contractItem')
         setLineEditValue(self.edtAddress, record, 'address')
コード例 #17
0
 def setRecord(self, record):
     CItemEditorBaseDialog.setRecord(self, record)
     setComboBoxValue(self.cmbType, record, 'type')
     setLineEditValue(self.edtCode, record, rbCode)
     setLineEditValue(self.edtName, record, rbName)
     #        setCheckBoxValue(self.chkAble, record, 'able')
     setComboBoxValue(self.cmbClosed, record, 'closed')
     setComboBoxValue(self.cmbStatus, record, 'status')
コード例 #18
0
ファイル: RBJobType.py プロジェクト: dio4/vista_1
 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')
コード例 #19
0
ファイル: RBService.py プロジェクト: dio4/vista_1
    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())
コード例 #20
0
ファイル: ActionTemplate.py プロジェクト: dio4/vista_1
    def setRecord(self, record):
        CItemEditorBaseDialog.setRecord(self, record)
        self.setGroupId(forceRef(record.value('group_id')))
        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))

        ownerId = forceRef(record.value('owner_id'))
        specialityId = forceRef(record.value('speciality_id'))
        if ownerId:
            self.rbVisibleToOwner.setChecked(True)
            self.cmbOwner.setValue(ownerId)
        elif specialityId:
            self.rbVisibleToSpeciality.setChecked(True)
            self.cmbSpeciality.setValue(specialityId)
        else:
            self.rbVisibleToAll.setChecked(True)
        self.setActionId(forceRef(record.value('action_id')))
        self.setIsDirty(False)
コード例 #21
0
    def setRecord(self, record):
        CItemEditorBaseDialog.setRecord(self, record)

        self.setJobInfo(forceRef(record.value('master_id')))

        dateTime = forceDateTime(record.value('datetime'))
        begDateTime = forceDateTime(record.value('begDateTime'))

        self.lblDatetimeValue.setText(forceString(dateTime))
        setDatetimeEditValue(self.edtBegDate, self.edtBegTime, record, 'begDateTime')
        setDatetimeEditValue(self.edtEndDate, self.edtEndTime, record, 'endDateTime')
        setComboBoxValue(self.cmbStatus, record, 'status')

        if self.cmbStatus.currentIndex() == 2:
            self.modelJobTicketProbe.setEditable(False)
            self.edtBegDate.setEnabled(False)
            self.edtBegTime.setEnabled(False)
            self.edtEndDate.setEnabled(False)
            self.edtEndTime.setEnabled(False)
            self.btnSetBegDateTime.setEnabled(False)
            self.btnSetEndDateTime.setEnabled(False)
            self.cmbStatus.setEnabled(False)

        self.date = dateTime.date()
        self.datetime = begDateTime if begDateTime.date().isValid() else dateTime

        clients, actions = self.getActions()
        self.modelJobTicketProbe.setActionIdList(actions)

        self.cmbStatus.setCurrentIndex(max(self.jobStatusModifier, self.cmbStatus.currentIndex()))

        if clients:
            self.setClientId(clients[0])

            self.setIsDirty(False)
        self.isPostUISet = True
コード例 #22
0
ファイル: RBPrintTemplate.py プロジェクト: dio4/vista_1
 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)
コード例 #23
0
    def setRecord(self, record):
        CItemEditorBaseDialog.setRecord(self, record)
        setLineEditValue(self.edtCode, record, rbCode)
        setLineEditValue(self.edtName, record, rbName)
        setRBComboBoxValue(self.cmbEquipmentType, record, 'equipmentType_id')
        setSpinBoxValue(self.edtTripod, record, 'tripod')
        setSpinBoxValue(self.edtTripodCapacity, record, 'tripodCapacity')
        setLineEditValue(self.edtInventoryNumber, record, 'inventoryNumber')
        setLineEditValue(self.edtModel, record, 'model')
        setDateEditValue(self.edtReleaseDate, record, 'releaseDate')
        setDateEditValue(self.edtStartupDate, record, 'startupDate')
        setComboBoxValue(self.cmbStatus, record, 'status')
        setSpinBoxValue(self.edtEmploymentTerm, record, 'employmentTerm')
        setSpinBoxValue(self.edtWarrantyTerm, record, 'warrantyTerm')
        setSpinBoxValue(self.edtMaintenancePeriod, record, 'maintenancePeriod')
        setComboBoxValue(self.cmbMaintenanceSingleInPeriod, record,
                         'maintenanceSingleInPeriod')
        setLineEditValue(self.edtManufacturer, record, 'manufacturer')
        setComboBoxValue(self.cmbProtocol, record, 'protocol')
        setLineEditValue(self.edtAddress, record, 'address')
        setLineEditValue(self.edtOwnName, record, 'ownName')
        setLineEditValue(self.edtLabName, record, 'labName')

        self.modelTests.loadItems(forceRef(record.value('id')))
コード例 #24
0
ファイル: RecipeEditDialog.py プロジェクト: dio4/vista_1
    def setRecord(self, record):
        annoyingWidgets = [
            self.cmbDrug, self.edtDosage, self.spbQnt, self.spbNumPerDay,
            self.spbDuration, self.cmbSocCodes
        ]
        for widget in annoyingWidgets:
            widget.blockSignals(True)

        # self.disconnect(self.cmbDrug, QtCore.SIGNAL('currentIndexChanged(int)'), self.drugSelected)
        self.edtDate.setDate(forceDateTime(record.value('dateTime')).date())
        socCode = forceString(record.value('socCode'))
        i = self.cmbSocCodes.findData(socCode)
        self.cmbSocCodes.setCurrentIndex(i)
        pregCard = forceInt(record.value('pregCard'))
        if pregCard > 0:
            self.edtPregCard.setText(QString.number(pregCard))

        #mdldml: см. i2446
        financeId = forceRef(record.value('finance_id'))
        self.cmbFinance.setValue(financeId)
        if financeId:
            db = QtGui.qApp.db
            counterRecord = db.getRecordEx(
                'rbCounter', '`id`',
                "`code`='%s'" % getBookkeeperCode(self.personId))
            if not counterRecord:
                self.cmbFinance.setEnabled(False)

        self.cmbMKB.setText(forceString(record.value('mkb')))
        setLineEditValue(self.edtDosage, record, 'dosage')
        setSpinBoxValue(self.spbQnt, record, 'qnt')
        setLineEditValue(self.edtSigna, record, 'signa')
        setSpinBoxValue(self.spbDuration, record, 'duration')
        setSpinBoxValue(self.spbNumPerDay, record, 'numPerDay')

        formularyFilter = 'master_id = %d AND isSprPC = 1' % forceInt(
            self.drugMasterId)
        if forceInt(record.value('isVk')) == 1:
            self.rbtnVkYes.setChecked(True)
        else:
            self.rbtnVkNo.setChecked(True)
            formularyFilter += ' AND federalCode IS NOT NULL'

        if forceInt(record.value('printMnn')) == 1:
            self.rbtnPrintMNN.setChecked(True)
        else:
            self.rbtnPrintTradeName.setChecked(True)

        self.cmbDrug.setFilter(formularyFilter, order='`name` ASC')
        setRBComboBoxValue(self.cmbDrug, record, 'formularyItem_id')
        context = CInfoContext()
        formularyItem = context.getInstance(
            CDloDrugFormularyItemInfo,
            forceRef(record.value('formularyItem_id')))
        self.rbtnPrintMNN.setEnabled(not formularyItem.mnn.code == u'1')

        if forceInt(record.value('percentage')) == 50:
            self.rbtn50proc.setChecked(True)
        else:
            self.rbtn100proc.setChecked(True)

        setComboBoxValue(self.cmbTerm, record, 'term')
        self.cmbStatus.setCurrentIndex(
            self.modelRecipeStatus.getIndex(forceInt(record.value('status'))))

        # self.connect(self.cmbDrug, QtCore.SIGNAL('currentIndexChanged(int)'), self.drugSelected)
        for widget in annoyingWidgets:
            widget.blockSignals(False)
コード例 #25
0
    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')))
コード例 #26
0
ファイル: GroupActionTypeEditor.py プロジェクト: dio4/vista_1
    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')
コード例 #27
0
 def setRecord(self, record):
     CItemEditorBaseDialog.setRecord(self, record)
     setLineEditValue(self.edtCode, record, 'code')
     setLineEditValue(self.edtName, record, 'name')
     setComboBoxValue(self.cmbQuotaStatusModifier, record,
                      'quotaStatusModifier')
コード例 #28
0
 def setRecord(self, record):
     CItemEditorBaseDialog.setRecord(self, record)
     setComboBoxValue(self.cmbType, record, 'type')
     setLineEditValue(self.edtCode, record, 'code')
     setLineEditValue(self.edtName, record, 'name')
コード例 #29
0
 def setRecord(self, record):
     CItemEditorBaseDialog.setRecord(self, record)
     setLineEditValue(self.edtCode, record, 'code')
     setLineEditValue(self.edtName, record, 'name')
     setComboBoxValue(self.cmbCharacterRelation, record,
                      'characterRelation')