class ManterPrescricaoMedicamentoON extends BaseBusiness {

	public void excluirPrescricaoMedicamento(MpmPrescricaoMdto prescricaoMedicamento) 
	throws ApplicationBusinessException {
		try {
			
			//########################################################################################################################
			//FIXME MIGRAÇÃO: Aqui alterou o valor do atributo que agora deve ser passado como parâmetro
			//this.getItemPrescricaoMedicamentoRN().setaAtributoDeletarItemPrescricaoMedicamento(Boolean.TRUE);
			//########################################################################################################################
			Boolean autoExcluirProcedimentoMedicamentoSol  = Boolean.TRUE;
			if (prescricaoMedicamento.getItensPrescricaoMdtos() != null) {
				for (MpmItemPrescricaoMdto itemPrescricaoMedicamento : prescricaoMedicamento
						.getItensPrescricaoMdtos()) {
					getItemPrescricaoMedicamentoRN().excluirItemPrescricaoMedicamento(itemPrescricaoMedicamento, autoExcluirProcedimentoMedicamentoSol);
				}
			}
			
			getPrescricaoMedicamentoRN().excluirPrescricaoMedicamento(
					prescricaoMedicamento);

			getPrescricaoMedicamentoRN().flush();
			
		//########################################################################################################################
			//FIXME MIGRAÇÃO: Mas depois de fazer todo o processo, ele tem que passar a váriavel para FALSE de novo
			//Será que devo retornar o valor desta variável? 
			//this.getItemPrescricaoMedicamentoRN().setaAtributoDeletarItemPrescricaoMedicamento(Boolean.FALSE);
		} catch(ApplicationBusinessException | BaseRuntimeException  e){
			//Mas como fazer isso se tem um throw?
			//this.getItemPrescricaoMedicamentoRN().setaAtributoDeletarItemPrescricaoMedicamento(Boolean.FALSE);
			LOG.error("Erro", e);
			throw e;
		}
		//########################################################################################################################
	}

}