Search in sources :

Example 1 with OutOfStateCheck

use of gov.ca.cwds.data.legacy.cms.entity.OutOfStateCheck in project api-core by ca-cwds.

the class SubstituteCareProviderCoreService method enrichOutOfStateChecks.

private void enrichOutOfStateChecks(ExtendedSCPEntityAwareDTO dto) {
    if (CollectionUtils.isNotEmpty(dto.getOtherStatesOfLiving())) {
        List<OutOfStateCheck> outOfStateChecks = new ArrayList<>(dto.getOtherStatesOfLiving().size());
        for (CWSIdentifier stateId : dto.getOtherStatesOfLiving()) {
            OutOfStateCheck outOfStateCheck = new OutOfStateCheck();
            outOfStateCheck.setStateC((short) (stateId.getCwsId()));
            outOfStateCheck.setRcpntId(dto.getEntity().getIdentifier());
            outOfStateCheck.setRcpntCd("S");
            outOfStateCheck.setIdentifier(IdGenerator.generateId());
            outOfStateCheck.setLstUpdId(getStaffPersonId());
            outOfStateCheck.setLstUpdTs(LocalDateTime.now());
            outOfStateChecks.add(outOfStateCheck);
        }
        dto.setOutOfStateChecks(outOfStateChecks);
    }
}
Also used : CWSIdentifier(gov.ca.cwds.cms.data.access.CWSIdentifier) OutOfStateCheck(gov.ca.cwds.data.legacy.cms.entity.OutOfStateCheck) ArrayList(java.util.ArrayList)

Aggregations

CWSIdentifier (gov.ca.cwds.cms.data.access.CWSIdentifier)1 OutOfStateCheck (gov.ca.cwds.data.legacy.cms.entity.OutOfStateCheck)1 ArrayList (java.util.ArrayList)1