Start working on rendering expressions
This commit is contained in:
parent
74c11cfec1
commit
bc11ac5c5b
|
@ -22,6 +22,7 @@ import org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem;
|
||||||
import org.hl7.fhir.r5.model.DataType;
|
import org.hl7.fhir.r5.model.DataType;
|
||||||
import org.hl7.fhir.r5.model.DateTimeType;
|
import org.hl7.fhir.r5.model.DateTimeType;
|
||||||
import org.hl7.fhir.r5.model.Enumeration;
|
import org.hl7.fhir.r5.model.Enumeration;
|
||||||
|
import org.hl7.fhir.r5.model.Extension;
|
||||||
import org.hl7.fhir.r5.model.HumanName;
|
import org.hl7.fhir.r5.model.HumanName;
|
||||||
import org.hl7.fhir.r5.model.HumanName.NameUse;
|
import org.hl7.fhir.r5.model.HumanName.NameUse;
|
||||||
import org.hl7.fhir.r5.model.Identifier;
|
import org.hl7.fhir.r5.model.Identifier;
|
||||||
|
@ -45,6 +46,7 @@ import org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent;
|
||||||
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.BaseWrapper;
|
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.BaseWrapper;
|
||||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext;
|
import org.hl7.fhir.r5.renderers.utils.RenderingContext;
|
||||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext.ResourceRendererMode;
|
import org.hl7.fhir.r5.renderers.utils.RenderingContext.ResourceRendererMode;
|
||||||
|
import org.hl7.fhir.r5.utils.ToolingExtensions;
|
||||||
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
|
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
|
||||||
import org.hl7.fhir.utilities.MarkDownProcessor;
|
import org.hl7.fhir.utilities.MarkDownProcessor;
|
||||||
import org.hl7.fhir.utilities.MarkDownProcessor.Dialect;
|
import org.hl7.fhir.utilities.MarkDownProcessor.Dialect;
|
||||||
|
@ -784,7 +786,11 @@ public class DataRenderer extends Renderer {
|
||||||
if (s.getEvent().size() > 0) {
|
if (s.getEvent().size() > 0) {
|
||||||
CommaSeparatedStringBuilder c = new CommaSeparatedStringBuilder();
|
CommaSeparatedStringBuilder c = new CommaSeparatedStringBuilder();
|
||||||
for (DateTimeType p : s.getEvent()) {
|
for (DateTimeType p : s.getEvent()) {
|
||||||
|
if (p.hasValue()) {
|
||||||
c.append(p.toHumanDisplay());
|
c.append(p.toHumanDisplay());
|
||||||
|
} else if (!renderExpression(c, p)) {
|
||||||
|
c.append("??");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
b.append("Events: "+ c.toString());
|
b.append("Events: "+ c.toString());
|
||||||
}
|
}
|
||||||
|
@ -829,6 +835,15 @@ public class DataRenderer extends Renderer {
|
||||||
return b.toString();
|
return b.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean renderExpression(CommaSeparatedStringBuilder c, PrimitiveType p) {
|
||||||
|
Extension exp = p.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/cqf-expression");
|
||||||
|
if (exp == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
c.append(exp.getValueExpression().getExpression());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private String displayEventCode(EventTiming when) {
|
private String displayEventCode(EventTiming when) {
|
||||||
switch (when) {
|
switch (when) {
|
||||||
case C: return "at meals";
|
case C: return "at meals";
|
||||||
|
|
Loading…
Reference in New Issue