Package systole.domain.persons

Examples of systole.domain.persons.Patient


    }

    @Override
    protected void buildPatientInfo(Analysis analysis) throws DocumentException {

        Patient patient = analysis.getPatient();
        Chunk pat = new Chunk(EntityDescriptions.PATIENT + ": " + patient.getFullName());
        pat.setFont(new Font(Font.FontFamily.TIMES_ROMAN, 14, Font.BOLD));
        this.document.add(pat);
        this.document.add(Chunk.NEWLINE);
        this.document.add(Chunk.NEWLINE);

        Medic medic = analysis.getMedic();
        if (medic != null) {
            Chunk med = new Chunk(ReportTexts.request_by + medic.getFullName());
            med.setFont(new Font(Font.FontFamily.TIMES_ROMAN, 12, Font.BOLD));
            this.document.add(med);
            this.writeEmptyLine();
        }

        int amount = this.getAmountOfData();

        if (amount > 0) {
            PdfPTable patientTable = new PdfPTable(amount);
            patientTable.setWidthPercentage(90);

            Font title = new Font(this.fontMapper.awtToPdf(this.reportSettingsProperties.loadDataFont()));
            Font value = new Font(this.fontMapper.awtToPdf(this.reportSettingsProperties.loadDataValueFont()));

            // PUT HEADERS

            if (this.reportSettingsProperties.loadUseAge()) {
                Chunk a = new Chunk("Edad");
                a.setFont(title);
                PdfPCell ages = new PdfPCell(new Paragraph(a));
                ages.setHorizontalAlignment(Element.ALIGN_CENTER);
                ages.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(ages);
            }

            if (this.reportSettingsProperties.loadUseWeight()) {
                Chunk p = new Chunk("Peso" + System.getProperty("line.separator") + Units.kilograms);
                p.setFont(title);
                PdfPCell weight = new PdfPCell(new Paragraph(p));
                weight.setHorizontalAlignment(Element.ALIGN_CENTER);
                weight.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(weight);
            }

            if (this.reportSettingsProperties.loadUseHeight()) {
                Chunk h = new Chunk("Altura" + System.getProperty("line.separator") + Units.Centimetres);
                h.setFont(title);
                PdfPCell height = new PdfPCell(new Paragraph(h));
                height.setHorizontalAlignment(Element.ALIGN_CENTER);
                height.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(height);
            }

            if (this.reportSettingsProperties.loadUsePS()) {
                Chunk pss = new Chunk("PS" + System.getProperty("line.separator") + Units.pressure);
                pss.setFont(title);
                PdfPCell ps = new PdfPCell(new Paragraph(pss));
                ps.setHorizontalAlignment(Element.ALIGN_CENTER);
                ps.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(ps);
            }

            if (this.reportSettingsProperties.loadUsePD()) {
                Chunk pdd = new Chunk("PD" + System.getProperty("line.separator") + Units.pressure);
                pdd.setFont(title);
                PdfPCell pd = new PdfPCell(new Paragraph(pdd));
                pd.setHorizontalAlignment(Element.ALIGN_CENTER);
                pd.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(pd);
            }

            if (this.reportSettingsProperties.loadUseSmoke()) {
                Chunk sm = new Chunk("Fuma");
                sm.setFont(title);
                PdfPCell smooke = new PdfPCell(new Paragraph(sm));
                smooke.setHorizontalAlignment(Element.ALIGN_CENTER);
                smooke.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(smooke);
            }

            // PUT DATA

            if (this.reportSettingsProperties.loadUseAge()) {
                Chunk years = new Chunk(patient.getAge().toString());
                years.setFont(value);
                PdfPCell agesValue = new PdfPCell(new Paragraph(years));
                agesValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                agesValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(agesValue);
            }

            if (this.reportSettingsProperties.loadUseWeight()) {
                Chunk weightP = new Chunk(analysis.getClinicalInformation().getWeightAsString(false));
                weightP.setFont(value);
                PdfPCell weightValue = new PdfPCell(new Paragraph(weightP));
                weightValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                weightValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(weightValue);
            }

            if (this.reportSettingsProperties.loadUseHeight()) {
                Chunk heightP = new Chunk(analysis.getClinicalInformation().getHeightAsString(false));
                heightP.setFont(value);
                PdfPCell heightValue = new PdfPCell(new Paragraph(heightP));
                heightValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                heightValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(heightValue);
            }

            if (this.reportSettingsProperties.loadUsePS()) {
                Chunk psCk = new Chunk(analysis.getClinicalInformation().getSystolicPressureAsString(false));
                psCk.setFont(value);
                PdfPCell psValue = new PdfPCell(new Paragraph(psCk));
                psValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                psValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(psValue);
            }

            if (this.reportSettingsProperties.loadUsePD()) {
                Chunk pdCk = new Chunk(analysis.getClinicalInformation().getDiastolicPressureAsString(false));
                pdCk.setFont(value);
                PdfPCell pdValue = new PdfPCell(new Paragraph(pdCk));
                pdValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                pdValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(pdValue);
            }

            if (this.reportSettingsProperties.loadUseSmoke()) {
                Chunk smk = new Chunk(patient.getClinicalHistoryProxy().getIsSmoker());
                smk.setFont(value);
                PdfPCell smookeValue = new PdfPCell(new Paragraph(smk));
                smookeValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                smookeValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(smookeValue);
View Full Code Here


    }

    @Override
    protected void loadEntityOnForm() {
        JDialogPatient formToLoad = (JDialogPatient) this.editForm;
        Patient currentPatient = (Patient) this.curretnEntity;

        formToLoad.getjEdtSurname().setText(currentPatient.getSurname());
        formToLoad.getjEdtName().setText(currentPatient.getName());
        if (currentPatient.getIdentityCard() != null) {
            formToLoad.getjCmbIdentityType().setSelectedItem(
                    currentPatient.getIdentityCard().getCardType());
            formToLoad.getjEdtIdentityNumber().setText(currentPatient.getIdentityCard().getNumber()!=null?
                    currentPatient.getIdentityCard().getNumber().toString():"");
        }
        formToLoad.getjCmbSex().setSelectedItem(currentPatient.getSex());
        formToLoad.getjEdtCellphone().setText(currentPatient.getCellphone());
        formToLoad.getjEdtMail().setText(currentPatient.getEmail());
        formToLoad.getjEdtPhone().setText(currentPatient.getTelephone());
        formToLoad.getjXEdtBirthdate().setDate(currentPatient.getBirthdate());
        formToLoad.getjTxtAge().setText(currentPatient.getAge().toString());
        formToLoad.getDateLastMedicVisit().setDate(currentPatient.getLastMedicVisit());
        formToLoad.getChkUnderObs().setSelected((currentPatient.getUnderMedicalObservation() != null) ? currentPatient.getUnderMedicalObservation().booleanValue() : false);
        formToLoad.getjEdtAddress().setText(currentPatient.getAddress());
        formToLoad.getjEdtCity().setText(currentPatient.getCity());

        if (currentPatient.getProfession() != null) {
            formToLoad.getjCmbProfession().setSelectedItem(currentPatient.getProfession());
        }

        if (currentPatient.getMedic() != null) {
            formToLoad.getCmbHeadPhysician().setSelectedItem(currentPatient.getMedic());
        }

        if (currentPatient.getHabitPatient() != null) {

            formToLoad.getCmbAngryLevel().setSelectedIndex((currentPatient.getHabitPatient().getAngryLevel() != null) ? currentPatient.getHabitPatient().getAngryLevel().intValue() : -1);
            formToLoad.getCmbStressLevel().setSelectedIndex((currentPatient.getHabitPatient().getStressLevel() != null) ? currentPatient.getHabitPatient().getStressLevel().intValue() : -1);
            formToLoad.getChkAutoMedication().setSelected((currentPatient.getHabitPatient().getAutomedication() != null) ? currentPatient.getHabitPatient().getAutomedication().booleanValue() : false);
            formToLoad.getjChkDrink().setSelected((currentPatient.getHabitPatient().getConsummingAlcohol() != null) ? currentPatient.getHabitPatient().getConsummingAlcohol().booleanValue() : false);
            formToLoad.getSpinWalkedSquares().setValue((currentPatient.getHabitPatient().getBlocksWalkedPerDay() != null) ? currentPatient.getHabitPatient().getBlocksWalkedPerDay().intValue() : 0);
            formToLoad.getChkSedentarism().setSelected((currentPatient.getHabitPatient().getSedentary() != null) ? currentPatient.getHabitPatient().getSedentary().booleanValue() : false);
            formToLoad.getTxtWorkplace().setText(currentPatient.getHabitPatient().getWorkPlace() != null ? currentPatient.getHabitPatient().getWorkPlace() : "");
            formToLoad.getjRbNeverSmoke().setSelected((!currentPatient.getHabitPatient().getSmoked().booleanValue()) && (!currentPatient.getHabitPatient().getSmoking().booleanValue()));
            formToLoad.getjRbIsSmoker().setSelected(currentPatient.getHabitPatient().getSmoking().booleanValue());
            formToLoad.getjRbWasSmoker().setSelected(currentPatient.getHabitPatient().getSmoked().booleanValue());
            formToLoad.getjTxtYearsAtStartSmooking().setText(currentPatient.getHabitPatient().getYearsOldAtStart() != null ? currentPatient.getHabitPatient().getYearsOldAtStart().toString() : "");
            formToLoad.getjTxtYearsAtEndSmooking().setText(currentPatient.getHabitPatient().getYearsOldAtFinish() != null ? currentPatient.getHabitPatient().getYearsOldAtFinish().toString() : "");
            formToLoad.getjSpnCigarettsPerDay().setValue((currentPatient.getHabitPatient().getCigarettesPerDay() != null) ? currentPatient.getHabitPatient().getCigarettesPerDay().intValue() : 0);
        }
        formToLoad.intiSmokeHabits();
    }
View Full Code Here

    }

    @Override
    protected void loadEntityFromForm() {

        Patient patientToLoad = (Patient) this.curretnEntity;
        JDialogPatient formToLoad = (JDialogPatient) this.editForm;

        patientToLoad.setSurname(formToLoad.getjEdtSurname().getText());
        patientToLoad.setName(formToLoad.getjEdtName().getText());

        if (patientToLoad.getIdentityCard() == null) {
            patientToLoad.setIdentityCard(new IdentityCard());

        }

        patientToLoad.getIdentityCard().setCardType(
                (IdentityCardType) formToLoad.getjCmbIdentityType().getSelectedItem());
        try {
            patientToLoad.getIdentityCard().setNumber(
                    Integer.parseInt(formToLoad.getjEdtIdentityNumber().getText()));
        } catch (NumberFormatException e) {
            patientToLoad.getIdentityCard().setCardType(null);
        }
        patientToLoad.setSex((String) formToLoad.getjCmbSex().getSelectedItem());
        formToLoad.getjCmbSex().setSelectedItem(patientToLoad.getSex());
        patientToLoad.setCellphone(formToLoad.getjEdtCellphone().getText());
        patientToLoad.setEmail(formToLoad.getjEdtMail().getText());
        patientToLoad.setTelephone(formToLoad.getjEdtPhone().getText());
        patientToLoad.setBirthdate(formToLoad.getjXEdtBirthdate().getDate());
        patientToLoad.setMedic((Medic) formToLoad.getCmbHeadPhysician().getSelectedItem());
        patientToLoad.setLastMedicVisit(formToLoad.getDateLastMedicVisit().getDate());
        patientToLoad.setUnderMedicalObservation(formToLoad.getChkUnderObs().isSelected());
        patientToLoad.setAddress(formToLoad.getjEdtAddress().getText());
        patientToLoad.setCity(formToLoad.getjEdtCity().getText());

        patientToLoad.setProfession((Profession) formToLoad.getjCmbProfession().getSelectedItem());

        if (patientToLoad.getHabitPatient() == null) {
            patientToLoad.setHabitPatient(new HabitPatient(patientToLoad));
        }

        patientToLoad.getHabitPatient().setAngryLevel(formToLoad.getCmbAngryLevel().getSelectedIndex());
        patientToLoad.getHabitPatient().setStressLevel(formToLoad.getCmbStressLevel().getSelectedIndex());
        patientToLoad.getHabitPatient().setAutomedication(formToLoad.getChkAutoMedication().isSelected());
        patientToLoad.getHabitPatient().setConsummingAlcohol(formToLoad.getjChkDrink().isSelected());
        patientToLoad.getHabitPatient().setBlocksWalkedPerDay((Integer) formToLoad.getSpinWalkedSquares().getValue());
        patientToLoad.getHabitPatient().setSedentary(formToLoad.getChkSedentarism().isSelected());
        patientToLoad.getHabitPatient().setSmoking(formToLoad.getjRbIsSmoker().isSelected());
        patientToLoad.getHabitPatient().setSmoked(formToLoad.getjRbWasSmoker().isSelected());

        if ((patientToLoad.getHabitPatient().getSmoked()) || (patientToLoad.getHabitPatient().getSmoking())) {

            patientToLoad.getHabitPatient().setCigarettesPerDay((Integer) formToLoad.getjSpnCigarettsPerDay().getValue());

            Integer years;

            try {
                years = new Integer((formToLoad.getjTxtYearsAtStartSmooking().isEditValid()) ? formToLoad.getjTxtYearsAtStartSmooking().getText() : "0");
            } catch (NumberFormatException e) {
                years = 0;
            }
            patientToLoad.getHabitPatient().setYearsOldAtStart(years);

            if (patientToLoad.getHabitPatient().getSmoked()) {

                try {
                    years = new Integer((formToLoad.getjTxtYearsAtEndSmooking().isEditValid()) ? formToLoad.getjTxtYearsAtEndSmooking().getText() : "0");
                } catch (NumberFormatException e) {
                    years = 0;
                }
                patientToLoad.getHabitPatient().setYearsOldAtFinish(years);
            }

        } else {
            patientToLoad.getHabitPatient().setCigarettesPerDay(0);
            patientToLoad.getHabitPatient().setYearsOldAtStart(0);
            patientToLoad.getHabitPatient().setYearsOldAtFinish(0);
        }
        patientToLoad.setLastUpdate(Calendar.getInstance());
        patientToLoad.getHabitPatient().setWorkPlace(formToLoad.getTxtWorkplace().getText());
    }
View Full Code Here

        this.editForm.setIconImage(ImageUtils.buildImage("resources/icons/medic/Patient16.png"));
    }

    @Override
    protected Object createEntity() throws ExceptionDAO {
        Patient patient = new Patient();
        patient.setSurname("");
        patient.setName("");
        this.facadeDB.getPatientBroker().insert(patient);
        return patient;
    }
