Skip to content

Commit

Permalink
Added code to set the id of the Library and the Measure to the name (#…
Browse files Browse the repository at this point in the history
…454)

Added code to set the id of the Library and the Measure to the name for publishing reasons

Co-authored-by: Michael Holck <[email protected]>
  • Loading branch information
mholck and Michael Holck authored Aug 17, 2023
1 parent 97069de commit 23c5f8b
Showing 1 changed file with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ else if (extractedFile.getPath().endsWith(".json")) {
if (theResource instanceof org.hl7.fhir.dstu3.model.Library) {
org.hl7.fhir.dstu3.model.Library theLibrary = (org.hl7.fhir.dstu3.model.Library)theResource;
resourceName = theLibrary.getName();


// Set the id to the name regardless of what it is now for publishing
theLibrary.setId(resourceName);

// Forcing the encoding to JSON here to make everything the same in input directory
ResourceUtils.outputResourceByName(theResource, "json", context,
newLibraryDirectory.toString(), resourceName);
Expand All @@ -185,7 +188,11 @@ else if (extractedFile.getPath().endsWith(".json")) {
extractStu3CQL(theLibrary, cqlFilename);
}
else if (theResource instanceof org.hl7.fhir.dstu3.model.Measure) {
resourceName = ((org.hl7.fhir.dstu3.model.Measure)theResource).getName();
org.hl7.fhir.dstu3.model.Measure theMeasure = (org.hl7.fhir.dstu3.model.Measure)theResource;
resourceName = theMeasure.getName();

// Set the id to the name regardless of what it is now for publishing
theMeasure.setId(resourceName);

// Forcing the encoding to JSON here to make everything the same in input directory
ResourceUtils.outputResourceByName(theResource, "json", context,
Expand All @@ -196,6 +203,9 @@ else if (version == "r4") {
if (theResource instanceof org.hl7.fhir.r4.model.Library) {
org.hl7.fhir.r4.model.Library theLibrary = (org.hl7.fhir.r4.model.Library)theResource;
resourceName = theLibrary.getName();

// Set the id to the name regardless of what it is now for publishing
theLibrary.setId(resourceName);

// Forcing the encoding to JSON here to make everything the same in input directory
ResourceUtils.outputResourceByName(theResource, "json", context,
Expand All @@ -206,8 +216,12 @@ else if (version == "r4") {
extractR4CQL(theLibrary, cqlFilename);
}
else if (theResource instanceof org.hl7.fhir.r4.model.Measure) {
resourceName = ((org.hl7.fhir.r4.model.Measure)theResource).getName();

org.hl7.fhir.r4.model.Measure theMeasure = (org.hl7.fhir.r4.model.Measure)theResource;
resourceName = theMeasure.getName();

// Set the id to the name regardless of what it is now for publishing
theMeasure.setId(resourceName);

// Forcing the encoding to JSON here to make everything the same in input directory
ResourceUtils.outputResourceByName(theResource, "json", context,
newMeasureDirectory.toString(), resourceName);
Expand Down

0 comments on commit 23c5f8b

Please sign in to comment.