@Override
 @Transactional
 protected void saveOrUpdate() {
   buildRegistration();
   if (stillBirthRegistration.getRegistrationNo() == null
       || "".equals(stillBirthRegistration.getRegistrationNo().trim()))
     stillBirthRegistration.setRegistrationNo(
         numberGenerationService.getStillBirthRegistrationNumber(
             stillBirthRegistration, birthHospitalUserFlag));
   stillBirthRegistration.setAdditionalRule(getAdditionalRule());
   birthRegistrationService.save(stillBirthRegistration, workFlowType);
   stillBirthRegistration.setPlaceType(bndCommonService.getPlaceType(placeTypeTemp));
   LOGGER.debug("Still Birth Registration Record ::::::::::" + stillBirthRegistration);
   mode = VIEW;
 }
 @Override
 @Transactional
 @Action(
     value = "/stillBirthRegistration-create",
     results = {@Result(name = NEW, type = "dispatcher")})
 public String create() {
   if (workFlowType != null
       && !"".equals(workFlowType)
       && BndConstants.SCRIPT_SAVE.equals(workFlowType))
     stillBirthRegistration.setStatus(
         bndCommonService.getStatusByModuleAndCode(
             BndConstants.STILLBIRTHREGISTRATION, BndConstants.CREATED));
   stillBirthRegistration.setPlaceType(bndCommonService.getPlaceType(placeTypeTemp));
   saveOrUpdate();
   mode = VIEW;
   return NEW;
 }
 @Override
 @Transactional
 @ValidationErrorPage(NEW)
 @Action(
     value = "/stillBirthRegistration-edit",
     results = {@Result(name = NEW, type = "dispatcher")})
 public String edit() {
   if (getMode().equals(LOCK)) {
     birthRegistrationService.buildAdoptionDetial(stillBirthRegistration);
     buildRegistration();
     stillBirthRegistration.setPlaceType(bndCommonService.getPlaceType(placeTypeTemp));
     stillBirthRegistration.setStatus(
         bndCommonService.getStatusByModuleAndCode(
             BndConstants.STILLBIRTHREGISTRATION, BndConstants.LOCK));
     final EgwSatuschange change = new EgwSatuschange();
     change.setFromstatus(
         bndCommonService
             .getStatusByModuleAndCode(BndConstants.STILLBIRTHREGISTRATION, BndConstants.APPROVED)
             .getId());
     change.setTostatus(
         bndCommonService
             .getStatusByModuleAndCode(BndConstants.STILLBIRTHREGISTRATION, BndConstants.LOCK)
             .getId());
     change.setModuleid(stillBirthRegistration.getId().intValue());
     change.setModuletype(BndConstants.STILLBIRTHREGISTRATIONMODULE);
     // change.setCreatedby(EgovThreadLocals.getUserId());
     // TODO egifix-hibernateutil
     // HibernateUtil.getCurrentSession().persist(change);
     entityManager.persist(change);
     birthRegistrationService.save(stillBirthRegistration, workFlowType);
   } else if (getMode().equals(UNLOCK)) {
     birthRegistrationService.buildAdoptionDetial(stillBirthRegistration);
     buildRegistration();
     stillBirthRegistration.setPlaceType(bndCommonService.getPlaceType(placeTypeTemp));
     stillBirthRegistration.setStatus(
         bndCommonService.getStatusByModuleAndCode(
             BndConstants.STILLBIRTHREGISTRATION, BndConstants.APPROVED));
     final EgwSatuschange change = new EgwSatuschange();
     change.setFromstatus(
         bndCommonService
             .getStatusByModuleAndCode(BndConstants.STILLBIRTHREGISTRATION, BndConstants.LOCK)
             .getId());
     change.setTostatus(
         bndCommonService
             .getStatusByModuleAndCode(BndConstants.STILLBIRTHREGISTRATION, BndConstants.APPROVED)
             .getId());
     change.setModuleid(stillBirthRegistration.getId().intValue());
     change.setModuletype(BndConstants.STILLBIRTHREGISTRATIONMODULE);
     //             change.setCreatedby(EgovThreadLocals.getUserId());
     // TODO egifix-hibernateutil
     // HibernateUtil.getCurrentSession().persist(change);
     entityManager.persist(change);
     birthRegistrationService.save(stillBirthRegistration, workFlowType);
   } else {
     saveOrUpdate();
     if (BndConstants.APPROVED.equalsIgnoreCase(stillBirthRegistration.getStatus().getCode())
         && stillBirthRegistration
             .getRegistrationNo()
             .contains(BndConstants.HOSPITALSTILLBIRTHSUFFIX))
       numberGenerationService.reGenerateStillBirthRegistrationNumber(stillBirthRegistration);
     if (remarksHistory != null && !"".equals(remarksHistory))
       bndCommonService.saveHistory(
           stillBirthRegistration, BndConstants.STILLBIRTHREGISTRATION, remarksHistory);
   }
   mode = VIEW;
   return NEW;
 }