class PNCSmartRegisterController {

    public PNCClients getClients() {
        return pncClientsCache.get(PNC_CLIENTS_LIST, new CacheableData<PNCClients>() {
            @Override
            public PNCClients fetch() {
                PNCClients pncClients = new PNCClients();
                List<Pair<Mother, EligibleCouple>> pncsWithEcs = allBeneficiaries.allPNCsWithEC();

                for (Pair<Mother, EligibleCouple> pncWithEc : pncsWithEcs) {
                    Mother pnc = pncWithEc.getLeft();
                    EligibleCouple ec = pncWithEc.getRight();
                    String photoPath =
                            isBlank(ec.photoPath()) ? DEFAULT_WOMAN_IMAGE_PLACEHOLDER_PATH
                                    : ec.photoPath();

                    List<ServiceProvidedDTO> servicesProvided = getServicesProvided(pnc.caseId());
                    List<AlertDTO> alerts = getAlerts(pnc.caseId());
                    PNCClient client = new PNCClient(pnc.caseId(), ec.village(), ec.wifeName(),
                            pnc.thayiCardNumber(), pnc.referenceDate())
                            .withHusbandName(ec.husbandName()).withAge(ec.age())
                            .withWomanDOB(ec.getDetail(WOMAN_DOB)).withECNumber(ec.ecNumber())
                            .withIsHighPriority(ec.isHighPriority())
                            .withIsHighRisk(pnc.isHighRisk())
                            .withEconomicStatus(ec.getDetail(ECONOMIC_STATUS))
                            .withIsOutOfArea(ec.isOutOfArea()).withCaste(ec.getDetail(CASTE))
                            .withPhotoPath(photoPath).withFPMethod(ec.getDetail(CURRENT_FP_METHOD))
                            .withIUDPlace(ec.getDetail(IUD_PLACE))
                            .withIUDPerson(ec.getDetail(IUD_PERSON))
                            .withNumberOfCondomsSupplied(ec.getDetail(NUMBER_OF_CONDOMS_SUPPLIED))
                            .withFamilyPlanningMethodChangeDate(
                                    ec.getDetail(FAMILY_PLANNING_METHOD_CHANGE_DATE))
                            .withNumberOfOCPDelivered(ec.getDetail(NUMBER_OF_OCP_DELIVERED))
                            .withNumberOfCentchromanPillsDelivered(
                                    ec.getDetail(NUMBER_OF_CENTCHROMAN_PILLS_DELIVERED))
                            .withDeliveryPlace(pnc.getDetail(DELIVERY_PLACE))
                            .withDeliveryType(pnc.getDetail(DELIVERY_TYPE))
                            .withDeliveryComplications(pnc.getDetail(DELIVERY_COMPLICATIONS))
                            .withPNCComplications(pnc.getDetail(IMMEDIATE_REFERRAL_REASON))
                            .withOtherDeliveryComplications(
                                    pnc.getDetail(OTHER_DELIVERY_COMPLICATIONS))
                            .withEntityIdToSavePhoto(ec.caseId()).withAlerts(alerts)
                            .withServicesProvided(servicesProvided).withChildren(findChildren(pnc))
                            .withPreProcess();
                    pncClients.add(pncClientPreProcessor.preProcess(client));
                }
                sortByName(pncClients);
                return pncClients;
            }
        });
    }

    public  PNCSmartRegisterController(ServiceProvidedService serviceProvidedService, AlertService
            alertService, AllEligibleCouples allEligibleCouples, AllBeneficiaries
                                              allBeneficiaries, Cache<String> cache, Cache<PNCClients> pncClientsCache);
    public  PNCSmartRegisterController(ServiceProvidedService serviceProvidedService, AlertService
            alertService, AllEligibleCouples allEligibleCouples, AllBeneficiaries
                                              allBeneficiaries, Cache<String> cache, Cache<PNCClients> pncClientsCache,
                                      PNCClientPreProcessor pncClientPreProcessor);

}