Package com.nayidisha.pointy.domain

Examples of com.nayidisha.pointy.domain.Patient


  @Transactional(readOnly=false)
  @Override
  public void deletePatient(Long patientId) {
    if (patientId != null){
      Patient patient = patientDAO.load(patientId);
      patientDAO.delete(patient);
    }
   
  }
View Full Code Here


    Session session = getSession();
    Criteria criteria = session.createCriteria(Patient.class);

    criteria.add(Restrictions.eq("lastName", lastName));

    Patient patient = (Patient) criteria.uniqueResult();
   
    return patient;
  }
View Full Code Here

  }
 
  @RequestMapping(method = RequestMethod.GET, value="/{patientId}")
  public @ResponseBody ApiResponse<Patient> getPatient(@PathVariable("patientId") String id){
    ApiResponse<Patient> apiResponse = new ApiResponse<Patient>();
    Patient patient = patientService.findPatientById(Long.valueOf(id));
    if (patient != null){
      apiResponse.setPayload(patient);
      apiResponse.setStatus(ApiResponse.STATUS_SUCCESS);
    }
    return apiResponse;
View Full Code Here

 
  @Before
  public void setup() {
    this.mockMvc = webAppContextSetup(this.wac).build();
   
    Patient patient = this.createTestPatient()
    patientService.createPatient(patient);
    createdPatientId = patient.getId();
  }
View Full Code Here

    .andExpect(content().string(containsString(String.valueOf(createdPatientId))));
 
 
  @Test
  public void testInsertingPatient() throws Exception {
    Patient testPatientToInsert = this.createTestPatient();
    ResultActions resultActions = null;
    ApiResponse<Patient> retrievedPatient = null;
    try {
      resultActions = this.mockMvc.perform(post("/patients").content(convertObjectToBytes(testPatientToInsert)).contentType(MediaType.APPLICATION_JSON));
      LOG.debug("RestultActons: " + resultActions.andReturn().getResponse().getContentAsString()) ;
View Full Code Here

    jacksonObjectMapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
    return jacksonObjectMapper.readValue(jsonString, new TypeReference<ApiResponse<Patient>>() {});
  }
 
  private Patient createTestPatient() {
    patient = new Patient();
    patient.setFirstName("aFirstName");
    patient.setLastName("aLastName");
    patient.setAddress("anAddress");
    patient.setCity("aCity");
    patient.setState("aState");
View Full Code Here

   
    tomorrow = today.plusDays(1);
    dayAfter = tomorrow.plusDays(1);
    yesterday = today.minusDays(1);
   
    Patient patient1 = this.createTestPatient(yesterday);
    Patient patient2 = this.createTestPatient(todayInTheAM);
    Patient patient25 = this.createTestPatient(todayInThePM);
    Patient patient3 = this.createTestPatient(tomorrow);
    Patient patient4 = this.createTestPatient(dayAfter);
   
    patientService.createPatient(patient1);
    patientService.createPatient(patient2);
    patientService.createPatient(patient25);
    patientService.createPatient(patient3);
    patientService.createPatient(patient4);
    createdPatientId1 = patient1.getId();
    createdPatientId2 = patient2.getId();
    createdPatientId25 = patient25.getId();
    createdPatientId3 = patient3.getId();
    createdPatientId4 = patient4.getId();
  }
View Full Code Here

    jacksonObjectMapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
    return jacksonObjectMapper.readValue(jsonString, new TypeReference<ApiResponse<List<VisitFrequency>>>() {});
  }
 
  private Patient createTestPatient(DateTime datetime) {
    Patient patient = new Patient();
    patient.setFirstName("aFirstName");
    patient.setLastName("aLastName");
    patient.setAddress("anAddress");
    patient.setCity("aCity");
    patient.setState("aState");
    patient.setVisitDate(datetime.toDate());
    return patient;
  }
View Full Code Here

TOP

Related Classes of com.nayidisha.pointy.domain.Patient

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.