Package systole.synchronization.remote.ws

Examples of systole.synchronization.remote.ws.AnalysisWs


    public AnalysisWs generateRemoteAnalysis(Analysis analysis) throws ExceptionDAO {
        if (analysis == null) {
            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());
        }

        SignalFrequencyRemote frequencyRemote = FacadeDB.getInstance().getSignalFrequencySyncBroker().getFrequencyRemoteBySignalFrequency(analysis.getSignalFrequency());

        if (frequencyRemote == null) {
            return null;
        }

        analysisWs.setSignalFrequencyId(frequencyRemote.getRemoteId());

        ClinicalInfoRemote clinicalInfoRemote = FacadeDB.getInstance().getClinicalInfoSyncBroker().getClinicalInfoRemoteByClinicalInfo(analysis.getClinicalInformation());

        if (clinicalInfoRemote == null) {
            return null;
        }
        analysisWs.setClinicalInfoId(clinicalInfoRemote.getRemoteId());

        analysisWs.setDate(this.dateToXMLGregorianCalendar(analysis.getAnalysisDay()));
        analysisWs.setRawSignal(this.convertToRemoteRawSignal(analysis.getRawSignal(), analysis));
        analysisWs.setReport(this.convertToRemoteReport(analysis.getReport()));
        analysisWs.setResult(this.convetToRemoteAnalysisResult(analysis.getAnalysisResult()));
        analysisWs.setFinalSignal(this.convertToRemoteFinalSignal(analysis.getFinalSegment()));
        Iterator<SelectedSegment> segments = analysis.getSelectedSegments().iterator();
        while (segments.hasNext()) {
            SelectedSegmentWs selectedSegmentWs = this.convetToRemoteSelectedSegments(segments.next());
            if (selectedSegmentWs != null) {
                analysisWs.getSelectedSegments().add(selectedSegmentWs);
            }
        }
        return analysisWs;
    }
View Full Code Here

TOP

Related Classes of systole.synchronization.remote.ws.AnalysisWs

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.