Package beans.service.medexam

Examples of beans.service.medexam.Medexam


                }
            }
        }

        PacketService packetService = null;
        Medexam medexam = null;
        //если присутствует пакет
        if (chunk.packetServiceTemplateID != 0) {
            packetService = new PacketService();
            PacketTemplate packetTemplate = findEntity(PacketTemplate.class, chunk.packetServiceTemplateID);
            packetService.setPacketTemplate(packetTemplate);
            saveEntity(packetService);
            MedexamType medexamType = packetTemplate.getMedexamType();
            if (medexamType != null) {
                //не просто пакет, а медосмотр
                if (chunk.diseaseID != 0) {
                    throw new EDataIntegrity("Для медосмотра необходимо создать новое заболевание");
                }
                //создаем заболевание и медосмотр
                disease = new Disease();
                List<Emc> emcList = findEntityList(Emc.class, "client", polis.getClient());
                if (emcList.size() != 1) {
                    throw new EDataIntegrity("У пациента " + emcList.size() + " ЕМК");
                }
                disease.setEmc(emcList.get(0));
                Date current = new Date();
                disease.setCreated(current);
                disease.setDateReg(current);
                disease.setCollaborator(collaborator);
                manager.persist(disease);
                manager.flush();
                manager.refresh(disease);
                chunk.diseaseID = disease.getId();

                medexam = new Medexam();
                medexam.setDisease(disease);
                medexam.setMedexamType(medexamType);
                manager.persist(medexam);
            }
        }
        uniqMap = new HashMap<Integer, Set<Integer>>();
        for (int i = 0; i < chunk.serviceList.size(); i++) {
View Full Code Here


        }
        List<Medexam> ml = findEntityList(Medexam.class, fields);
       
        ArrayList<MedexamClientChunk> res = new ArrayList<MedexamClientChunk>();
        for (int j = 0; j < ml.size(); j++) {
            Medexam medexam = ml.get(j);
            Client client = medexam.getDisease().getEmc().getClient();
            res.add(new MedexamClientChunk(medexam.getDetails(this), client.getDetails(this)));
        }
        return res;         
    }
View Full Code Here

TOP

Related Classes of beans.service.medexam.Medexam

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.