Examples of HealthrecordRequest


Examples of com.krminc.phr.domain.HealthrecordRequest

        }
    }

    //helper method for requestAccess
    private boolean createDbRequest(Long requestedHealthrecordId) {
        HealthrecordRequest request = null;
        try {
            request = new HealthrecordRequest(requestedHealthrecordId.intValue(), getLocalUser().getUserId().intValue());
        }
        catch (Exception ex){
            throw new WebApplicationException(Response.Status.PRECONDITION_FAILED);
        }

        //persist request here via EM
        PersistenceService persistenceSvc = PersistenceService.getInstance();
        try {
            persistenceSvc.beginTx();
            EntityManager em = persistenceSvc.getEntityManager();
            request = em.merge(request);
            persistenceSvc.commitTx();
        } catch (Exception ex) {
            //ignored
        } finally {
            persistenceSvc.close();
        }

        return (request.getRequestId() > 0);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.