View Full Code Here

    @Override
    public Patient getPatientById(Integer id) throws ExceptionDAO {
        try {
            this.logger.logDebug("Getting patient");
            Session currentSession = FacadeDB.getInstance().getCurrentSession();
            Patient instance = (Patient) currentSession.get(Patient.class, id);
            this.logger.logDebug("get patient successfully");
            return instance;
        } catch (HibernateException e) {
            this.logger.logError("error on get patient by id, msg: " + e.getMessage());
            throw new ExceptionDAO("No se pudo obtener el Paciente", e.fillInStackTrace());
View Full Code Here

    public boolean uploadPatients() {
        try {
            this.log.logDebug("Start to upload patients");
            Iterator<Patient> patientsToUpload = this.facadeDB.getPatientSyncBroker().getPatientsToUpload().iterator();
            while (patientsToUpload.hasNext()) {
                Patient patient = patientsToUpload.next();
                PatientWs patientWs = this.toRemoteEntity.generateRemotePatient(patient);
                if (patientWs != null) {
                    int remoteId = this.systoleSync.uploadPatient(patientWs);
                    if (remoteId > 0) {
                        PatientRemote patientRemote = new PatientRemote(patient);
View Full Code Here

        analisys.setRawSignal(rawSignal);
        analisys.setCreationDay((Date) this.results.get("date"));
        analisys.setFilePath((String) this.results.get("signal"));
        analisys.setSignalFrequency((SignalFrequency) this.results.get("period"));
        analisys.setFileName((String) this.results.get("filename"));
        Patient patient = (Patient) this.results.get("patient");
        patient.getRawsignals().add(rawSignal);
        ClinicalInformation clinicalInformation = (ClinicalInformation) this.results.get("clinicalInfo");
        clinicalInformation.setPatient(patient);
        analisys.setPatient(patient);
        analisys.setClinicalInformation(clinicalInformation);

        Iterator<String> familyList = patient.getClinicalHistoryProxy().getFamilyBackground(2).iterator();
        Iterator<String> medicinesList = patient.getClinicalHistoryProxy().getPatientMedicines(2).iterator();
        Iterator<String> pathologiesList = patient.getClinicalHistoryProxy().getPatientPathologies(2).iterator();
        Iterator<String> surgeriesList = patient.getClinicalHistoryProxy().getPatientSurgeries(2).iterator();

        Report report = new Report();

        String family = "";
        while (familyList.hasNext()) {
View Full Code Here

    public void applyFilter() {
        if (this.changeFilter) {

            Medic medic = (this.analysisView.getjChkMedic().isSelected() ? (Medic) this.analysisView.getjCmbMedics().getSelectedItem() : null);
            Patient patient = (this.analysisView.getjChkPatient().isSelected() ? (Patient) this.analysisView.getjCmbPatients().getSelectedItem() : null);
            Date date = (this.analysisView.getjChkDate().isSelected() ? this.analysisView.getjXDateAnalysis().getDate() : null);
            try {
                this.entityList = this.facadeDB.getAnalysisBroker().getAnalysisByDateMedicaPatiente(date, patient, medic);
                this.tableModel.refreshList(this.entityList);
                this.analysisView.getjXTableAnalysis().setModel(this.tableModel);
View Full Code Here

        return result;
    }

    @Override
    public void setPreviousStepData(WizardResult result) {
        Patient patient = (Patient) result.getObject("patient");
        if (patient!=null){
            this.page.loadLastClinicalInfo(patient);
        }
    }
View Full Code Here

    public void savePatient(PatientWs patientWs) throws ExceptionDAO {
        if (patientWs == null) {
            return;
        }
        FacadeDB.getInstance().startTransaction();
        Patient patient = new Patient();
        patient.setName(patientWs.getName());
        patient.setSurname(patientWs.getSurname());
        patient.setBirthdate(this.xmlGregorianCalendarToDate(patientWs.getBirthdate()));
        patient.setAddress(patientWs.getAddress());
        patient.setCity(patientWs.getCity());
        patient.setSex(patientWs.isSex() ? "M" : "F");
        patient.setTelephone(patientWs.getTelephone());
        patient.setEmail(patientWs.getEmail());
        patient.setIdentityCard(this.convertToLocalIdentityCard(patientWs.getIdentityCard()));
        FacadeDB.getInstance().getPatientBroker().insert(patient);

        PatientRemote patientRemote = new PatientRemote();
        patientRemote.setRemoteId(patientWs.getId());
        patientRemote.setPatient(patient);
        FacadeDB.getInstance().getPatientSyncBroker().savePatientRemote(patientRemote);
        patient.setHabitPatient(this.convertToLocalHabitPatient(patientWs.getHabits(), patient));

        if (patientWs.getMedicines() != null) {
            Iterator<PatientMedicineWs> medicines = patientWs.getMedicines().iterator();
            while (medicines.hasNext()) {
                MedicinePatient medicinePatient = this.convertToLocalPatientMedicine(medicines.next(), patient);
                if (medicinePatient != null) {
                    patient.getMedicinesPatient().add(medicinePatient);
                }
            }
        }

        if (patientWs.getPathologies() != null) {
            Iterator<PatientPathologyWs> pathologies = patientWs.getPathologies().iterator();
            while (pathologies.hasNext()) {
                PathologyPatient pathologyPatient = this.convertToLocalPatientPathology(pathologies.next(), patient);
                if (pathologyPatient != null) {
                    patient.getPathologiesPatient().add(pathologyPatient);
                }
            }
        }

        if (patientWs.getSports() != null) {
            Iterator<PatientSportWs> sports = patientWs.getSports().iterator();
            while (sports.hasNext()) {
                SportPatient sportPatient = this.convertToLocalPatientSport(sports.next(), patient);
                if (sportPatient != null) {
                    patient.getSportsPatient().add(sportPatient);
                }
            }
        }

        if (patientWs.getSurgeries() != null) {
            Iterator<PatientSurgeryWs> surgeries = patientWs.getSurgeries().iterator();
            while (surgeries.hasNext()) {
                SurgeryPatient surgeryPatient = this.convertToLocalPatientSurgery(surgeries.next(), patient);
                if (surgeryPatient != null) {
                    patient.getSurgeriesPatient().add(surgeryPatient);
                }
            }
        }

        if (patientWs.getFamilyBackground() != null) {
            Iterator<PatientFamilyWs> backgrounds = patientWs.getFamilyBackground().iterator();
            while (backgrounds.hasNext()) {
                FamilyPatientBackground background = this.convertToLocalPatientFamilyBackground(backgrounds.next(), patient);
                if (background != null) {
                    patient.getFamilyPatientBackgrounds().add(background);
                }
            }
        }

        FacadeDB.getInstance().getPatientBroker().update(patient);
View Full Code Here

TOP

Related Classes of systole.domain.persons.Patient

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.