def initByRecord(self, record): self._type = forceInt(record.value('type')) self._doctype = self.getInstance(CTempInvalidDocTypeInfo, forceRef(record.value('doctype_id'))) self._reason = self.getInstance( CTempInvalidReasonInfo, forceRef(record.value('tempInvalidReason_id'))) self._extraReason = self.getInstance( CTempInvalidExtraReasonInfo, forceRef(record.value('tempInvalidExtraReason_id'))) self._busyness = forceInt(record.value('busyness')) self._placeWork = forceString(record.value('placeWork')) self._serial = forceString(record.value('serial')) self._number = forceString(record.value('number')) self._sex = formatSex(forceInt(record.value('sex'))) self._age = forceInt(record.value('age')) self._employmentService = forceBool(record.value('employmentService')) self._duration = forceInt(record.value('duration')) self._externalDuration = 0 self._begDate = CDateInfo(forceDate(record.value('begDate'))) self._endDate = CDateInfo(forceDate(record.value('endDate'))) self._person = self.getInstance(CPersonInfo, forceRef(record.value('person_id'))) self._closed = forceInt(record.value('closed')) self._MKB = self.getInstance(CMKBInfo, forceString(record.value('MKB'))) self._MKBEx = self.getInstance(CMKBInfo, forceString(record.value('MKBEx'))) prev_id = forceRef(record.value('prev_id')) if prev_id: self._prev = self.getInstance(CTempInvalidInfo, prev_id) self._periods = self.getInstance(CTempInvalidPeriodInfoList, self.id)
def _load(self): from Events.EventInfo import CContractInfo db = QtGui.qApp.db record = db.getRecord('Account', '*', self.id) if record: result = True else: record = db.table('Account').newRecord() result = False self._contract = self.getInstance( CContractInfo, forceRef(record.value('contract_id'))) self._orgStructure = self.getInstance( COrgStructureInfo, forceRef(record.value('orgStructure_id'))) self._payer = self.getInstance(COrgInfo, forceRef(record.value('payer_id'))) self._settleDate = CDateInfo(forceDate(record.value('settleDate'))) self._number = forceString(record.value('number')) self._date = CDateInfo(forceDate(record.value('date'))) self._amount = forceDecimal(record.value('amount')) self._uet = forceDecimal(record.value('uet')) self._sum = forceDecimal(record.value('sum')) self._exposeDate = CDateInfo(forceDate(record.value('exposeDate'))) self._payedAmount = forceDecimal(record.value('payedAmount')) self._payedSum = forceDecimal(record.value('payedSum')) self._refusedAmount = forceDecimal(record.value('refusedAmount')) self._refusedSum = forceDecimal(record.value('refusedSum')) self._format = self.getInstance(CRBAccountFormatInfo, forceRef(record.value('format_id'))) self._items = self.getInstance(CAccountItemInfoList, self.id) return result
def getTempInvalidInfo(self, context): result = context.getInstance(CTempInvalidInfo, None) result._doctype = context.getInstance(CTempInvalidDocTypeInfo, self.cmbDoctype.value()) result._reason = context.getInstance(CTempInvalidReasonInfo, self.cmbReason.value()) result._extraReason = context.getInstance( CTempInvalidExtraReasonInfo, forceRef(self.cmbExtraReason.value())) result._busyness = forceInt(self.cmbBusyness.value()) result._placeWork = forceString(self.edtPlaceWork.text()) result._number = forceStringEx(self.edtNumber.text()) result._sex = formatSex(self.cmbOtherSex.currentIndex()) result._age = self.edtOtherAge.value() result._duration, result._externalDuration = self.modelPeriods.calcLengths( ) result._begDate = CDateInfo(self.modelPeriods.begDate()) result._endDate = CDateInfo(self.modelPeriods.endDate()) MKB, MKBEx = self.getMKBs() result._MKB = context.getInstance(CMKBInfo, MKB) result._MKBEx = context.getInstance(CMKBInfo, MKBEx) closed = self.modelPeriods.getTempInvalidClosedStatus() result._closed = closed result._periods = self.modelPeriods.getPeriodsInfo(context) if self.prevId: result._prev = context.getInstance(CTempInvalidInfo, self.prevId) else: result._prev = None result._ok = True return result
class CStoreStockItemInfo(CItemInfo): def __init__(self, context, itemId=None, item=None): super(CStoreStockItemInfo, self).__init__(context, itemId, item) self._store = None self._unit = None self._itemClass = u'' def _load(self): srv = CPharmacyService.getInstance() self._unit = CRbItemInfo(self.context, item=srv.getItem(MeasurementUnit, self._item.unit)) self._store = CStoreInfo(self.context, item=srv.getItem(Store, self._item.store)) self._itemClass = ExpirationClass.getDateClassName( self._item.expiryDate) return True amount = property(lambda self: self._item.amount) arrivalDate = property(lambda self: CDateInfo(self._item.arrivalDate)) ATC = property(lambda self: self._item.ATC) expiryDate = property(lambda self: CDateInfo(self._item.expiryDate)) INN = property(lambda self: self._item.INN) itemClass = property(lambda self: self.load()._itemClass) manufacturer = property(lambda self: self._item.manufacturer) productionDate = property( lambda self: CDateInfo(self._item.productionDate)) store = property(lambda self: self.load()._store) tradeName = property(lambda self: self._item.tradeName) unit = property(lambda self: self.load()._unit)
def __init__(self, context, id): CInfo.__init__(self, context) self.id = id self._type = None self._doctype = context.getInstance(CTempInvalidDocTypeInfo, None) self._reason = context.getInstance(CTempInvalidReasonInfo, None) self._extraReason = context.getInstance(CTempInvalidExtraReasonInfo, None) self._busyness = 0 self._placeWork = '' self._serial = '' self._number = '' self._sex = '' self._age = '' self._duration = 0 self._externalDuration = 0 self._begDate = CDateInfo() self._endDate = CDateInfo() self._person = context.getInstance(CPersonInfo, None) self._closed = 0 self._prev = None self._MKB = self.getInstance(CMKBInfo, '') self._MKBEx = self.getInstance(CMKBInfo, '') self._periods = [] self._employmentService = False
def initByRecord(self, record): self._begPerson = self.getInstance( CPersonInfo, forceRef(record.value('begPerson_id'))) self._begDate = CDateInfo(forceDate(record.value('begDate'))) self._endPerson = self.getInstance( CPersonInfo, forceRef(record.value('endPerson_id'))) self._endDate = CDateInfo(forceDate(record.value('endDate'))) self._numberPermit = forceString(record.value('numberPermit')) self._begDatePermit = CDateInfo( forceDate(record.value('begDatePermit'))) self._endDatePermit = CDateInfo( forceDate(record.value('endDatePermit'))) self._isExternal = forceBool(record.value('isExternal')) self._regime = self.getInstance(CTempInvalidRegimeInfo, forceRef(record.value('regime_id'))) self._break = self.getInstance(CTempInvalidBreakInfo, forceRef(record.value('break_id'))) self._breakDate = CDateInfo(forceDate(record.value('breakDate'))) self._note = forceString(record.value('note')) self._result = self.getInstance(CTempInvalidResultInfo, forceRef(record.value('result_id'))) self._directDateOnKAK = CDateInfo( forceDate(record.value('directDateOnKAK'))) self._expert = self.getInstance(CPersonInfo, forceRef(record.value('expert_id'))) self._dateKAK = CDateInfo(forceDate(record.value('dateKAK'))) self._begDateHospital = CDateInfo( forceDate(record.value('begDateHospital'))) self._endDateHospital = CDateInfo( forceDate(record.value('endDateHospital')))
def _initByNull(self): self._orgStructure = self.getInstance(COrgStructureInfo, None) self._isPermanent = None self._type = self.getInstance(CHospitalBedTypeInfo, None) self._code = '' self._name = '' self._profile = self.getInstance(CHospitalBedProfileInfo, None) self._relief = None self._schedule = self.getInstance(CHospitalBedScheduleInfo, None) self._begDate = CDateInfo() self._endDate = CDateInfo()
def __init__(self, context, orderId): CInfo.__init__(self, context) self.orderId = orderId self._date = CDateInfo() self._documentDate = CDateInfo() self._documentNumber = '' self._documentType = None self._validFromDate = CDateInfo() self._validToDate = CDateInfo() self._orgStructure = None self._post = None self._salary = ''
def _initByNull(self): self._groupId = None self._eisLegacy = False self._eisLegacy = False self._license = False self._infis = '' self._begDate = CDateInfo() self._endDate = CDateInfo() self._qualityLevel = 0 self._medicalAidProfileId = None self._medicalAidKindId = None self._medicalAidTypeId = None
def _initByRecord(self, record): self._groupId = forceRef(record.value('group_id')) self._eisLegacy = forceBool(record.value('eisLegacy')) self._license = forceBool(record.value('license')) self._infis = forceString(record.value('infis')) self._begDate = CDateInfo(record.value('begDate')) self._endDate = CDateInfo(record.value('endDate')) self._qualityLevel = forceInt(record.value('qualityLevel')) self._medicalAidProfile = self.getInstance( CMedicalAidProfileInfo, forceRef(record.value('medicalAidProfile_id'))) self._medicalAidKind = self.getInstance( CMedicalAidKindInfo, forceRef(record.value('medicalAidKind_id'))) self._medicalAidType = self.getInstance( CMedicalAidTypeInfo, forceRef(record.value('medicalAidType_id')))
def _initByRecord(self, record): self._orgStructure = self.getInstance( COrgStructureInfo, forceRef(record.value('master_id'))) self._isPermanent = forceBool(record.value('isPermanent')) self._type = self.getInstance(CHospitalBedTypeInfo, forceRef(record.value('type_id'))) self._code = forceString(record.value('code')) self._name = forceString(record.value('name')) self._profile = self.getInstance(CHospitalBedProfileInfo, forceRef(record.value('profile_id'))) self._relief = forceInt(record.value('relief')) self._schedule = self.getInstance( CHospitalBedScheduleInfo, forceRef(record.value('schedule_id'))) self._begDate = CDateInfo(forceDate(record.value('begDate'))) self._endDate = CDateInfo(forceDate(record.value('endDate')))
def setRecord(self, record): self._event = self.getInstance(CEventInfo, forceRef(record.value('event_id'))) self._dateTime = CDateInfo(forceDate(record.value('dateTime'))) self._number = forceString(record.value('number')) self._socCode = forceString(record.value('socCode')) self._pregCard = forceInt(record.value('pregCard')) self._finance = self.getInstance(CFinanceInfo, forceRef(record.value('finance_id'))) self._percentage = forceInt(record.value('percentage')) self._mkb = forceString(record.value('mkb')) self._formularyItem = self.getInstance( CDloDrugFormularyItemInfo, forceRef(record.value('formularyItem_id'))) self._dosage = forceString(record.value('dosage')) self._qnt = forceInt(record.value('qnt')) self._duration = forceInt(record.value('duration')) self._numPerDay = forceInt(record.value('numPerDay')) self._signa = forceString(record.value('signa')) self._isVk = forceInt(record.value('isVk')) self._term = forceInt(record.value('term')) self._status = forceInt(record.value('status')) self._sentToMiac = forceInt(record.value('sentToMiac')) self._errorCode = forceString(record.value('errorCode')) self._printMnn = forceInt(record.value('printMnn'))
def _load(self): if not self._doc: try: self._doc = CPharmacyService.getInstance().getItem( RequestDocument, self._itemId) except Exception: self._doc = RequestDocument() self._datetime = CDateTimeInfo(self._doc.date) self._date = CDateInfo(self._doc.date.date()) self._finalizeDate = CDateInfo(self._doc.finalizeDate.date()) self._type = RequestDocumentType.getName(self._doc.type) self._storeFrom = CStoreInfo(self.context, itemId=self._doc.storeTo) self._storeTo = CStoreInfo(self.context, itemId=self._doc.storeFrom) self._positions = [ CDocumentPositionInfo(self.context, position) for position in self._positions ]
def on_btnPrint_printByTemplate(self, templateId): context = CInfoContext() data = { 'client': context.getInstance(CClientInfo, self.clientId), 'date': CDateInfo(self.eventDate), 'person': context.getInstance(CPersonInfo, self.personId), 'visits': [], 'actions': self.modelActions.getInfoList(context) } applyTemplate(self, templateId, data)
def __init__(self, context, tempInvalid_id, id): CTempInvalidInfo.__init__(self, context, tempInvalid_id) self.duplicate_id = id self._person = context.getInstance(CPersonInfo, None) self._date = CDateInfo() self._duplicateSerial = '' self._duplicateNumber = '' self._destination = '' self._duplicateReason = context.getInstance( CTempInvalidDuplicateReasonInfo, None) self._insuranceOfficeMark = -1 self._duplicatePlaceWork = '' self._note = ''
def printCashOrder(widget, templateId, eventId, date, cashOperationId, sum, cashBox): context = CInfoContext() eventInfo = context.getInstance(CEventInfo, eventId) data = { 'event': eventInfo, 'client': eventInfo.client, 'date': CDateInfo(date), 'cashOperation': context.getInstance(CCashOperationInfo, cashOperationId), 'sum': sum, 'cashBox': cashBox } applyTemplate(widget, templateId, data)
def _load(self): db = QtGui.qApp.db table = db.table('Person_Order') record = db.getRecord(table, '*', self.orderId) if record: self._date = CDateInfo(forceDate(record.value('date'))) self._type = forceInt(record.value('type')) self._documentDate = CDateInfo( forceDate(record.value('documentDate'))) self._documentNumber = forceString(record.value('documentNumber')) self._documentType = self.getInstance( CDocumentTypeInfo, forceRef(record.value('documentType_id'))) self._validFromDate = CDateInfo( forceDate(record.value('validFromDate'))) self._validToDate = CDateInfo( forceDate(record.value('validToDate'))) self._orgStructure = self.getInstance( COrgStructureInfo, forceRef(record.value('orgStructure_id'))) self._post = self.getInstance(CPostInfo, forceRef(record.value('post_id'))) self._salary = forceString(record.value('salary')) return True return False
def initDuplicateByRecord(self, record): self._person = self.getInstance(CPersonInfo, forceRef(record.value('person_id'))) self._date = CDateInfo(forceDate(record.value('date'))) self._duplicateSerial = forceString(record.value('serial')) self._duplicateNumber = forceString(record.value('number')) self._destination = forceString(record.value('destination')) self._duplicateReason = self.getInstance( CTempInvalidDuplicateReasonInfo, forceRef(record.value('reason_id'))) self._insuranceOfficeMark = forceInt( record.value('insuranceOfficeMark')) self._duplicatePlaceWork = forceString(record.value('placeWork')) self._note = forceString(record.value('note'))
def _load(self): from Events.EventInfo import CEventInfo, CVisitInfo from Events.ActionInfo import CActionInfo db = QtGui.qApp.db record = db.getRecord('Account_Item', '*', self.id) if record: result = True else: record = db.table('Account_Item').newRecord() result = False self._serviceDate = CDateInfo(forceDate(record.value('serviceDate'))) self._event = self.getInstance(CEventInfo, forceRef(record.value('event_id'))) self._visit = self.getInstance(CVisitInfo, forceRef(record.value('visit_id'))) self._action = self.getInstance(CActionInfo, forceRef(record.value('action_id'))) self._price = forceDecimal(record.value('price')) self._unit = self.getInstance(CRBMedicalAidUnitInfo, forceRef(record.value('unit_id'))) self._amount = forceDecimal(record.value('amount')) self._uet = forceDecimal(record.value('uet')) self._sum = forceDecimal(record.value('sum')) self._date = CDateInfo(forceDate(record.value('date'))) self._number = forceString(record.value('number')) self._refuseType = self.getInstance( CRBPayRefuseTypeInfo, forceRef(record.value('refuseType_id'))) self._reexposeItem = self.getInstance( CAccountItemInfo, forceRef(record.value('reexposeItem_id'))) self._note = forceString(record.value('note')) self._service = self.getInstance(CServiceInfo, forceRef(record.value('service_id'))) self._tariff_id = forceRef(record.value('tariff_id')) self._vat = forceDecimal(record.value('vat')) return result
def __init__(self, context, id): CInfo.__init__(self, context) self.id = id self._begPerson = None self._begDate = CDateInfo() self._endPerson = None self._endDate = CDateInfo() self._numberPermit = '' self._begDatePermit = CDateInfo() self._endDatePermit = CDateInfo() self._isExternal = None self._regime = None self._break = None self._breakDate = CDateInfo() self._result = None self._note = '' self._directDateOnKAK = CDateInfo() self._expert = None self._dateKAK = CDateInfo() self._begDateHospital = CDateInfo() self._endDateHospital = CDateInfo()
def __init__(self, context, personId): CInfo.__init__(self, context) self.personId = personId self._code = '' self._federalCode = '' self._regionalCode = '' self._lastName = '' self._firstName = '' self._patrName = '' self._sexCode = -1 self._sex = '' self._birthDate = CDateInfo(None) self._ageTuple = None self._age = '' self._SNILS = '' self._office = '' self._office2 = '' self._post = self.getInstance(CPostInfo, None) self._speciality = self.getInstance(CSpecialityInfo, None) self._organisation = self.getInstance(COrgInfo, None) self._orgStructure = self.getInstance(COrgStructureInfo, None) self._academicDegree = 0 self._tariffCategory = self.getInstance(CTariffCategoryInfo, None) self._login = '' self._orders = None self._maritalStatus = 0 self._contactNumber = '' self._regType = 0 self._regBegDate = None self._regEndDate = None self._isReservist = 0 self._employmentType = 0 self._occupationType = 0 self._citizenship_id = None self._education = None self._INN = '' self._birthPlace = '' self._document = self.getInstance(CPersonDocumentInfo, None) self._addressRegistry = None self._addressResidentional = None self._finance_id = 0 self._awards = None
def __init__(self, data, infoContext, stream, pageFormat=None): self.data = data now = QDateTime.currentDateTime() builtins = { 'escape': escape, 'escapenl': escapenl, 'escapepar': escapepar, 'escapesp': escapesp, 'currentDate': CDateInfo(now.date()), 'currentTime': CTimeInfo(now.time()), 'currentOrganisation': infoContext.getInstance(COrgInfo, QtGui.qApp.currentOrgId()), 'currentOrgStructure': infoContext.getInstance(COrgStructureInfo, QtGui.qApp.currentOrgStructureId()), 'currentPerson': infoContext.getInstance(CPersonInfo, QtGui.qApp.userId), 'present': self.present, 'pdf417': self.pdf417, 'code128': code128, 'getActionBarCode': self.getActionBarCode, 'p38code': self.p38code, 'p38test': self.p38test, 'amountToWords': self.amountToWords, 'Canvas': CCanvas, 'dialogs': infoContext.getInstance(CDialogsInfo), 'write': lambda string: "" if stream.write(forceString(string)) else "", 'error': self.error } for expr in PrintHelpers.__all__: builtins[expr] = PrintHelpers.__dict__[expr] if pageFormat: builtins['setPageSize'] = pageFormat.setPageSize builtins['setOrientation'] = pageFormat.setOrientation builtins['setPageOrientation'] = pageFormat.setOrientation builtins['setMargins'] = pageFormat.setMargins builtins['setLeftMargin'] = pageFormat.setLeftMargin builtins['setTopMargin'] = pageFormat.setTopMargin builtins['setRightMargin'] = pageFormat.setRightMargin builtins['setBottomMargin'] = pageFormat.setBottomMargin self.locals = {} self.locals.update(data) self.locals.update(builtins) self.globals = {} self.globals.update(self.locals)
def _load(self): db = QtGui.qApp.db tablePerson = db.table('Person') record = db.getRecord(tablePerson, '*', self.personId) if record: self._code = forceString(record.value('code')) self._federalCode = forceString(record.value('federalCode')) self._regionalCode = forceString(record.value('regionalCode')) self._lastName = forceString(record.value('lastName')) self._firstName = forceString(record.value('firstName')) self._patrName = forceString(record.value('patrName')) self._sexCode = forceInt(record.value('sex')) self._sex = formatSex(self._sexCode) self._birthDate = CDateInfo(record.value('birthDate')) self._birthPlace = forceString(record.value('birthPlace')) self._ageTuple = calcAgeTuple(self._birthDate.date, QtCore.QDate.currentDate()) self._age = formatAgeTuple(self._ageTuple, self._birthDate.date, QtCore.QDate.currentDate()) self._SNILS = formatSNILS(forceString(record.value('SNILS'))) self._office = forceString(record.value('office')) self._office2 = forceString(record.value('office2')) self._post = self.getInstance(CPostInfo, forceRef(record.value('post_id'))) self._speciality = self.getInstance( CSpecialityInfo, forceRef(record.value('speciality_id'))) self._organisation = self.getInstance( COrgInfo, forceRef(record.value('org_id'))) self._orgStructure = self.getInstance( COrgStructureInfo, forceRef(record.value('orgStructure_id'))) self._academicDegree = forceInt(record.value('academicDegree')) self._tariffCategory = self.getInstance( CTariffCategoryInfo, forceRef(record.value('tariffCategory_id'))) self._login = forceString(record.value('login')) self._maritalStatus = forceInt(record.value('maritalStatus')) self._contactNumber = forceString(record.value('contactNumber')) self._regType = forceInt(record.value('regType')) self._regBegDate = forceDate(record.value('regBegDate')) self._regEndDate = forceDate(record.value('regEndDate')) self._isReservist = forceInt(record.value('isReservist')) self._employmentType = forceInt(record.value('employmentType')) self._occupationType = forceInt(record.value('occupationType')) self._citizenship_id = forceInt(record.value('citizenship_id')) self._education = self.getInstance(CPersonEducationItemInfoList, self.personId) self._INN = forceString(record.value('INN')) self._document = self.getInstance(CPersonDocumentInfo, self.personId) self._addressRegistry = self.getInstance( CPersonAddressRegistryInfoList, self.personId) self._addressResidentional = self.getInstance( CPersonAddressResidentionalInfoList, self.personId) self._finance_id = forceInt(record.value('finance_id')) self._awards = self.getInstance(CPersonAwardsInfoList, self.personId) return True else: return False