Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

/*
* SeocService.java
* Copyright (c) 2017 Veterans Affairs.
*/
package gov.va.oneconsult.seoc.api.service;

import java.util.List;
import java.util.Set;

import javax.transaction.Transactional;

import org.springframework.stereotype.Service;

import gov.va.oneconsult.seoc.api.json.CreateBillingCodeRequest;
import gov.va.oneconsult.seoc.api.json.SeocActivateRequest;
import gov.va.oneconsult.seoc.api.json.SeocCreateRequest;
import gov.va.oneconsult.seoc.api.json.SeocCreateResponse;
import gov.va.oneconsult.seoc.api.json.SeocGenericResponse;
import gov.va.oneconsult.seoc.api.model.Seoc;
import gov.va.oneconsult.seoc.api.model.Status;

/**
* @author AbleVets
*/
@Service
public interface SeocService
{

/**
*
* Description: When name of seoc is only provided the method checks if there
* are any seocs by that name available in the DB. If seocId is given the method
* checks if a seoc with that Id exists and its name and seockey matches with
* the values provided in the parameters.
*
* @param seocKey - Int value SeocKey
* @param name - String value seoc complete name
* @return - True if Seoc with that name does not exist or seocId is available
* for edit False if Seoc with name is already created or Seoc with the
* given seocId does not exist for edit
*/
public Boolean isSeocAvailable(int seocKey, String name);

/**
* Description: Create and Save new {@link Seoc} entity.
*
* @param seocRequest
* @return SeocCreateResponse
*/
public SeocCreateResponse saveSeoc(SeocCreateRequest seocRequest);

/**
* Description: Create pending revision by cloning the SEOC object
*
* @param s - SEOC object for which pending revision is being created
* @param noDeactivatedBillingCodes - When true the Pending Revision will not have deactivatedBillingCodes
* @return SEOC
*/
public Seoc getSeocPendingRevision(Seoc s, Boolean noDeactivatedBillingCodes);

/**
* Description: Create pending revision by cloning the SEOC object
*
* @param s - SEOC object for which pending revision is being created
* @return SEOC
*/
public Seoc getSeocPendingRevision(Seoc s);

/**
* Description: Read all {@link Seoc} values.
*
* @return Seocs
*/
public Set<Seoc> getAllSeocs();

/**
* Description: Read Active Seoc {@link Seoc} values.
*
* @return Seocs
*/
public List<Seoc> getActiveSeocs();

/**
* Description: Read all {@link Seoc} values whose {@link Status} is Date Hold, Active, or Discontinued.
*
* @return Set<Seoc>
*/
public List<Seoc> getPublishedSeocs();

/**
* Description: Read {@link Seoc} value by given Id.
*
* @param id
* @return Seoc
*/
public Seoc getSeocById(int id);

/**
* Description: Read {@link Seoc} value that matches with the exact name.
*
* @param name
* @return Seocs
*/
public Set<Seoc> getSeocByName(String name);


/**
* Description: Read {@link Seoc} value that matches with the name that has duplicates.
*
* @param name
* @return Seocs
*/
public Set<Seoc> getSeocNameWithDuplicates(String name);




/**
* Description: Read {@link Seoc} values that match with the name.
*
* @return Seocs
*/
public Set<Seoc> getByNameMatch(String name);

/**
* Description: Read {@link Seoc} value that matches the SeocKey.
*
* @param seocKey
* @return Set<Seoc>
*/
public Set<Seoc> getBySeocKey(int seocKey);

/**
* Description: Creates Pending revision for a Seoc. By deep cloning the Seoc
* object.
*
* @param seocId
* @return SeocGenericResponse
*/
@Transactional
public SeocCreateResponse createPendingRevision(int seocId);

/**
* Description: Validate if the Seoc is available for pending revision. Check
* there is no other Pending Revision Seoc with same seocKey
*
* @param seocId
* @return SeocGenericResponse
*/
@Transactional
public SeocGenericResponse validPendingRevision(int seocId);

/**
* Description: Run validation rules to check if SEOC is available for
* activation
*
* @param seocActivateRequest
* @return SeocGenericResponse
*/
@Transactional
public SeocGenericResponse activateSeoc(SeocActivateRequest seocActivateRequest);

/**
* Description: Activate the Seoc after running validation rules and creating
* version number
*
* @param seocId
* @return SeocGenericResponse
*/
public SeocGenericResponse validSeocActivate(int seocId);

/**
* Description: Discontinue the SEOC for the requested seocId. Only Active Seocs can be discontinued.
* @param seocId
* @return SeocGenericResponse
*/
@Transactional
public SeocGenericResponse discontinueSeoc(int seocId);

/**
* Description:Delete the seoc and payable service records associated with the
* requested SEOC Id
*
* @param seocId
* @return SeocGenericResponse
*/
@Transactional
public SeocGenericResponse deleteSeoc(int seocId);

/**
* Description: Reverse the Date Hold seoc back to In-Progress
*
* @param seocId
* @return SeocGenericResponse
*/
@Transactional
public SeocGenericResponse reverseSeoc(int seocId);

/**
* Description: Retrieve Seocs which have services with the given Billing Code
* @param billingCode
* @return Set<Seoc>
*/
@Transactional
public Set<Seoc> retrieveSeocsByBillingCode(String billingCode);

/**
* Description: Create new billing code if none exists in the system with the same billing code value.
* @return SeocGenericResponse
*/
@Transactional
public SeocGenericResponse createBillingCode(CreateBillingCodeRequest billingCodeRequest);

/**
* Description: Find the SEOCs(Active/Date Hold/In-progress) which have the billing code used in at least one of the services.
* 1.Delete Billing Code from the In-Progress SEOC
* 2.Create Pending Revision for Active/In-progress SEOCs(delete billing code from pending revision)
* @param {@link CreateBillingCodeRequest} billingCodeRequest
* @return SeocGenericResponse
*/
@Transactional
public SeocGenericResponse manageBillingCode(CreateBillingCodeRequest billingCodeRequest);
}