/** POST /evolutionPrescriptions -> Create a new evolutionPrescription. */
 @RequestMapping(
     value = "/episodes/{episode_id}/evolutionPrescriptions",
     method = RequestMethod.POST,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<EvolutionPrescription> createByEpisode(
     @PathVariable(value = "episode_id") Long episodeId,
     @RequestBody EvolutionPrescription evolutionPrescription)
     throws URISyntaxException {
   log.debug("REST request to save EvolutionPrescription : {}", evolutionPrescription);
   if (evolutionPrescription.getId() != null) {
     return ResponseEntity.badRequest()
         .header("Failure", "A new evolutionPrescription cannot already have an ID")
         .body(null);
   }
   Episode episode = new Episode();
   episode.setId(episodeId);
   evolutionPrescription.setEpisode(episode);
   EvolutionPrescription result = evolutionPrescriptionRepository.save(evolutionPrescription);
   return ResponseEntity.created(
           new URI("/api/episodes/" + episodeId + "/evolutionPrescriptions/" + result.getId()))
       .headers(
           HeaderUtil.createEntityCreationAlert(
               "evolutionPrescription", result.getId().toString()))
       .body(result);
 }
 /** DELETE /clinicHistorys/:id -> delete the "id" clinicHistory. */
 @RequestMapping(
     value = "/clinicHistorys/{id}",
     method = RequestMethod.DELETE,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<Void> delete(@PathVariable Long id) {
   log.debug("REST request to delete ClinicHistory : {}", id);
   clinicHistoryRepository.delete(id);
   return ResponseEntity.ok()
       .headers(HeaderUtil.createEntityDeletionAlert("clinicHistory", id.toString()))
       .build();
 }
 /** DELETE /evolutionPrescriptions/:id -> delete the "id" evolutionPrescription. */
 @RequestMapping(
     value = "/episodes/{episode_id}/evolutionPrescriptions/{id}",
     method = RequestMethod.DELETE,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<Void> deleteByEpisode(
     @PathVariable(value = "episode_id") Long episodeId, @PathVariable Long id) {
   log.debug("REST request to delete EvolutionPrescription : {}", id);
   evolutionPrescriptionRepository.delete(id);
   return ResponseEntity.ok()
       .headers(HeaderUtil.createEntityDeletionAlert("evolutionPrescription", id.toString()))
       .build();
 }
 /** PUT /clinicHistorys -> Updates an existing clinicHistory. */
 @RequestMapping(
     value = "/clinicHistorys",
     method = RequestMethod.PUT,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<ClinicHistory> update(@RequestBody ClinicHistory clinicHistory)
     throws URISyntaxException {
   log.debug("REST request to update ClinicHistory : {}", clinicHistory);
   if (clinicHistory.getId() == null) {
     return create(clinicHistory);
   }
   ClinicHistory result = clinicHistoryRepository.save(clinicHistory);
   return ResponseEntity.ok()
       .headers(
           HeaderUtil.createEntityUpdateAlert("clinicHistory", clinicHistory.getId().toString()))
       .body(result);
 }
 /** POST /clinicHistorys -> Create a new clinicHistory. */
 @RequestMapping(
     value = "/clinicHistorys",
     method = RequestMethod.POST,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<ClinicHistory> create(@RequestBody ClinicHistory clinicHistory)
     throws URISyntaxException {
   log.debug("REST request to save ClinicHistory : {}", clinicHistory);
   if (clinicHistory.getId() != null) {
     return ResponseEntity.badRequest()
         .header("Failure", "A new clinicHistory cannot already have an ID")
         .body(null);
   }
   ClinicHistory result = clinicHistoryRepository.save(clinicHistory);
   return ResponseEntity.created(new URI("/api/clinicHistorys/" + result.getId()))
       .headers(HeaderUtil.createEntityCreationAlert("clinicHistory", result.getId().toString()))
       .body(result);
 }
 /** PUT /evolutionPrescriptions -> Updates an existing evolutionPrescription. */
 @RequestMapping(
     value = "/evolutionPrescriptions",
     method = RequestMethod.PUT,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<EvolutionPrescription> update(
     @RequestBody EvolutionPrescription evolutionPrescription) throws URISyntaxException {
   log.debug("REST request to update EvolutionPrescription : {}", evolutionPrescription);
   if (evolutionPrescription.getId() == null) {
     return create(evolutionPrescription);
   }
   EvolutionPrescription result = evolutionPrescriptionRepository.save(evolutionPrescription);
   return ResponseEntity.ok()
       .headers(
           HeaderUtil.createEntityUpdateAlert(
               "evolutionPrescription", evolutionPrescription.getId().toString()))
       .body(result);
 }
 /** PUT /evolutionPrescriptions -> Updates an existing evolutionPrescription. */
 @RequestMapping(
     value = "/episodes/{episode_id}/evolutionPrescriptions",
     method = RequestMethod.PUT,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<EvolutionPrescription> updateByEpisode(
     @PathVariable(value = "episode_id") Long episodeId,
     @RequestBody EvolutionPrescription evolutionPrescription)
     throws URISyntaxException {
   log.debug("REST request to update EvolutionPrescription : {}", evolutionPrescription);
   if (evolutionPrescription.getId() == null) {
     return create(evolutionPrescription);
   }
   Episode episode = new Episode();
   episode.setId(episodeId);
   evolutionPrescription.setEpisode(episode);
   EvolutionPrescription result = evolutionPrescriptionRepository.save(evolutionPrescription);
   return ResponseEntity.ok()
       .headers(
           HeaderUtil.createEntityUpdateAlert(
               "evolutionPrescription", evolutionPrescription.getId().toString()))
       .body(result);
 }