Package systole.domain.clinicalInformation

Examples of systole.domain.clinicalInformation.Surgery


    /* (non-Javadoc)
     * @see systole.view.crud.controller.ControllerEntityEdition#loadEntityFromForm()
     */
    @Override
    protected void loadEntityFromForm() {
        Surgery currentSurgery = (Surgery) this.curretnEntity;
        JDialogSurgery formToLoad = (JDialogSurgery) this.editForm;

        currentSurgery.setName(formToLoad.getjEdtName().getText());
        currentSurgery.setDescription(formToLoad.getjTxtDescription().getText());
        currentSurgery.setLastUpdate(Calendar.getInstance());
    }
View Full Code Here


     * @see systole.view.crud.controller.ControllerEntityEdition#loadEntityOnForm()
     */
    @Override
    protected void loadEntityOnForm() {
        JDialogSurgery formToLoad = (JDialogSurgery) this.editForm;
        Surgery currentSurgery = (Surgery) this.curretnEntity;
        formToLoad.getjEdtName().setText(currentSurgery.getName());
        formToLoad.getjTxtDescription().setText(currentSurgery.getDescription());

    }
View Full Code Here

     */

    @Override
    protected String valid() {
        JDialogSurgery formToValid = (JDialogSurgery) this.editForm;
        Surgery surgery = (Surgery) this.curretnEntity;

        if ((formToValid.getjEdtName().getText() == null) || (formToValid.getjEdtName().getText().isEmpty())) {
            return "Debe ingresar el nombre de la cirugía";
        }

        try {
            if (this.facadeDB.getSportBroker().existSport(formToValid.getjEdtName().getText(), surgery.getId())) {
                return "Ya existe un deporte con el nombre ingresado";
            }

        } catch (ExceptionDAO ex) {
            this.facadeDB.refreshSession();
View Full Code Here

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

    @Override
    protected Object createEntity() throws ExceptionDAO {
        return new Surgery();
    }
View Full Code Here

    @Override
    public Surgery getSurgeryById(Integer id) throws ExceptionDAO {
        try {
            this.logger.logDebug("getting surgery by id, id: " + id);
            Session currentSession = FacadeDB.getInstance().getCurrentSession();
            Surgery instance = (Surgery) currentSession.get(Surgery.class, id);
            this.logger.logDebug("get surgery successfully");
            return instance;
        } catch (HibernateException e) {
            this.logger.logError("error on get surgery, msg: " + e.getMessage());
            throw new ExceptionDAO("No se pudo obtener la Cirugía", e.fillInStackTrace());
View Full Code Here

    public boolean uploadSurgeries() {
        try {
            this.log.logDebug("Start to upload Surgeries");
            Iterator<Surgery> surgeriesToUpload = this.facadeDB.getSurgerySyncBroker().getSurgeriesToUpload().iterator();
            while (surgeriesToUpload.hasNext()) {
                Surgery surgery = surgeriesToUpload.next();
                SurgeryWs surgeryWs = this.toRemoteEntity.generateRemoteSurgery(surgery);
                if (surgeryWs != null) {
                    int remoteId = this.systoleSync.uploadSurgery(surgeryWs);
                    if (remoteId > 0) {
                        SurgeryRemote surgeryRemote = new SurgeryRemote(surgery);
View Full Code Here

    public void saveSurgery(SurgeryWs surgeryWs) throws ExceptionDAO {
        if (surgeryWs == null) {
            return;
        }
        FacadeDB.getInstance().startTransaction();
        Surgery surgery = FacadeDB.getInstance().getSurgeryBroker().getSurgeryByName(surgeryWs.getName());
        if (surgery == null) {
            surgery = new Surgery();
            surgery.setName(surgeryWs.getName());
            surgery.setDescription(surgeryWs.getDescription());
            FacadeDB.getInstance().getSurgeryBroker().insert(surgery);
            SurgeryRemote surgeryRemote = new SurgeryRemote(surgery);
            surgeryRemote.setRemoteId(surgeryWs.getId());
            FacadeDB.getInstance().getSurgerySyncBroker().saveSurgeryRemote(surgeryRemote);
        } else {
View Full Code Here

     */
    private SurgeryPatient convertToLocalPatientSurgery(PatientSurgeryWs patientSurgeryWs, Patient patient) throws ExceptionDAO {
        if (patientSurgeryWs == null) {
            return null;
        }
        Surgery surgery = FacadeDB.getInstance().getSurgerySyncBroker().getSurgeryByRemoteId(patientSurgeryWs.getSurgeryId());
        if (surgery == null) {
            return null;
        }
        SurgeryPatient surgeryPatient = new SurgeryPatient();
        SurgeryPatientId id = new SurgeryPatientId(patient.getId(), surgery.getId());
        surgeryPatient.setId(id);
        surgeryPatient.setSurgery(surgery);
        surgeryPatient.setPatient(patient);
        surgeryPatient.setAgeAtSurgery(patientSurgeryWs.getAgeAtSurgery());
        return surgeryPatient;
View Full Code Here

TOP

Related Classes of systole.domain.clinicalInformation.Surgery

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.