Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
96 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/liquid/Medication.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
{% if %"FHIR_VERSION" = 'DSTU1' %} | ||
<div class="hapiHeaderText">{{ Medication.name.text }}</div> | ||
{% else %} | ||
<div class="hapiHeaderText">{{ Medication.code.text }}</div> | ||
{% endif %} |
5 changes: 0 additions & 5 deletions
5
hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/liquid/MedicationBetter.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
...fhir-structures-r4/src/main/java/ca/uhn/fhir/r4/narrative/LiquidEnvironmentVariables.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package ca.uhn.fhir.r4.narrative; | ||
|
||
import org.hl7.fhir.exceptions.FHIRException; | ||
import org.hl7.fhir.exceptions.PathEngineException; | ||
import org.hl7.fhir.r4.model.Base; | ||
import org.hl7.fhir.r4.model.StringType; | ||
import org.hl7.fhir.r4.model.TypeDetails; | ||
import org.hl7.fhir.r4.utils.FHIRPathEngine; | ||
|
||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class LiquidEnvironmentVariables implements FHIRPathEngine.IEvaluationContext { | ||
private Map<String, String> constantMap = new HashMap<>(); | ||
|
||
void put(String key, String value) { | ||
constantMap.put(key, value); | ||
if (!key.startsWith("\"")) { | ||
// Support both quoted and unquoted version of constant | ||
constantMap.put("\"" + key + "\"", value); | ||
} | ||
} | ||
|
||
@Override | ||
public Base resolveConstant(Object appContext, String name, boolean beforeContext) throws PathEngineException { | ||
String value = constantMap.get(name); | ||
if (value == null) { | ||
return null; | ||
} | ||
return new StringType(constantMap.get(name)); | ||
} | ||
|
||
@Override | ||
public TypeDetails resolveConstantType(Object appContext, String name) throws PathEngineException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean log(String argument, List<Base> focus) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public FunctionDetails resolveFunction(String functionName) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public TypeDetails checkFunction(Object appContext, String functionName, List<TypeDetails> parameters) throws PathEngineException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public List<Base> executeFunction(Object appContext, String functionName, List<List<Base>> parameters) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Base resolveReference(Object appContext, String url) throws FHIRException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean conformsToProfile(Object appContext, Base item, String url) throws FHIRException { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters