* https://github.com/hapifhir/org.hl7.fhir.core/issues/564

* updating help text as per Grahame's feedback.

* wip
This commit is contained in:
Mark Iantorno 2021-08-25 14:06:34 -04:00 committed by GitHub
parent 94d88dd2d1
commit be25055574
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 10 deletions

View File

@ -61,14 +61,7 @@ import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.*;
import java.util.Map.Entry;
/**
@ -143,6 +136,11 @@ public class FilesystemPackageCacheManager extends BasePackageCacheManager imple
return names;
}
private List<String> reverseSorted(String[] keys) {
Arrays.sort(keys, Collections.reverseOrder());
return Arrays.asList(keys);
}
private NpmPackage loadPackageInfo(String path) throws IOException {
NpmPackage pi = NpmPackage.fromFolder(path);
return pi;
@ -316,7 +314,7 @@ public class FilesystemPackageCacheManager extends BasePackageCacheManager imple
}
String foundPackage = null;
String foundVersion = null;
for (String f : sorted(new File(cacheFolder).list())) {
for (String f : reverseSorted(new File(cacheFolder).list())) {
File cf = new File(Utilities.path(cacheFolder, f));
if (cf.isDirectory()) {
if (f.equals(id + "#" + version) || (Utilities.noString(version) && f.startsWith(id + "#"))) {
@ -475,6 +473,7 @@ public class FilesystemPackageCacheManager extends BasePackageCacheManager imple
version = id.substring(id.indexOf("#")+1);
id = id.substring(0, id.indexOf("#"));
}
NpmPackage p = loadPackageFromCacheOnly(id, version);
if (p != null) {
if ("current".equals(version)) {

View File

@ -28,6 +28,10 @@ The following parameters are supported:
the URL of an implementation guide or a package ([id]-[ver]) for
a built implementation guide or a local folder that contains a
set of conformance resources.
If you would like to load the latest unreleased version of the implementation guide or package,
please define the version as '#current'. If no version is provided, the latest version
in the package cache will be used, or if no such cached package is available, the
PackageCacheManager will load the latest from the the online package repo.
No default value. This parameter can appear any number of times
-tx [url]: the [base] url of a FHIR terminology service
Default value is http://tx.fhir.org. This parameter can appear once

View File

@ -97,7 +97,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
List<Object[]> objects = new ArrayList<Object[]>(examples.size());
for (String id : names) {
//if (id.equals("patient-translated-codes"))
//if (id.equals("bundle-documentation-miss-last-updated"))
objects.add(new Object[]{id, examples.get(id)});
}
return objects;