Package systole.domain.clinicalInformation

Examples of systole.domain.clinicalInformation.Medicine


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

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


     * @see systole.view.crud.controller.ControllerEntityEdition#loadEntityOnForm()
     */
    @Override
    protected void loadEntityOnForm() {
        JDialogMedicine formToLoad = (JDialogMedicine) this.editForm;
        Medicine currentMedicine = (Medicine) this.curretnEntity;
        formToLoad.getjEdtName().setText(currentMedicine.getName());
        formToLoad.getjTxtDescription().setText(currentMedicine.getDescription());
   
View Full Code Here

     * @see systole.view.crud.controller.ControllerEntityEdition#valid()
     */
    @Override
    protected String valid() {
        JDialogMedicine formToValidate = (JDialogMedicine) this.editForm;
        Medicine medicine = (Medicine) this.curretnEntity;

        if ((formToValidate.getjEdtName().getText() == null) || (formToValidate.getjEdtName().getText().isEmpty())) {
            return "Debe ingresar el nombre del medicamento";
        }

        try {
            if (this.facadeDB.getMedicineBroker().existMedicine(formToValidate.getjEdtName().getText(), medicine.getId())) {
                return "Ya existe un medicamento con el nombre ingresado";
            }
        } catch (ExceptionDAO ex) {
            this.facadeDB.refreshSession();
            return ex.getMessage();
View Full Code Here

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

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

    public boolean uploadMedicines() {
        try {
            this.log.logDebug("Start to upload medicines");
            Iterator<Medicine> medicinesToUpload = this.facadeDB.getMedicineSyncBroker().getMedicinesToUpload().iterator();
            while (medicinesToUpload.hasNext()) {
                Medicine medicine = medicinesToUpload.next();
                MedicineWs medicineWs = this.toRemoteEntity.generateRemoteMedicine(medicine);
                if (medicineWs != null) {
                    int remoteId = this.systoleSync.uploadMedicine(medicineWs);
                    if (remoteId > 0) {
                        MedicineRemote medicineRemote = new MedicineRemote(medicine);
View Full Code Here

            if ((form.getCmbMedicines().getSelectedIndex() == -1) || (form.getCmbMedicines().getSelectedItem() == null)) {
                return "Debe seleccionar un medicamento";
            }

            try {
                Medicine medicine = (Medicine) form.getCmbMedicines().getSelectedItem();
                if (this.facadeDB.getMedicineByPatientBroker().existMedicineByPatient(medicine, this.patient)) {
                    return "Ya existe el medicamento para el paciente";
                }
            } catch (ExceptionDAO ex) {
                this.facadeDB.refreshSession();
View Full Code Here

    public void saveMedicine(MedicineWs medicineWS) throws ExceptionDAO {
        if (medicineWS == null) {
            return;
        }
        FacadeDB.getInstance().startTransaction();
        Medicine medicine = FacadeDB.getInstance().getMedicineBroker().getMedicineByName(medicineWS.getName());
        if (medicine == null) {
            medicine = new Medicine();
            medicine.setName(medicineWS.getName());
            medicine.setDescription(medicine.getDescription());
            FacadeDB.getInstance().getMedicineBroker().insert(medicine);
            MedicineRemote medicineRemote = new MedicineRemote(medicine);
            medicineRemote.setRemoteId(medicineWS.getId());
            FacadeDB.getInstance().getMedicineSyncBroker().saveMedicineRemote(medicineRemote);
        } else {
View Full Code Here

     */
    private MedicinePatient convertToLocalPatientMedicine(PatientMedicineWs patientMedicineWs, Patient patient) throws ExceptionDAO {
        if (patientMedicineWs == null) {
            return null;
        }
        Medicine medicine = FacadeDB.getInstance().getMedicineSyncBroker().getMedicineByRemoteId(patientMedicineWs.getMedicineId());
        if (medicine == null) {
            return null;
        }
        MedicinePatient medicinePatient = new MedicinePatient();
        MedicinePatientId id = new MedicinePatientId(medicine.getId(), patient.getId());
        medicinePatient.setId(id);
        medicinePatient.setMedicine(medicine);
        medicinePatient.setPatient(patient);
        Integer difAges = patient.getAge() - patientMedicineWs.getAgeAtStart();
        medicinePatient.setAgeAtStartAsInteger(difAges);
View Full Code Here

TOP

Related Classes of systole.domain.clinicalInformation.Medicine

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.