Skip to content

Commit

Permalink
#207: Added processing to allow resolution of FHIRHelpers and FHIR-Mo…
Browse files Browse the repository at this point in the history
…delInfo in the CQF Common package
  • Loading branch information
brynrhodes committed Mar 24, 2021
1 parent 74291ef commit 54cea53
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ private String getReferenceUrl(String path, String version) {
if (uri != null) {
// The translator has no way to correctly infer the namespace of the FHIRHelpers library, since it will happily provide that source to any namespace that wants it
// So override the declaration here so that it points back to the FHIRHelpers library in the base specification
if (name.equals("FHIRHelpers") && !uri.equals("http://hl7.org/fhir")) {
uri = "http://hl7.org/fhir";
if (name.equals("FHIRHelpers") && !(uri.equals("http://hl7.org/fhir") || uri.equals("http://fhir.org/guides/cqf/common"))) {
uri = "http://fhir.org/guides/cqf/common";
}
return String.format("%s/Library/%s%s", uri, name, version != null ? ("|" + version) : "");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,19 @@ else if (file.isDirectory()) {
cqfmHelper.ensureCQFToolingExtensionAndDevice(library, fhirContext);
// Issue 96
// Passing the includeVersion here to handle not using the version number in the filename
IOUtils.writeResource(library, filePath, fileEncoding, fhirContext, this.versioned);
String refreshedLibraryName;
if (this.versioned && refreshedLibrary.getVersion() != null) {
refreshedLibraryName = refreshedLibrary.getName() + "-" + refreshedLibrary.getVersion();
} else {
refreshedLibraryName = refreshedLibrary.getName();
if (new File(filePath).exists()) {
// TODO: This prevents mangled names from being output
// It would be nice for the tooling to generate library shells, we have enough information to,
// but the tooling gets confused about the ID and the filename and what gets written is garbage
IOUtils.writeResource(library, filePath, fileEncoding, fhirContext, this.versioned);
String refreshedLibraryName;
if (this.versioned && refreshedLibrary.getVersion() != null) {
refreshedLibraryName = refreshedLibrary.getName() + "-" + refreshedLibrary.getVersion();
} else {
refreshedLibraryName = refreshedLibrary.getName();
}
refreshedLibraryNames.add(refreshedLibraryName);
}
refreshedLibraryNames.add(refreshedLibraryName);
}

return refreshedLibraryNames;
Expand Down

0 comments on commit 54cea53

Please sign in to comment.