Package systole.synchronization.remote.entities

Examples of systole.synchronization.remote.entities.PatientRemote


         try {
            this.logger.logDebug("getting last remote patient sync");
            Session currentSession = FacadeDB.getInstance().getCurrentSession();
            Criteria criteria = currentSession.createCriteria(
                    PatientRemote.class).addOrder(Order.desc("remoteId")).setMaxResults(1);
            PatientRemote patientRemote = (PatientRemote) criteria.uniqueResult();
            this.logger.logDebug("get successfully");
            return (patientRemote != null ? patientRemote.getRemoteId() : -1);
        } catch (HibernateException e) {
            this.logger.logError("error on get last remote patient synchronized, msg: " + e.getMessage());
            throw new ExceptionDAO("No se pudieron obtener los pacientes", e.fillInStackTrace());
        }
    }
View Full Code Here


        try {
            this.logger.logDebug("getting patient remote by local patient");
            Session currentSession = FacadeDB.getInstance().getCurrentSession();
            Criteria criteria = currentSession.createCriteria(
                    PatientRemote.class).add(Restrictions.eq("patient", patient)).setMaxResults(1);
            PatientRemote sportRemote = (PatientRemote) criteria.uniqueResult();
            this.logger.logDebug("get successfully");
            return sportRemote;
        } catch (HibernateException e) {
            this.logger.logError("error on get remote patient by patient, msg: " + e.getMessage());
            throw new ExceptionDAO("No se pudieron obtener los pacientes", e.fillInStackTrace());
View Full Code Here

         try {
            this.logger.logDebug("getting patient by remote id");
            Session currentSession = FacadeDB.getInstance().getCurrentSession();
            Criteria criteria = currentSession.createCriteria(
                    PatientRemote.class).add(Restrictions.eq("remoteId", remoteId)).setMaxResults(1);
            PatientRemote patientRemote = (PatientRemote) criteria.uniqueResult();
            this.logger.logDebug("get successfully");
            return (patientRemote != null ? patientRemote.getPatient() : null);
        } catch (HibernateException e) {
            this.logger.logError("error on get patient by remote id, msg: " + e.getMessage());
            throw new ExceptionDAO("No se pudieron obtener los pacientes", e.fillInStackTrace());
        }
    }
View Full Code Here

                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);
                        patientRemote.setRemoteId(remoteId);
                        FacadeDB.getInstance().startTransaction();
                        FacadeDB.getInstance().getPatientSyncBroker().savePatientRemote(patientRemote);
                        FacadeDB.getInstance().commitTransaction();
                    }
                }
View Full Code Here

     */
    public ClinicalInfoWs generateRemoteClinicalInformation(ClinicalInformation clinicalInformation) throws ExceptionDAO {
        if (clinicalInformation == null) {
            return null;
        }
        PatientRemote patientRemote = FacadeDB.getInstance().getPatientSyncBroker().getPatientRemoteByPatient(clinicalInformation.getPatient());
        if (patientRemote == null) {
            return null;
        }

        ClinicalInfoWs clinicalInfoWs = new ClinicalInfoWs();
        clinicalInfoWs.setPatientId(patientRemote.getRemoteId());
        clinicalInfoWs.setAge(clinicalInformation.getYears());
        clinicalInfoWs.setDate(this.dateToXMLGregorianCalendar(clinicalInformation.getInformationDate()));
        clinicalInfoWs.setWeight(clinicalInformation.getWeight());
        clinicalInfoWs.setHeight(clinicalInformation.getHeight());
        clinicalInfoWs.setHdl(clinicalInformation.getHdl());
View Full Code Here

            return null;
        }

        AnalysisWs analysisWs = new AnalysisWs();

        PatientRemote patientRemote = FacadeDB.getInstance().getPatientSyncBroker().getPatientRemoteByPatient(analysis.getPatient());

        if (patientRemote == null) {
            return null;
        }
        analysisWs.setPatientId(patientRemote.getRemoteId());

        if (analysis.getMedic() != null) {
            MedicRemote medicRemote = FacadeDB.getInstance().getMedicSyncBroker().getMedicRemoteByMedic(analysis.getMedic());
            analysisWs.setMedicId(medicRemote.getRemoteId());
        }
View Full Code Here

        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();
View Full Code Here

TOP

Related Classes of systole.synchronization.remote.entities.PatientRemote

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.