Package clips.delegate.service

Examples of clips.delegate.service.SerRenLocal$PrescriptionCacheList


                    needAddToEmc = true;
                }
                if (needAddToEmc) {
                    emcLocal.addChild(selectedDisease);
                } else {
                    SerRenLocal serRenLocal = new SerRenLocal(selectedDisease, result.serrenDetails, getAuditManager());
                    selectedDisease.addChild(serRenLocal);
                }
            }
        } catch (ClipsException ex) {
            MessageBox.showException(ex);
View Full Code Here


    }// </editor-fold>//GEN-END:initComponents

    private void btTransactionsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btTransactionsActionPerformed
        if (tabSerRenList.getSelectedRowCount() > 0) {
            try {
                SerRenLocal service = serRenList.get(tabSerRenList.getSelectedRowSorted());
                DialogTransactionList dialog = new DialogTransactionList(MainWindow.mainWindow, service);
                dialog.setVisible(true);
            } catch (ClipsException ex) {
                MessageBox.showException(ex);
            }
View Full Code Here

    }//GEN-LAST:event_btTransactionsActionPerformed

    private void btContractActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btContractActionPerformed
        if (tabSerRenList.getSelectedRowCount() > 0) {
            try {
                SerRenLocal service = serRenList.get(tabSerRenList.getSelectedRowSorted());
                ContractLocal c = service.getPolisData().getContract();
                if (c != null) {
                    PanelContractInfo panel = new PanelContractInfo(getContainer(), c);
                    getContainer().addNewPage(panel, this);
                }
            } catch (PageException ex) {
View Full Code Here

    }//GEN-LAST:event_btAddActionPerformed

    private void btRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btRemoveActionPerformed
        int pos = tabSerRenList.getSelectedRowSorted();
        if (pos >= 0) {
            SerRenLocal sr = serRenList.get(pos);

            /**Удаляемый объект услуга и она в пакете*/
            boolean serRenInPacket = false;
            try {
                serRenInPacket = sr.getPacketServiceID() != 0;
            } catch (ClipsException ex) {
                MessageBox.showException(ex);
                return;
            }

            if (serRenInPacket) {
                if (MessageBox.showConfirmYesNo(MessageBox.C_DEL_SERV_FROM_PACK) != MessageBox.ANSWER_YES) {
                    return;
                }
            }

            try {
                sr.removeAndBreakPacket();
                serRenList.remove(pos);
            } catch (ClipsException ex) {
                MessageBox.showException(ex);
            }
            tabSerRenList.setModel(new TableModelSerRenList(serRenList));
View Full Code Here

            Iterator<CheckupDetails> it = getBean().getCheckupList().iterator();
            while (it.hasNext()) {
                CheckupDetails d = it.next();
                int serrenID = d.serviceRenderID;
                if (serrenMap.get(serrenID) == null) {
                    serrenMap.put(serrenID, new SerRenLocal(serrenID, getAuditListener()));
                }
                res.add(new CheckupLocal(d, serrenMap.get(serrenID), getAuditListener()));
            }
            return res;
        }
View Full Code Here

        Font font = commonFont;
        render().setVerticalAlignment(SwingConstants.CENTER);
        render().setOpaque(true);

        SerRenLocal serRen = null;
        serRen = serRenIterator.get(row);
        try {
            //Цвет шрифта (может быть запрещена для редактирования)
            if (!serRen.isRendered()) {
                font = boldFont;
            }
        } catch (ClipsException ex) {
            ex.printStackTrace();
        }
        render().setFont(font);
        render().setIcon(null);
        if (col == TableModelSerRenList.COL_PACKET) {
            if ((Integer) value != 0) {
                render().setIcon(ICON_PACKET);
            }
            render().setText("");
            return;
        } else if (col >= TableModelSerRenList.COL_SERVICE && col <=
                TableModelSerRenList.COL_MONEY) {
            return;
        } else if (col == TableModelSerRenList.COL_PAY) {
            ServisePriceData price = serRen.getContractService();
            if (price == null && !serRen.hasReferencedSerRen()
                    && serRen.getPolisData().getContract().getType() != Contract.TYPE_OMI) {
                render().setBackground(Color.RED);
            } else {
                if (!serRen.isSerPayed()) {
                    render().setBackground(Color.RED);
                }
            }
        } else if (col == TableModelSerRenList.COL_DISCOUNT) {
            return;
        } else if (col == TableModelSerRenList.COL_REST) {
            return;
        } else if (col == TableModelSerRenList.COL_STT) {
            DiseaseLocal stt = serRen.getDiseaseLocal();
            render().setText("");
            if (stt != null) {
                if (stt.isProfcheckup()) {
                    render().setIcon(PROFCHECKUP_ICON);
                } else {
View Full Code Here

    }

    @Override
    public Object getValueAt(int r, int c) {
        try {
            SerRenLocal serRenLocal = serRenIterator.get(r);

            switch (c) {
                case COL_PACKET: {
                    return serRenLocal.getPacketServiceID();
                }
                case COL_SERVICE: {
                    //наименование услуги
                    return serRenLocal.getService().toString();
                }
                case COL_DIRECTED: {
                    //Направил + дата
                    DirectoryCollaboratorItem serRenDirector = serRenLocal.getSerRenDirector();
                    Date date = serRenLocal.getSerDate();
                    return serRenDirector.toString() + " " +
                            Converter.dateToString(date);
                }
                case COL_RENDERED: {
                    //Обслужил + дата
                    if (serRenLocal.isRendered()) {
                        DirectoryCollaboratorItem cl = serRenLocal.getCollaboratorFunctions().getCollaborator();
                        Date dateOrder = serRenLocal.getSerRenderDate();
                        return cl.toString() + " " +
                                Converter.dateToString(dateOrder);
                    } else {
                        return "Не оказана";
                    }
                }
                case COL_PRICE: {
                    //Полная стоимость услуги
                    ServisePriceData contractServiceData = serRenLocal.getContractService();
                    if (contractServiceData != null && !serRenLocal.hasReferencedSerRen()) {
                        return String.format("%.2f", ((float) contractServiceData.getPrice()) /
                                100);
                    } else {
                        return "";
                    }
                }
                case COL_MONEY: {
                    //оплачивается договором
                    ServisePriceData contractServiceData = serRenLocal.getContractService();
                    if (contractServiceData != null && !serRenLocal.hasReferencedSerRen()) {
                        return String.format("%.2f", ((float) contractServiceData.getMoney()) /
                                100);
                    } else {
                        return "";
                    }
                }
                case COL_DISCOUNT: {
                    //скидка услуги
                    return serRenLocal.getCalculatedDiscount();
                }
                case COL_REST: {
                    //осталось оплатить
                    ServisePriceData contractServiceData = serRenLocal.getContractService();
                    if (contractServiceData != null && !serRenLocal.hasReferencedSerRen()) {
                        float discount = (float) serRenLocal.getCalculatedDiscount() / 100;
                        float lack = contractServiceData.getLack() * (1 - discount) / 100;
                        return String.format("%.2f", lack);
                    } else {
                        return "";
                    }
                }
                case COL_PAY: {
                    //Внесено денег
                    return String.format("%.2f", ((float) serRenLocal.getTransactionSumm()) /
                            100);
                }
                case COL_STT: {
                    //привязка к заболеванию
                    return serRenLocal.getDiseaseLocal() != null;
                }
                default:
                    return null;
            }
        } catch (ClipsException ex) {
View Full Code Here

     * @return
     * @throws cli_fmw.delegate.exception.ClipsException
     */
    @Override
    public void print(CombinedReportCreator cCreator) throws ClipsException {
        SerRenLocal serRen = getSerrenLocal();
        boolean rendered = serRen.isRendered();

        CheckupXMLData data = getCheckupXMLData();
        boolean isAnalysys = data.getCheckupType().isAnalyse();

        SegmentedTableReporter analyseReporter = cCreator.createAnalyseReporter(getClass());

        //название анализа
        String title;
        if (isAnalysys) {
            title = "Анализ: ";
        }
        else {
            title = "Осмотр: ";
        }
        analyseReporter.setTitle(title + data.getCheckupType().getTitle());

        //Фиелды до таблицы
        String fieldName;
        String fieldValue;
        ExtraField extraField;
       
        ClientLocal client = serRen.getPolisData().getClient(getAuditListener());
        fieldName = "Пациент: ";
        fieldValue = client.toString();
        if (isAnalysys) {
            fieldValue += " (" + Converter.dateToString(client.getBorn()) + ")";
        }
        extraField = new ExtraField(fieldValue, fieldName, AlignmentType.left);
        analyseReporter.addField(extraField, false);
               
        if (isAnalysys) {
            fieldName = "Направил: ";
            fieldValue = serRen.getSerRenDirector().toString();
            fieldValue += " (" + Converter.dateToString(serRen.getSerDate()) + ")";
            extraField = new ExtraField(fieldValue, fieldName, AlignmentType.left);
            analyseReporter.addField(extraField, false);

            if (rendered) {
                fieldName = "Дата забора биоматериала: ";
                fieldValue = Converter.dateToString(getDate());
                extraField = new ExtraField(fieldValue, fieldName, AlignmentType.left);
                analyseReporter.addField(extraField, false);
            }
        }
        else {           
            ArrayList<FieldForXML> preField = data.getPreFieldList();
           
            for(int i = 0; i < preField.size(); i++) {
                fieldName = preField.get(i).title + ": ";
                fieldValue = data.getField(preField.get(i).id);
                if (fieldValue == null) {
                    fieldValue = "";
                }
                extraField = new ExtraField(fieldValue, fieldName, AlignmentType.dataInOneColoumnByLeft);
                analyseReporter.addField(extraField, false);
            }
        }
       
        ArrayList<String> probeList = data.getProbeList();
        if (!probeList.isEmpty()) {
            //добавляем заголовок таблицы
            List<String> header = new ArrayList<String>();
            header.add("Методика");
            ArrayList<String> valueList = data.getProbeValueList();
            for (int i = 0; i < valueList.size(); i++) {
                String titleStr = data.getProbeValueTitle(valueList.get(i));
                header.add(titleStr);
            }
            header.add("Описание");
            analyseReporter.setHeader(header);

            //добавляем строки таблицы
            List<String> row;
            for (int i = 0; i < probeList.size(); i++) {
                row = new ArrayList<String>();
                if (probeList.get(i).startsWith("separator")) {
                    String separator = data.getProbeTitle(probeList.get(i)).replace("separator ", "");
                    analyseReporter.addSeparator(separator);
                }
                else {
                    row.add(data.getProbeTitle(probeList.get(i)));
                    for (int j = 0; j < valueList.size(); j++) {
                        Object value = data.getProbeValue(probeList.get(i), valueList.get(j));
                        String metric = data.getProbeValueMetric(probeList.get(i), valueList.get(j));
                        String valueMetric = ( value == null ? "" : value.toString() + " " + (metric == null ? "" : metric));
                        row.add(valueMetric);                       
                    }
                    String description = data.getProbeDescription(probeList.get(i));
                    row.add(description);
                    analyseReporter.addRow(row);
                }
            }
        }
        //Фиелды после таблицы
        if (isAnalysys) {
            if (rendered) {
                fieldName = "Анализ провел(дата исследования): ";
                fieldValue = serRen.getCollaboratorFunctions() == null
                        ? "" : serRen.getCollaboratorFunctions().getCollaborator().toString();
                fieldValue += serRen.getSerRenderDate() == null
                        ? "" : " (" + Converter.dateToString(serRen.getSerRenderDate()) + ")";
            }
            else {
                fieldName = "Рекомендации: ";
                fieldValue = serRen.getService().getDescription();
            }
            extraField = new ExtraField(fieldValue, fieldName, AlignmentType.dataInOneColoumnByLeft);
            analyseReporter.addField(extraField, true);
        }
        else {
            ArrayList<FieldForXML> postField = data.getPostFieldList();
            for(int i = 0; i < postField.size(); i++) {
                fieldName = postField.get(i).title + ": ";
                fieldValue = data.getField(postField.get(i).id);
                if (fieldValue == null) {
                    fieldValue = "";
                }
                extraField = new ExtraField(fieldValue, fieldName, AlignmentType.dataInOneColoumnByLeft);
                analyseReporter.addField(extraField, true);
            }
            DirectoryCollaboratorItem collab = serRen.getSerRenDirector();
            fieldName = "Врач: ";
            fieldValue = collab.getTitle();
            extraField = new ExtraField(fieldValue, fieldName, AlignmentType.left);
            analyseReporter.addField(extraField, true);
        }
View Full Code Here

    public List<DirectionLocal> findDirectionListToComm(int commReasonID, int clientID, Date from, Date till) throws ClipsException {
        List<DirectionLocal> directionLocals = new ArrayList<DirectionLocal>();
        try {
            List<DirectionDetails> list = bean().getDirectionListToComm(commReasonID, clientID, from, till);
            for(DirectionDetails d : list) {
                SerRenLocal serRen = new SerRenLocal(d.serviceRenderID, am);
                DirectionLocal dir = new DirectionLocal(d, serRen, am);
                directionLocals.add(dir);
            }
        } catch (Exception ex) { 
            clearBean();
View Full Code Here

    }

    public ArrayList<DirectoryCollaboratorFunctionsItem> getCollabsIn() throws ClipsException {
        ArrayList<DirectoryCollaboratorFunctionsItem> collabs = new ArrayList<DirectoryCollaboratorFunctionsItem>();
        SerRenLocal serRenLocal;
        for (int i = 0; i < getSerrenList().size(); i++) {
            serRenLocal = getSerrenList().get(i);
            if (serRenLocal.isRendered()) {
                if (!collabs.contains(serRenLocal.getCollaboratorFunctions())) {
                    collabs.add(serRenLocal.getCollaboratorFunctions());
                }
            }
        }
        return collabs;
    }
View Full Code Here

TOP

Related Classes of clips.delegate.service.SerRenLocal$PrescriptionCacheList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.