class ChildSmartRegisterController {

    public String get() {
        return cache.get(CHILD_CLIENTS_LIST_CACHE_ENTRY_NAME, new CacheableData<String>() {
            @Override
            public String fetch() {
                List<Child> children = allBeneficiaries.allChildrenWithMotherAndEC();
                List<ChildClient> childrenClient = new ArrayList<ChildClient>();

                for (Child child : children) {
                    String photoPath = isBlank(child.photoPath()) ? (
                            AllConstants.FEMALE_GENDER.equalsIgnoreCase(child.gender())
                                    ? AllConstants.DEFAULT_GIRL_INFANT_IMAGE_PLACEHOLDER_PATH
                                    : AllConstants.DEFAULT_BOY_INFANT_IMAGE_PLACEHOLDER_PATH)
                            : child.photoPath();
                    List<AlertDTO> alerts = getAlerts(child.caseId());
                    List<ServiceProvidedDTO> servicesProvided = getServicesProvided(child.caseId());
                    ChildClient childClient = new ChildClient(child.caseId(), child.gender(),
                            child.getDetail(AllConstants.ChildRegistrationFields.WEIGHT),
                            child.mother().thayiCardNumber())
                            .withName(child.getDetail(AllConstants.ChildRegistrationFields.NAME))
                            .withEntityIdToSavePhoto(child.caseId())
                            .withMotherName(child.ec().wifeName()).withDOB(child.dateOfBirth())
                            .withMotherAge(child.ec().age())
                            .withFatherName(child.ec().husbandName())
                            .withVillage(child.ec().village())
                            .withOutOfArea(child.ec().isOutOfArea()).withEconomicStatus(child.ec()
                                    .getDetail(AllConstants.ECRegistrationFields.ECONOMIC_STATUS))
                            .withCaste(
                                    child.ec().getDetail(AllConstants.ECRegistrationFields.CASTE))
                            .withIsHighRisk(child.isHighRisk()).withPhotoPath(photoPath)
                            .withECNumber(child.ec().ecNumber()).withAlerts(alerts)
                            .withServicesProvided(servicesProvided);

                    childrenClient.add(childClient);
                }
                sortByMotherName(childrenClient);
                return new Gson().toJson(childrenClient);
            }
        });
    }

    public  ChildSmartRegisterController(ServiceProvidedService serviceProvidedService,
                                        AlertService alertService, AllBeneficiaries
                                                allBeneficiaries, Cache<String> cache,
                                        Cache<SmartRegisterClients> smartRegisterCache);

}