Skip to content

Commit

Permalink
Enables export of program metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
volsch committed Aug 2, 2019
1 parent 9a81552 commit f29bf00
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.dhis2.fhir.adapter.dhis.sync.impl;

/*
* Copyright (c) 2004-2018, University of Oslo
* Copyright (c) 2004-2019, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -40,6 +40,7 @@
import org.dhis2.fhir.adapter.dhis.orgunit.OrganizationUnitService;
import org.dhis2.fhir.adapter.dhis.sync.SyncExcludedDhisUsernameRetriever;
import org.dhis2.fhir.adapter.dhis.tracker.program.EventService;
import org.dhis2.fhir.adapter.dhis.tracker.program.ProgramMetadataService;
import org.dhis2.fhir.adapter.dhis.tracker.trackedentity.TrackedEntityService;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
Expand Down Expand Up @@ -67,6 +68,8 @@ public class DhisDataProcessorItemRetrieverImpl implements DataProcessorItemRetr

private final OrganizationUnitService organizationUnitService;

private final ProgramMetadataService programMetadataService;

private final TrackedEntityService trackedEntityService;

private final EventService eventService;
Expand All @@ -78,6 +81,7 @@ public DhisDataProcessorItemRetrieverImpl(
@Nonnull @Qualifier( "systemDhis2Authorization" ) Authorization systemDhis2Authorization,
@Nonnull SyncExcludedDhisUsernameRetriever excludedDhisUsernameRetriever,
@Nonnull OrganizationUnitService organizationUnitService,
@Nonnull ProgramMetadataService programMetadataService,
@Nonnull TrackedEntityService trackedEntityService,
@Nonnull EventService eventService,
@Nonnull DhisSyncProcessorConfig processorConfig,
Expand All @@ -89,6 +93,7 @@ public DhisDataProcessorItemRetrieverImpl(
this.trackedEntityService = trackedEntityService;
this.eventService = eventService;
this.organizationUnitService = organizationUnitService;
this.programMetadataService = programMetadataService;
this.processorConfig = processorConfig;
}

Expand All @@ -110,6 +115,12 @@ public Instant poll( @Nonnull DhisSyncGroup group, @Nonnull Instant lastUpdated,
excludedDhisUsernames, consumer );
result = ObjectUtils.min( result, currentResult );
}
if ( resourceTypes.contains( DhisResourceType.PROGRAM_METADATA ) )
{
final Instant currentResult = programMetadataService.poll( group, lastUpdated, toleranceMillis, maxSearchCount,
excludedDhisUsernames, consumer );
result = ObjectUtils.min( result, currentResult );
}
if ( resourceTypes.contains( DhisResourceType.TRACKED_ENTITY ) )
{
final Instant currentResult = trackedEntityService.poll( group, lastUpdated, toleranceMillis, maxSearchCount,
Expand Down

0 comments on commit f29bf00

Please sign in to comment.