Skip to content

Commit

Permalink
Merge pull request #1262 from mozzy11/develop
Browse files Browse the repository at this point in the history
fix Remote source identifier with asterisk
  • Loading branch information
mozzy11 authored Sep 12, 2024
2 parents ee3d12d + cbbafce commit dc101d8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ public String[] getRemoteStorePaths() {
}

public List<String> getRemoteStoreIdentifier() {
if (remoteStoreIdentifier.get(0).equals(ResourceType.Practitioner + "/*")) {
remoteStoreIdentifier = new ArrayList<>();

if (remoteStoreIdentifier.contains(ResourceType.Practitioner + "/*")) {
List<String> fetchedIdentifiers = new ArrayList<>();
for (String remoteStorePath : getRemoteStorePaths()) {
IGenericClient fhirClient = fhirContext().newRestfulGenericClient(remoteStorePath);
if (!GenericValidator.isBlankOrNull(getUsername())
Expand All @@ -105,14 +106,17 @@ public List<String> getRemoteStoreIdentifier() {
if (bundleComponent.hasResource()
&& ResourceType.Practitioner.equals(bundleComponent.getResource().getResourceType())) {

remoteStoreIdentifier.add(ResourceType.Practitioner + "/"
fetchedIdentifiers.add(ResourceType.Practitioner + "/"
+ bundleComponent.getResource().getIdElement().getIdPart());
}
}
}
}
return fetchedIdentifiers;
} else {
return remoteStoreIdentifier;
}
return remoteStoreIdentifier;

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class ProviderImportServiceImpl implements ProviderImportService {

@Override
@Async
@Scheduled(initialDelay = 1000, fixedRate = 60 * 60 * 1000)
@Scheduled(initialDelay = 1000, fixedRateString = "${org.openelisglobal.providerlist.poll.frequency:3600000}")
public void importPractitionerList() throws FhirLocalPersistingException, FhirGeneralException, IOException {
if (!GenericValidator.isBlankOrNull(providerFhirStore)) {
IGenericClient client = fhirUtil.getFhirClient(providerFhirStore);
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ facilitylist.schedule.fixedRate=864000000
# Remote FHIR server/Consolidated Server
#org.openelisglobal.remote.source.uri=http://185.218.126.190:5001/fhir/
#org.openelisglobal.remote.source.identifier=Practitioner/738185ba-eac9-11e5-8f4d-e06995eac916
#org.openelisglobal.remote.poll.frequency=120000
#org.openelisglobal.remote.source.updateStatus=false
#org.openelisglobal.task.useBasedOn=true
#org.openelisglobal.fhirstore.username=openelis
Expand All @@ -29,6 +30,7 @@ facilitylist.schedule.fixedRate=864000000

#provider FHIR server
#org.openelisglobal.providerlist.fhirstore=http://localhost:8081/fhir/
#org.openelisglobal.providerlist.poll.frequency=3600000
#org.openelisglobal.requester.identifier=Practitioner/f9badd80-ab76-11e2-9e96-0800200c9a66
#org.openelisglobal.requester.lastName=Dr. Mauritius
#org.openelisglobal.requester.firstName=Felix
Expand Down
1 change: 1 addition & 0 deletions volume/properties/common.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ facilitylist.schedule.fixedRate=864000000
#provider FHIR server
org.openelisglobal.providerlist.fhirstore=
org.openelisglobal.requester.identifier=Practitioner/f9badd80-ab76-11e2-9e96-0800200c9a66
org.openelisglobal.providerlist.poll.frequency=3600000
org.openelisglobal.requester.lastName=Dr. Mauritius
org.openelisglobal.requester.firstName=Felix
org.openelisglobal.requester.phone=230 5123 1234
Expand Down

0 comments on commit dc101d8

Please sign in to comment.