Examples of HealthRecord


Examples of com.krminc.phr.domain.HealthRecord

                     self = getLocalUser(); //requires tx started

                     //find the correct hr
                     List<HealthRecord> healthRecords = self.getHealthRecords();
                     boolean shouldRemove = false;
                     HealthRecord toRemove = null;

                     for (HealthRecord hr : healthRecords) {
                         //prepare to remove link
                         if (healthRecordIdToRemove.compareTo(hr.getHealthRecordId()) == 0) {
                             toRemove = hr;
View Full Code Here

Examples of com.krminc.phr.domain.HealthRecord

            requests = em.createNamedQuery("HealthrecordRequest.findByUserIdRequestor")
                    .setParameter("userIdRequestor", getLocalUser().getUserId())
                    .getResultList();
           
            for (HealthrecordRequest req : requests) {
                HealthRecord rec = (HealthRecord) em.createNamedQuery("HealthRecord.findByHealthRecordId")
                            .setParameter("healthRecordId", req.getRecIdRequested())
                            .getSingleResult();
                usernames.add(rec.getUser()
                                .getUsername()
                        ); //this is not optimized at all
            }
           
        } catch (Exception ex) {
View Full Code Here

Examples of com.krminc.phr.domain.HealthRecord

     * @param newEntity the entity containing the new data
     * @return the updated entity
     */
    protected MedicalEvent updateEntity(MedicalEvent entity, MedicalEvent newEntity) {
        EntityManager em = PersistenceService.getInstance().getEntityManager();
        HealthRecord hr = entity.getHealthRecord();
        HealthRecord hrNew = newEntity.getHealthRecord();
        entity = em.merge(newEntity);
        return entity;
    }
View Full Code Here

Examples of com.krminc.phr.domain.HealthRecord

        PersistenceService persistenceSvc = PersistenceService.getInstance();
        try {
            persistenceSvc.beginTx();
            EntityManager em = persistenceSvc.getEntityManager();
            HealthRecord entity = data.resolveEntity(em);
            createEntity(data.resolveEntity(em));
            persistenceSvc.commitTx();
            return Response.created(uriInfo.getAbsolutePath().resolve(entity.getHealthRecordId() + "/")).build();
        } finally {
            persistenceSvc.close();
        }
    }
View Full Code Here

Examples of com.krminc.phr.domain.HealthRecord

    @Path("info/")
    @GET
    @Produces({ MediaType.APPLICATION_JSON })
    public JSONObject getPatientInfo() {

        HealthRecord hr = null;
        JSONObject jSONObject = new JSONObject();

        PersistenceService persistenceSvc = PersistenceService.getInstance();
        try {
            persistenceSvc.beginTx();
            hr = getEntity();
            jSONObject.put("name", hr.getUser().getFullName());
            jSONObject.put("gender", hr.getFullGender());
            jSONObject.put("age", hr.getAge());
        } catch (JSONException ex) {
        } finally {
            PersistenceService.getInstance().close();
        }
View Full Code Here

Examples of com.krminc.phr.domain.HealthRecord

     * @param newEntity the entity containing the new data
     * @return the updated entity
     */
    protected Weight updateEntity(Weight entity, Weight newEntity) {
        EntityManager em = PersistenceService.getInstance().getEntityManager();
        HealthRecord hr = entity.getHealthRecord();
        HealthRecord hrNew = newEntity.getHealthRecord();
        entity = em.merge(newEntity);
        return entity;
    }
View Full Code Here

Examples of com.krminc.phr.domain.HealthRecord

     * Returns the resolved Weight entity.
     *
     * @return an resolved entity
     */
    public Weight resolveEntity(EntityManager em) {
        HealthRecord healthRecord = entity.getHealthRecord();
        if (healthRecord != null) {
            entity.setHealthRecord(em.getReference(HealthRecord.class, healthRecord.getHealthRecordId()));
        }
        return entity;
    }
View Full Code Here

Examples of com.krminc.phr.domain.HealthRecord

     * @param newEntity the entity containing the new data
     * @return the updated entity
     */
    protected Immunization updateEntity(Immunization entity, Immunization newEntity) {
        EntityManager em = PersistenceService.getInstance().getEntityManager();
        HealthRecord hr = entity.getHealthRecord();
        HealthRecord hrNew = newEntity.getHealthRecord();
        entity = em.merge(newEntity);
        return entity;
    }
View Full Code Here

Examples of com.krminc.phr.domain.HealthRecord

     * Returns the resolved HeartRate entity.
     *
     * @return an resolved entity
     */
    public HeartRate resolveEntity(EntityManager em) {
        HealthRecord healthRecord = entity.getHealthRecord();
        if (healthRecord != null) {
            entity.setHealthRecord(em.getReference(HealthRecord.class, healthRecord.getHealthRecordId()));
        }
        return entity;
    }
View Full Code Here

Examples of com.krminc.phr.domain.HealthRecord

     * @param newEntity the entity containing the new data
     * @return the updated entity
     */
    protected Visit updateEntity(Visit entity, Visit newEntity) {
        EntityManager em = PersistenceService.getInstance().getEntityManager();
        HealthRecord hr = entity.getHealthRecord();
        HealthRecord hrNew = newEntity.getHealthRecord();
        entity = em.merge(newEntity);
        return entity;
    }
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.