stable baseline
This commit is contained in:
parent
34c8c262bc
commit
853b4fd9ca
|
@ -6383,7 +6383,7 @@ public class FHIRPathEngine {
|
|||
|
||||
sd = fetchStructureByType(element, expr);
|
||||
if (sd == null) {
|
||||
throw makeException(expr, I18nConstants.FHIRPATH_DISCRIMINATOR_THIS_CANNOT_FIND,
|
||||
throw makeException(expr, I18nConstants.FHIRPATH_RESOLVE_DISCRIMINATOR_CANT_FIND,
|
||||
element.getElement().getType().get(0).getProfile(), element.getElement().getId());
|
||||
}
|
||||
childDefinitions = profileUtilities.getChildMap(sd, sd.getSnapshot().getElementFirstRep());
|
||||
|
|
|
@ -110,7 +110,7 @@ public class CodeSystemRenderer extends TerminologyRenderer {
|
|||
x.para().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTERS));
|
||||
XhtmlNode tbl = x.table("grid");
|
||||
XhtmlNode tr = tbl.tr();
|
||||
tr.td().b().tx(formatPhrase(RenderingContext.GENERAL_CODE));
|
||||
tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_CODE));
|
||||
tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_DESC));
|
||||
tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_OP));
|
||||
tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_VALUE));
|
||||
|
@ -132,8 +132,7 @@ public class CodeSystemRenderer extends TerminologyRenderer {
|
|||
boolean hasURI = false;
|
||||
boolean hasDescription = false;
|
||||
for (PropertyComponent p : cs.getProperty()) {
|
||||
String display = getPropertyDisplay(p);
|
||||
hasRendered = hasRendered || display != null;
|
||||
hasRendered = hasRendered || !p.getCode().equals(ToolingExtensions.getPresentation(p, p.getCodeElement()));
|
||||
hasURI = hasURI || p.hasUri();
|
||||
hasDescription = hasDescription || p.hasDescription();
|
||||
}
|
||||
|
@ -145,7 +144,7 @@ public class CodeSystemRenderer extends TerminologyRenderer {
|
|||
if (hasRendered) {
|
||||
tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROP_NAME));
|
||||
}
|
||||
tr.td().b().tx(formatPhrase(RenderingContext.GENERAL_CODE));
|
||||
tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROP_CODE));
|
||||
if (hasURI) {
|
||||
tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROP_URI));
|
||||
}
|
||||
|
@ -156,8 +155,7 @@ public class CodeSystemRenderer extends TerminologyRenderer {
|
|||
for (PropertyComponent p : cs.getProperty()) {
|
||||
tr = tbl.tr();
|
||||
if (hasRendered) {
|
||||
String display = getPropertyDisplay(p);
|
||||
tr.td().tx(display);
|
||||
tr.td().tx(ToolingExtensions.getPresentation(p, p.getCodeElement()));
|
||||
}
|
||||
renderStatus(p, tr.td()).tx(p.getCode());
|
||||
if (hasURI) {
|
||||
|
@ -261,10 +259,10 @@ public class CodeSystemRenderer extends TerminologyRenderer {
|
|||
}
|
||||
if (langs.size() >= 2) {
|
||||
Collections.sort(langs);
|
||||
x.para().b().tx(context.formatPhrase(RenderingContext.GENERAL_ADD_LANG));
|
||||
x.para().b().tx(context.formatPhrase(RenderingContext.CODE_SYS_ADD_LANG));
|
||||
t = x.table("codes");
|
||||
XhtmlNode tr = t.tr();
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.CODE_SYS_CODE));
|
||||
for (String lang : langs)
|
||||
tr.td().b().addText(describeLang(lang));
|
||||
for (ConceptDefinitionComponent c : cs.getConcept()) {
|
||||
|
|
|
@ -405,13 +405,13 @@ public class ConceptMapRenderer extends TerminologyRenderer {
|
|||
if (grp.hasSource()) {
|
||||
renderCanonical(cm, pp, grp.getSource());
|
||||
} else {
|
||||
pp.code(context.formatPhrase(RenderingContext.GENERAL_CODE_SYS_UNSPEC));
|
||||
pp.code(context.formatPhrase(RenderingContext.CONC_MAP_CODE_SYS_UNSPEC));
|
||||
}
|
||||
pp.tx(" to ");
|
||||
if (grp.hasTarget()) {
|
||||
renderCanonical(cm, pp, grp.getTarget());
|
||||
} else {
|
||||
pp.code(context.formatPhrase(RenderingContext.GENERAL_CODE_SYS_UNSPEC));
|
||||
pp.code(context.formatPhrase(RenderingContext.CONC_MAP_CODE_SYS_UNSPEC));
|
||||
}
|
||||
|
||||
String display;
|
||||
|
@ -484,7 +484,7 @@ public class ConceptMapRenderer extends TerminologyRenderer {
|
|||
String url = sources.get("code").iterator().next();
|
||||
renderCSDetailsLink(tr, url, true);
|
||||
} else
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.CONC_MAP_CODE));
|
||||
for (String s : sources.keySet()) {
|
||||
if (s != null && !s.equals("code")) {
|
||||
if (sources.get(s).size() == 1) {
|
||||
|
@ -501,7 +501,7 @@ public class ConceptMapRenderer extends TerminologyRenderer {
|
|||
String url = targets.get("code").iterator().next();
|
||||
renderCSDetailsLink(tr, url, true);
|
||||
} else
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.CONC_MAP_CODE));
|
||||
for (String s : targets.keySet()) {
|
||||
if (s != null && !s.equals("code")) {
|
||||
if (targets.get(s).size() == 1) {
|
||||
|
@ -698,7 +698,7 @@ public class ConceptMapRenderer extends TerminologyRenderer {
|
|||
if (span2) {
|
||||
td.colspan("2");
|
||||
}
|
||||
td.b().tx(context.formatPhrase(RenderingContext.GENERAL_CODES));
|
||||
td.b().tx(context.formatPhrase(RenderingContext.CONC_MAP_CODES));
|
||||
td.tx(" " + (context.formatPhrase(RenderingContext.CONC_MAP_FRM) + " "));
|
||||
if (cs == null)
|
||||
td.tx(url);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,488 +1,488 @@
|
|||
package org.hl7.fhir.r5.renderers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.exceptions.DefinitionException;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r5.model.Base;
|
||||
import org.hl7.fhir.r5.model.DataType;
|
||||
import org.hl7.fhir.r5.model.DiagnosticReport;
|
||||
import org.hl7.fhir.r5.model.Resource;
|
||||
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.BaseWrapper;
|
||||
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.PropertyWrapper;
|
||||
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.ResourceWrapper;
|
||||
import org.hl7.fhir.r5.renderers.utils.DirectWrappers;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext;
|
||||
import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceContext;
|
||||
import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceWithReference;
|
||||
import org.hl7.fhir.r5.utils.EOperationOutcome;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
|
||||
|
||||
public class DiagnosticReportRenderer extends ResourceRenderer {
|
||||
|
||||
public class ObservationNode {
|
||||
private String ref;
|
||||
private ResourceWithReference obs;
|
||||
private List<ObservationNode> contained;
|
||||
}
|
||||
|
||||
|
||||
public DiagnosticReportRenderer(RenderingContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public DiagnosticReportRenderer(RenderingContext context, ResourceContext rcontext) {
|
||||
super(context, rcontext);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, Resource dr) throws IOException, FHIRException, EOperationOutcome {
|
||||
return render(x, (DiagnosticReport) dr);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, ResourceWrapper dr) throws IOException, FHIRException, EOperationOutcome {
|
||||
XhtmlNode h2 = x.h2();
|
||||
render(h2, getProperty(dr, "code").value());
|
||||
h2.tx(" ");
|
||||
PropertyWrapper pw = getProperty(dr, "category");
|
||||
if (valued(pw)) {
|
||||
h2.tx("(");
|
||||
boolean first = true;
|
||||
for (BaseWrapper b : pw.getValues()) {
|
||||
if (first) first = false; else h2.tx(", ");
|
||||
render(h2, b);
|
||||
}
|
||||
h2.tx(") ");
|
||||
}
|
||||
XhtmlNode tbl = x.table("grid");
|
||||
XhtmlNode tr;
|
||||
if (dr.has("subject")) {
|
||||
tr = tbl.tr();
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_SUB));
|
||||
populateSubjectSummary(tr.td(), getProperty(dr, "subject").value());
|
||||
}
|
||||
|
||||
DataType eff = null;
|
||||
DataType iss = null;
|
||||
|
||||
if (dr.has("effective[x]")) {
|
||||
tr = tbl.tr();
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_WHEN));
|
||||
eff = (DataType) getProperty(dr, "effective[x]").value().getBase();
|
||||
render(tr.td(), eff);
|
||||
}
|
||||
if (dr.has("issued")) {
|
||||
tr = tbl.tr();
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_REP));
|
||||
eff = (DataType) getProperty(dr, "issued").value().getBase();
|
||||
render(tr.td(), getProperty(dr, "issued").value());
|
||||
}
|
||||
|
||||
pw = getProperty(dr, "perfomer");
|
||||
if (valued(pw)) {
|
||||
tr = tbl.tr();
|
||||
tr.td().tx(Utilities.pluralize((context.formatPhrase(RenderingContext.DIAG_REP_REND_PER)), pw.getValues().size()));
|
||||
XhtmlNode tdr = tr.td();
|
||||
for (BaseWrapper v : pw.getValues()) {
|
||||
tdr.tx(" ");
|
||||
render(tdr, v);
|
||||
}
|
||||
}
|
||||
pw = getProperty(dr, "identifier");
|
||||
if (valued(pw)) {
|
||||
tr = tbl.tr();
|
||||
tr.td().tx(Utilities.pluralize((context.formatPhrase(RenderingContext.DIAG_REP_REND_IDENTIFIER)), pw.getValues().size())+":");
|
||||
XhtmlNode tdr = tr.td();
|
||||
for (BaseWrapper v : pw.getValues()) {
|
||||
tdr.tx(" ");
|
||||
render(tdr, v);
|
||||
}
|
||||
}
|
||||
pw = getProperty(dr, "request");
|
||||
if (valued(pw)) {
|
||||
tr = tbl.tr();
|
||||
tr.td().tx(Utilities.pluralize((context.formatPhrase(RenderingContext.DIAG_REP_REND_REQUEST)), pw.getValues().size())+":");
|
||||
XhtmlNode tdr = tr.td();
|
||||
for (BaseWrapper v : pw.getValues()) {
|
||||
tdr.tx(" ");
|
||||
render(tdr, v);
|
||||
}
|
||||
tdr.br();
|
||||
}
|
||||
|
||||
|
||||
x.para().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_REPDET));
|
||||
|
||||
pw = getProperty(dr, "result");
|
||||
if (valued(pw)) {
|
||||
List<ObservationNode> observations = fetchObservations(pw.getValues(), dr);
|
||||
buildObservationsTable(x, observations, eff, iss);
|
||||
}
|
||||
|
||||
pw = getProperty(dr, "conclusion");
|
||||
if (valued(pw)) {
|
||||
if (pw.fhirType().equals("markdown")) {
|
||||
render(x, pw.value());
|
||||
} else {
|
||||
render(x.para(), pw.value());
|
||||
}
|
||||
}
|
||||
|
||||
pw = getProperty(dr, "conclusionCode");
|
||||
if (!valued(pw)) {
|
||||
pw = getProperty(dr, "codedDiagnosis");
|
||||
}
|
||||
if (valued(pw)) {
|
||||
XhtmlNode p = x.para();
|
||||
p.b().tx(context.formatPhrase(RenderingContext.GENERAL_CODECON));
|
||||
XhtmlNode ul = x.ul();
|
||||
for (BaseWrapper v : pw.getValues()) {
|
||||
render(ul.li(), v);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, DiagnosticReport dr) throws IOException, FHIRException, EOperationOutcome {
|
||||
render(x, new DirectWrappers.ResourceWrapperDirect(this.context, dr));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void describe(XhtmlNode x, DiagnosticReport dr) {
|
||||
x.tx(display(dr));
|
||||
}
|
||||
|
||||
public String display(DiagnosticReport dr) {
|
||||
return display(dr.getCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(Resource r) throws UnsupportedEncodingException, IOException {
|
||||
return display((DiagnosticReport) r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException {
|
||||
return "Not done yet";
|
||||
}
|
||||
|
||||
private void populateSubjectSummary(XhtmlNode container, BaseWrapper subject) throws UnsupportedEncodingException, FHIRException, IOException, EOperationOutcome {
|
||||
ResourceWrapper r = fetchResource(subject);
|
||||
if (r == null)
|
||||
container.tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_UNABLE));
|
||||
else if (r.getName().equals("Patient"))
|
||||
generatePatientSummary(container, r);
|
||||
else
|
||||
container.tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_NOTDONE));
|
||||
}
|
||||
|
||||
private void generatePatientSummary(XhtmlNode c, ResourceWrapper r) throws FHIRFormatError, DefinitionException, FHIRException, IOException, EOperationOutcome {
|
||||
new PatientRenderer(context).describe(c, r);
|
||||
}
|
||||
|
||||
private List<ObservationNode> fetchObservations(List<BaseWrapper> list, ResourceWrapper rw) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
List<ObservationNode> res = new ArrayList<ObservationNode>();
|
||||
for (BaseWrapper b : list) {
|
||||
if (b.has("reference")) {
|
||||
ObservationNode obs = new ObservationNode();
|
||||
obs.ref = b.get("reference").primitiveValue();
|
||||
obs.obs = resolveReference(rw, obs.ref);
|
||||
if (obs.obs != null && obs.obs.getResource() != null) {
|
||||
PropertyWrapper t = getProperty(obs.obs.getResource(), "contained");
|
||||
if (t != null && t.hasValues()) {
|
||||
obs.contained = fetchObservations(t.getValues(), rw);
|
||||
}
|
||||
}
|
||||
res.add(obs);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private void buildObservationsTable(XhtmlNode root, List<ObservationNode> observations, DataType eff, DataType iss) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
XhtmlNode tbl = root.table("grid");
|
||||
boolean refRange = scanObsForRefRange(observations);
|
||||
boolean flags = scanObsForFlags(observations);
|
||||
boolean note = scanObsForNote(observations);
|
||||
boolean effectiveTime = scanObsForEffective(observations, eff);
|
||||
boolean issued = scanObsForIssued(observations, iss);
|
||||
int cs = 2;
|
||||
if (refRange) cs++;
|
||||
if (flags) cs++;
|
||||
if (note) cs++;
|
||||
if (issued) cs++;
|
||||
if (effectiveTime) cs++;
|
||||
XhtmlNode tr = tbl.tr();
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_VALUE));
|
||||
if (refRange) {
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_REFRAN));
|
||||
}
|
||||
if (flags) {
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_FLAG));
|
||||
}
|
||||
if (note) {
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_NOTE));
|
||||
}
|
||||
if (effectiveTime) {
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_WHEN));
|
||||
}
|
||||
if (issued) {
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_REP));
|
||||
}
|
||||
for (ObservationNode o : observations) {
|
||||
addObservationToTable(tbl, o, 0, Integer.toString(cs), refRange, flags, note, effectiveTime, issued, eff, iss);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean scanObsForRefRange(List<ObservationNode> observations) {
|
||||
for (ObservationNode o : observations) {
|
||||
if (o.obs != null && o.obs.getResource() != null) {
|
||||
PropertyWrapper pw = getProperty(o.obs.getResource(), "referenceRange");
|
||||
if (valued(pw)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (o.contained != null) {
|
||||
if (scanObsForRefRange(o.contained)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean scanObsForNote(List<ObservationNode> observations) {
|
||||
for (ObservationNode o : observations) {
|
||||
if (o.obs != null && o.obs.getResource() != null) {
|
||||
PropertyWrapper pw = getProperty(o.obs.getResource(), "note");
|
||||
if (valued(pw)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (o.contained != null) {
|
||||
if (scanObsForNote(o.contained)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean scanObsForIssued(List<ObservationNode> observations, DataType iss) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
for (ObservationNode o : observations) {
|
||||
if (o.obs != null && o.obs.getResource() != null) {
|
||||
PropertyWrapper pw = getProperty(o.obs.getResource(), "issued");
|
||||
if (valued(pw)) {
|
||||
if (!Base.compareDeep(pw.value().getBase(), iss, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (o.contained != null) {
|
||||
if (scanObsForIssued(o.contained, iss)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean scanObsForEffective(List<ObservationNode> observations, DataType eff) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
for (ObservationNode o : observations) {
|
||||
if (o.obs != null && o.obs.getResource() != null) {
|
||||
PropertyWrapper pw = getProperty(o.obs.getResource(), "effective[x]");
|
||||
if (valued(pw)) {
|
||||
if (!Base.compareDeep(pw.value().getBase(), eff, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (o.contained != null) {
|
||||
if (scanObsForEffective(o.contained, eff)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean scanObsForFlags(List<ObservationNode> observations) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
for (ObservationNode o : observations) {
|
||||
if (o.obs != null && o.obs.getResource() != null) {
|
||||
PropertyWrapper pw = getProperty(o.obs.getResource(), "interpretation");
|
||||
if (valued(pw)) {
|
||||
return true;
|
||||
}
|
||||
pw = getProperty(o.obs.getResource(), "status");
|
||||
if (valued(pw)) {
|
||||
if (!pw.value().getBase().primitiveValue().equals("final")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (o.contained != null) {
|
||||
if (scanObsForFlags(o.contained)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void addObservationToTable(XhtmlNode tbl, ObservationNode o, int i, String cs, boolean refRange, boolean flags, boolean note, boolean effectiveTime, boolean issued, DataType eff, DataType iss) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
XhtmlNode tr = tbl.tr();
|
||||
if (o.obs != null && o.obs.getReference() == null) {
|
||||
XhtmlNode td = tr.td().colspan(cs);
|
||||
td.i().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_NOTRES));
|
||||
} else {
|
||||
if (o.obs != null && o.obs.getResource() != null) {
|
||||
addObservationToTable(tr, o.obs.getResource(), i, o.obs.getReference(), refRange, flags, note, effectiveTime, issued, eff, iss);
|
||||
} else {
|
||||
XhtmlNode td = tr.td().colspan(cs);
|
||||
td.i().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_OBS));
|
||||
}
|
||||
if (o.contained != null) {
|
||||
for (ObservationNode c : o.contained) {
|
||||
addObservationToTable(tbl, c, i+1, cs, refRange, flags, note, effectiveTime, issued, eff, iss);
|
||||
}
|
||||
}
|
||||
package org.hl7.fhir.r5.renderers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.exceptions.DefinitionException;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r5.model.Base;
|
||||
import org.hl7.fhir.r5.model.DataType;
|
||||
import org.hl7.fhir.r5.model.DiagnosticReport;
|
||||
import org.hl7.fhir.r5.model.Resource;
|
||||
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.BaseWrapper;
|
||||
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.PropertyWrapper;
|
||||
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.ResourceWrapper;
|
||||
import org.hl7.fhir.r5.renderers.utils.DirectWrappers;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext;
|
||||
import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceContext;
|
||||
import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceWithReference;
|
||||
import org.hl7.fhir.r5.utils.EOperationOutcome;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
|
||||
|
||||
public class DiagnosticReportRenderer extends ResourceRenderer {
|
||||
|
||||
public class ObservationNode {
|
||||
private String ref;
|
||||
private ResourceWithReference obs;
|
||||
private List<ObservationNode> contained;
|
||||
}
|
||||
|
||||
|
||||
public DiagnosticReportRenderer(RenderingContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public DiagnosticReportRenderer(RenderingContext context, ResourceContext rcontext) {
|
||||
super(context, rcontext);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, Resource dr) throws IOException, FHIRException, EOperationOutcome {
|
||||
return render(x, (DiagnosticReport) dr);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, ResourceWrapper dr) throws IOException, FHIRException, EOperationOutcome {
|
||||
XhtmlNode h2 = x.h2();
|
||||
render(h2, getProperty(dr, "code").value());
|
||||
h2.tx(" ");
|
||||
PropertyWrapper pw = getProperty(dr, "category");
|
||||
if (valued(pw)) {
|
||||
h2.tx("(");
|
||||
boolean first = true;
|
||||
for (BaseWrapper b : pw.getValues()) {
|
||||
if (first) first = false; else h2.tx(", ");
|
||||
render(h2, b);
|
||||
}
|
||||
h2.tx(") ");
|
||||
}
|
||||
}
|
||||
|
||||
private void addObservationToTable(XhtmlNode tr, ResourceWrapper obs, int i, String ref, boolean refRange, boolean flags, boolean note, boolean effectiveTime, boolean issued, DataType eff, DataType iss) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
|
||||
// code (+bodysite)
|
||||
XhtmlNode td = tr.td();
|
||||
PropertyWrapper pw = getProperty(obs, "code");
|
||||
if (valued(pw)) {
|
||||
render(td.ah(ref), pw.value());
|
||||
}
|
||||
pw = getProperty(obs, "bodySite");
|
||||
if (valued(pw)) {
|
||||
td.tx(" (");
|
||||
render(td, pw.value());
|
||||
td.tx(")");
|
||||
}
|
||||
|
||||
// value / dataAbsentReason (in red)
|
||||
td = tr.td();
|
||||
pw = getProperty(obs, "value[x]");
|
||||
if (valued(pw)) {
|
||||
render(td, pw.value());
|
||||
} else {
|
||||
pw = getProperty(obs, "dataAbsentReason");
|
||||
if (valued(pw)) {
|
||||
XhtmlNode span = td.span("color: maroon", "Error");
|
||||
span.tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_ERR) + " ");
|
||||
render(span.b(), pw.value());
|
||||
}
|
||||
}
|
||||
if (refRange) {
|
||||
// reference range
|
||||
td = tr.td();
|
||||
pw = getProperty(obs, "referenceRange");
|
||||
if (valued(pw)) {
|
||||
boolean first = true;
|
||||
for (BaseWrapper v : pw.getValues()) {
|
||||
if (first) first = false; else td.br();
|
||||
PropertyWrapper pwr = getProperty(v, "type");
|
||||
if (valued(pwr)) {
|
||||
render(td, pwr.value());
|
||||
td.tx(": ");
|
||||
}
|
||||
PropertyWrapper pwt = getProperty(v, "text");
|
||||
if (valued(pwt)) {
|
||||
render(td, pwt.value());
|
||||
} else {
|
||||
PropertyWrapper pwl = getProperty(v, "low");
|
||||
PropertyWrapper pwh = getProperty(v, "high");
|
||||
if (valued(pwl) && valued(pwh)) {
|
||||
render(td, pwl.value());
|
||||
td.tx(" - ");
|
||||
render(td, pwh.value());
|
||||
} else if (valued(pwl)) {
|
||||
td.tx(">");
|
||||
render(td, pwl.value());
|
||||
} else if (valued(pwh)) {
|
||||
td.tx("<");
|
||||
render(td, pwh.value());
|
||||
} else {
|
||||
td.tx("??");
|
||||
}
|
||||
}
|
||||
pwr = getProperty(v, "appliesTo");
|
||||
PropertyWrapper pwrA = getProperty(v, "age");
|
||||
if (valued(pwr) || valued(pwrA)) {
|
||||
boolean firstA = true;
|
||||
td.tx(" "+ (context.formatPhrase(RenderingContext.DIAG_REP_REND_FOR)) + " ");
|
||||
if (valued(pwr)) {
|
||||
for (BaseWrapper va : pwr.getValues()) {
|
||||
if (firstA) firstA = false; else td.tx(", ");
|
||||
render(td, va);
|
||||
}
|
||||
}
|
||||
if (valued(pwrA)) {
|
||||
if (firstA) firstA = false; else td.tx(", ");
|
||||
td.tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_AGE) + " ");
|
||||
render(td, pwrA.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flags) {
|
||||
// flags (status other than F, interpretation, )
|
||||
td = tr.td();
|
||||
boolean first = true;
|
||||
pw = getProperty(obs, "status");
|
||||
if (valued(pw)) {
|
||||
if (!pw.value().getBase().primitiveValue().equals("final")) {
|
||||
if (first) first = false; else td.br();
|
||||
render(td, pw.value());
|
||||
}
|
||||
}
|
||||
pw = getProperty(obs, "interpretation");
|
||||
if (valued(pw)) {
|
||||
for (BaseWrapper v : pw.getValues()) {
|
||||
if (first) first = false; else td.br();
|
||||
render(td, v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (note) {
|
||||
td = tr.td();
|
||||
pw = getProperty(obs, "note");
|
||||
if (valued(pw)) {
|
||||
render(td, pw.value());
|
||||
}
|
||||
}
|
||||
if (effectiveTime) {
|
||||
// effective if different to DR
|
||||
td = tr.td();
|
||||
pw = getProperty(obs, "effective[x]");
|
||||
if (valued(pw)) {
|
||||
if (!Base.compareDeep(pw.value().getBase(), eff, true)) {
|
||||
render(td, pw.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (issued) {
|
||||
// issued if different to DR
|
||||
td = tr.td();
|
||||
pw = getProperty(obs, "issued");
|
||||
if (valued(pw)) {
|
||||
if (!Base.compareDeep(pw.value().getBase(), eff, true)) {
|
||||
render(td, pw.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
XhtmlNode tbl = x.table("grid");
|
||||
XhtmlNode tr;
|
||||
if (dr.has("subject")) {
|
||||
tr = tbl.tr();
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_SUB));
|
||||
populateSubjectSummary(tr.td(), getProperty(dr, "subject").value());
|
||||
}
|
||||
|
||||
DataType eff = null;
|
||||
DataType iss = null;
|
||||
|
||||
if (dr.has("effective[x]")) {
|
||||
tr = tbl.tr();
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_WHEN));
|
||||
eff = (DataType) getProperty(dr, "effective[x]").value().getBase();
|
||||
render(tr.td(), eff);
|
||||
}
|
||||
if (dr.has("issued")) {
|
||||
tr = tbl.tr();
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_REP));
|
||||
eff = (DataType) getProperty(dr, "issued").value().getBase();
|
||||
render(tr.td(), getProperty(dr, "issued").value());
|
||||
}
|
||||
|
||||
pw = getProperty(dr, "perfomer");
|
||||
if (valued(pw)) {
|
||||
tr = tbl.tr();
|
||||
tr.td().tx(Utilities.pluralize((context.formatPhrase(RenderingContext.DIAG_REP_REND_PER)), pw.getValues().size()));
|
||||
XhtmlNode tdr = tr.td();
|
||||
for (BaseWrapper v : pw.getValues()) {
|
||||
tdr.tx(" ");
|
||||
render(tdr, v);
|
||||
}
|
||||
}
|
||||
pw = getProperty(dr, "identifier");
|
||||
if (valued(pw)) {
|
||||
tr = tbl.tr();
|
||||
tr.td().tx(Utilities.pluralize((context.formatPhrase(RenderingContext.DIAG_REP_REND_IDENTIFIER)), pw.getValues().size())+":");
|
||||
XhtmlNode tdr = tr.td();
|
||||
for (BaseWrapper v : pw.getValues()) {
|
||||
tdr.tx(" ");
|
||||
render(tdr, v);
|
||||
}
|
||||
}
|
||||
pw = getProperty(dr, "request");
|
||||
if (valued(pw)) {
|
||||
tr = tbl.tr();
|
||||
tr.td().tx(Utilities.pluralize((context.formatPhrase(RenderingContext.DIAG_REP_REND_REQUEST)), pw.getValues().size())+":");
|
||||
XhtmlNode tdr = tr.td();
|
||||
for (BaseWrapper v : pw.getValues()) {
|
||||
tdr.tx(" ");
|
||||
render(tdr, v);
|
||||
}
|
||||
tdr.br();
|
||||
}
|
||||
|
||||
|
||||
x.para().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_REPDET));
|
||||
|
||||
pw = getProperty(dr, "result");
|
||||
if (valued(pw)) {
|
||||
List<ObservationNode> observations = fetchObservations(pw.getValues(), dr);
|
||||
buildObservationsTable(x, observations, eff, iss);
|
||||
}
|
||||
|
||||
pw = getProperty(dr, "conclusion");
|
||||
if (valued(pw)) {
|
||||
if (pw.fhirType().equals("markdown")) {
|
||||
render(x, pw.value());
|
||||
} else {
|
||||
render(x.para(), pw.value());
|
||||
}
|
||||
}
|
||||
|
||||
pw = getProperty(dr, "conclusionCode");
|
||||
if (!valued(pw)) {
|
||||
pw = getProperty(dr, "codedDiagnosis");
|
||||
}
|
||||
if (valued(pw)) {
|
||||
XhtmlNode p = x.para();
|
||||
p.b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_CODECON));
|
||||
XhtmlNode ul = x.ul();
|
||||
for (BaseWrapper v : pw.getValues()) {
|
||||
render(ul.li(), v);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, DiagnosticReport dr) throws IOException, FHIRException, EOperationOutcome {
|
||||
render(x, new DirectWrappers.ResourceWrapperDirect(this.context, dr));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void describe(XhtmlNode x, DiagnosticReport dr) {
|
||||
x.tx(display(dr));
|
||||
}
|
||||
|
||||
public String display(DiagnosticReport dr) {
|
||||
return display(dr.getCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(Resource r) throws UnsupportedEncodingException, IOException {
|
||||
return display((DiagnosticReport) r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException {
|
||||
return "Not done yet";
|
||||
}
|
||||
|
||||
private void populateSubjectSummary(XhtmlNode container, BaseWrapper subject) throws UnsupportedEncodingException, FHIRException, IOException, EOperationOutcome {
|
||||
ResourceWrapper r = fetchResource(subject);
|
||||
if (r == null)
|
||||
container.tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_UNABLE));
|
||||
else if (r.getName().equals("Patient"))
|
||||
generatePatientSummary(container, r);
|
||||
else
|
||||
container.tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_NOTDONE));
|
||||
}
|
||||
|
||||
private void generatePatientSummary(XhtmlNode c, ResourceWrapper r) throws FHIRFormatError, DefinitionException, FHIRException, IOException, EOperationOutcome {
|
||||
new PatientRenderer(context).describe(c, r);
|
||||
}
|
||||
|
||||
private List<ObservationNode> fetchObservations(List<BaseWrapper> list, ResourceWrapper rw) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
List<ObservationNode> res = new ArrayList<ObservationNode>();
|
||||
for (BaseWrapper b : list) {
|
||||
if (b.has("reference")) {
|
||||
ObservationNode obs = new ObservationNode();
|
||||
obs.ref = b.get("reference").primitiveValue();
|
||||
obs.obs = resolveReference(rw, obs.ref);
|
||||
if (obs.obs != null && obs.obs.getResource() != null) {
|
||||
PropertyWrapper t = getProperty(obs.obs.getResource(), "contained");
|
||||
if (t != null && t.hasValues()) {
|
||||
obs.contained = fetchObservations(t.getValues(), rw);
|
||||
}
|
||||
}
|
||||
res.add(obs);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private void buildObservationsTable(XhtmlNode root, List<ObservationNode> observations, DataType eff, DataType iss) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
XhtmlNode tbl = root.table("grid");
|
||||
boolean refRange = scanObsForRefRange(observations);
|
||||
boolean flags = scanObsForFlags(observations);
|
||||
boolean note = scanObsForNote(observations);
|
||||
boolean effectiveTime = scanObsForEffective(observations, eff);
|
||||
boolean issued = scanObsForIssued(observations, iss);
|
||||
int cs = 2;
|
||||
if (refRange) cs++;
|
||||
if (flags) cs++;
|
||||
if (note) cs++;
|
||||
if (issued) cs++;
|
||||
if (effectiveTime) cs++;
|
||||
XhtmlNode tr = tbl.tr();
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_CODE));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_VALUE));
|
||||
if (refRange) {
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_REFRAN));
|
||||
}
|
||||
if (flags) {
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_FLAG));
|
||||
}
|
||||
if (note) {
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_NOTE));
|
||||
}
|
||||
if (effectiveTime) {
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_WHEN));
|
||||
}
|
||||
if (issued) {
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_REP));
|
||||
}
|
||||
for (ObservationNode o : observations) {
|
||||
addObservationToTable(tbl, o, 0, Integer.toString(cs), refRange, flags, note, effectiveTime, issued, eff, iss);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean scanObsForRefRange(List<ObservationNode> observations) {
|
||||
for (ObservationNode o : observations) {
|
||||
if (o.obs != null && o.obs.getResource() != null) {
|
||||
PropertyWrapper pw = getProperty(o.obs.getResource(), "referenceRange");
|
||||
if (valued(pw)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (o.contained != null) {
|
||||
if (scanObsForRefRange(o.contained)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean scanObsForNote(List<ObservationNode> observations) {
|
||||
for (ObservationNode o : observations) {
|
||||
if (o.obs != null && o.obs.getResource() != null) {
|
||||
PropertyWrapper pw = getProperty(o.obs.getResource(), "note");
|
||||
if (valued(pw)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (o.contained != null) {
|
||||
if (scanObsForNote(o.contained)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean scanObsForIssued(List<ObservationNode> observations, DataType iss) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
for (ObservationNode o : observations) {
|
||||
if (o.obs != null && o.obs.getResource() != null) {
|
||||
PropertyWrapper pw = getProperty(o.obs.getResource(), "issued");
|
||||
if (valued(pw)) {
|
||||
if (!Base.compareDeep(pw.value().getBase(), iss, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (o.contained != null) {
|
||||
if (scanObsForIssued(o.contained, iss)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean scanObsForEffective(List<ObservationNode> observations, DataType eff) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
for (ObservationNode o : observations) {
|
||||
if (o.obs != null && o.obs.getResource() != null) {
|
||||
PropertyWrapper pw = getProperty(o.obs.getResource(), "effective[x]");
|
||||
if (valued(pw)) {
|
||||
if (!Base.compareDeep(pw.value().getBase(), eff, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (o.contained != null) {
|
||||
if (scanObsForEffective(o.contained, eff)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean scanObsForFlags(List<ObservationNode> observations) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
for (ObservationNode o : observations) {
|
||||
if (o.obs != null && o.obs.getResource() != null) {
|
||||
PropertyWrapper pw = getProperty(o.obs.getResource(), "interpretation");
|
||||
if (valued(pw)) {
|
||||
return true;
|
||||
}
|
||||
pw = getProperty(o.obs.getResource(), "status");
|
||||
if (valued(pw)) {
|
||||
if (!pw.value().getBase().primitiveValue().equals("final")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (o.contained != null) {
|
||||
if (scanObsForFlags(o.contained)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void addObservationToTable(XhtmlNode tbl, ObservationNode o, int i, String cs, boolean refRange, boolean flags, boolean note, boolean effectiveTime, boolean issued, DataType eff, DataType iss) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
XhtmlNode tr = tbl.tr();
|
||||
if (o.obs != null && o.obs.getReference() == null) {
|
||||
XhtmlNode td = tr.td().colspan(cs);
|
||||
td.i().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_NOTRES));
|
||||
} else {
|
||||
if (o.obs != null && o.obs.getResource() != null) {
|
||||
addObservationToTable(tr, o.obs.getResource(), i, o.obs.getReference(), refRange, flags, note, effectiveTime, issued, eff, iss);
|
||||
} else {
|
||||
XhtmlNode td = tr.td().colspan(cs);
|
||||
td.i().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_OBS));
|
||||
}
|
||||
if (o.contained != null) {
|
||||
for (ObservationNode c : o.contained) {
|
||||
addObservationToTable(tbl, c, i+1, cs, refRange, flags, note, effectiveTime, issued, eff, iss);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addObservationToTable(XhtmlNode tr, ResourceWrapper obs, int i, String ref, boolean refRange, boolean flags, boolean note, boolean effectiveTime, boolean issued, DataType eff, DataType iss) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
|
||||
// code (+bodysite)
|
||||
XhtmlNode td = tr.td();
|
||||
PropertyWrapper pw = getProperty(obs, "code");
|
||||
if (valued(pw)) {
|
||||
render(td.ah(ref), pw.value());
|
||||
}
|
||||
pw = getProperty(obs, "bodySite");
|
||||
if (valued(pw)) {
|
||||
td.tx(" (");
|
||||
render(td, pw.value());
|
||||
td.tx(")");
|
||||
}
|
||||
|
||||
// value / dataAbsentReason (in red)
|
||||
td = tr.td();
|
||||
pw = getProperty(obs, "value[x]");
|
||||
if (valued(pw)) {
|
||||
render(td, pw.value());
|
||||
} else {
|
||||
pw = getProperty(obs, "dataAbsentReason");
|
||||
if (valued(pw)) {
|
||||
XhtmlNode span = td.span("color: maroon", "Error");
|
||||
span.tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_ERR) + " ");
|
||||
render(span.b(), pw.value());
|
||||
}
|
||||
}
|
||||
if (refRange) {
|
||||
// reference range
|
||||
td = tr.td();
|
||||
pw = getProperty(obs, "referenceRange");
|
||||
if (valued(pw)) {
|
||||
boolean first = true;
|
||||
for (BaseWrapper v : pw.getValues()) {
|
||||
if (first) first = false; else td.br();
|
||||
PropertyWrapper pwr = getProperty(v, "type");
|
||||
if (valued(pwr)) {
|
||||
render(td, pwr.value());
|
||||
td.tx(": ");
|
||||
}
|
||||
PropertyWrapper pwt = getProperty(v, "text");
|
||||
if (valued(pwt)) {
|
||||
render(td, pwt.value());
|
||||
} else {
|
||||
PropertyWrapper pwl = getProperty(v, "low");
|
||||
PropertyWrapper pwh = getProperty(v, "high");
|
||||
if (valued(pwl) && valued(pwh)) {
|
||||
render(td, pwl.value());
|
||||
td.tx(" - ");
|
||||
render(td, pwh.value());
|
||||
} else if (valued(pwl)) {
|
||||
td.tx(">");
|
||||
render(td, pwl.value());
|
||||
} else if (valued(pwh)) {
|
||||
td.tx("<");
|
||||
render(td, pwh.value());
|
||||
} else {
|
||||
td.tx("??");
|
||||
}
|
||||
}
|
||||
pwr = getProperty(v, "appliesTo");
|
||||
PropertyWrapper pwrA = getProperty(v, "age");
|
||||
if (valued(pwr) || valued(pwrA)) {
|
||||
boolean firstA = true;
|
||||
td.tx(" "+ (context.formatPhrase(RenderingContext.DIAG_REP_REND_FOR)) + " ");
|
||||
if (valued(pwr)) {
|
||||
for (BaseWrapper va : pwr.getValues()) {
|
||||
if (firstA) firstA = false; else td.tx(", ");
|
||||
render(td, va);
|
||||
}
|
||||
}
|
||||
if (valued(pwrA)) {
|
||||
if (firstA) firstA = false; else td.tx(", ");
|
||||
td.tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_AGE) + " ");
|
||||
render(td, pwrA.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flags) {
|
||||
// flags (status other than F, interpretation, )
|
||||
td = tr.td();
|
||||
boolean first = true;
|
||||
pw = getProperty(obs, "status");
|
||||
if (valued(pw)) {
|
||||
if (!pw.value().getBase().primitiveValue().equals("final")) {
|
||||
if (first) first = false; else td.br();
|
||||
render(td, pw.value());
|
||||
}
|
||||
}
|
||||
pw = getProperty(obs, "interpretation");
|
||||
if (valued(pw)) {
|
||||
for (BaseWrapper v : pw.getValues()) {
|
||||
if (first) first = false; else td.br();
|
||||
render(td, v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (note) {
|
||||
td = tr.td();
|
||||
pw = getProperty(obs, "note");
|
||||
if (valued(pw)) {
|
||||
render(td, pw.value());
|
||||
}
|
||||
}
|
||||
if (effectiveTime) {
|
||||
// effective if different to DR
|
||||
td = tr.td();
|
||||
pw = getProperty(obs, "effective[x]");
|
||||
if (valued(pw)) {
|
||||
if (!Base.compareDeep(pw.value().getBase(), eff, true)) {
|
||||
render(td, pw.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (issued) {
|
||||
// issued if different to DR
|
||||
td = tr.td();
|
||||
pw = getProperty(obs, "issued");
|
||||
if (valued(pw)) {
|
||||
if (!Base.compareDeep(pw.value().getBase(), eff, true)) {
|
||||
render(td, pw.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,253 +1,253 @@
|
|||
package org.hl7.fhir.r5.renderers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import org.hl7.fhir.exceptions.DefinitionException;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r5.model.Annotation;
|
||||
import org.hl7.fhir.r5.model.Base;
|
||||
import org.hl7.fhir.r5.model.ListResource;
|
||||
import org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent;
|
||||
import org.hl7.fhir.r5.model.Reference;
|
||||
import org.hl7.fhir.r5.model.Resource;
|
||||
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.BaseWrapper;
|
||||
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.ResourceWrapper;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext;
|
||||
import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceContext;
|
||||
import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceWithReference;
|
||||
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
|
||||
|
||||
public class ListRenderer extends ResourceRenderer {
|
||||
|
||||
public ListRenderer(RenderingContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public ListRenderer(RenderingContext context, ResourceContext rcontext) {
|
||||
super(context, rcontext);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, Resource dr) throws FHIRFormatError, DefinitionException, IOException {
|
||||
return render(x, (ListResource) dr);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, ResourceWrapper list) throws FHIRFormatError, DefinitionException, IOException {
|
||||
if (list.has("title")) {
|
||||
x.h2().tx(list.get("title").primitiveValue());
|
||||
}
|
||||
XhtmlNode t = x.table("clstu");
|
||||
XhtmlNode tr = t.tr();
|
||||
XhtmlNode td = tr.td();
|
||||
if (list.has("date")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_DATE, displayDateTime(list.get("date").dateTimeValue()))+" ");
|
||||
package org.hl7.fhir.r5.renderers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import org.hl7.fhir.exceptions.DefinitionException;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r5.model.Annotation;
|
||||
import org.hl7.fhir.r5.model.Base;
|
||||
import org.hl7.fhir.r5.model.ListResource;
|
||||
import org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent;
|
||||
import org.hl7.fhir.r5.model.Reference;
|
||||
import org.hl7.fhir.r5.model.Resource;
|
||||
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.BaseWrapper;
|
||||
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.ResourceWrapper;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext;
|
||||
import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceContext;
|
||||
import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceWithReference;
|
||||
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
|
||||
|
||||
public class ListRenderer extends ResourceRenderer {
|
||||
|
||||
public ListRenderer(RenderingContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public ListRenderer(RenderingContext context, ResourceContext rcontext) {
|
||||
super(context, rcontext);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, Resource dr) throws FHIRFormatError, DefinitionException, IOException {
|
||||
return render(x, (ListResource) dr);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, ResourceWrapper list) throws FHIRFormatError, DefinitionException, IOException {
|
||||
if (list.has("title")) {
|
||||
x.h2().tx(list.get("title").primitiveValue());
|
||||
}
|
||||
if (list.has("mode")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_MODE, list.get("mode").primitiveValue())+" ");
|
||||
}
|
||||
if (list.has("status")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_STAT, list.get("status").primitiveValue())+" ");
|
||||
}
|
||||
if (list.has("code")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.GENERAL_CODE, displayBase(list.get("code")))+" ");
|
||||
}
|
||||
tr = t.tr();
|
||||
td = tr.td();
|
||||
if (list.has("subject")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_SUB)+" ");
|
||||
shortForRef(td, list.get("subject"));
|
||||
}
|
||||
if (list.has("encounter")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_ENC)+" ");
|
||||
shortForRef(td, list.get("encounter"));
|
||||
}
|
||||
if (list.has("source")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_SRC)+" ");
|
||||
shortForRef(td, list.get("encounter"));
|
||||
}
|
||||
if (list.has("orderedBy")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_ORD, displayBase(list.get("orderedBy")))+" ");
|
||||
}
|
||||
// for (Annotation a : list.getNote()) {
|
||||
// renderAnnotation(a, x);
|
||||
// }
|
||||
boolean flag = false;
|
||||
boolean deleted = false;
|
||||
boolean date = false;
|
||||
for (BaseWrapper e : list.children("entry")) {
|
||||
flag = flag || e.has("flag");
|
||||
deleted = deleted || e.has("deleted");
|
||||
date = date || e.has("date");
|
||||
}
|
||||
t = x.table("grid");
|
||||
tr = t.tr().style("backgound-color: #eeeeee");
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.LIST_REND_ITEM));
|
||||
if (date) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DAT));
|
||||
}
|
||||
if (flag) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_FLAG));
|
||||
}
|
||||
if (deleted) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DEL));
|
||||
}
|
||||
for (BaseWrapper e : list.children("entry")) {
|
||||
tr = t.tr();
|
||||
shortForRef(tr.td(), e.get("item"));
|
||||
if (date) {
|
||||
tr.td().tx(e.has("date") ? e.get("date").dateTimeValue().toHumanDisplay() : "");
|
||||
}
|
||||
if (flag) {
|
||||
tr.td().tx(e.has("flag") ? displayBase(e.get("flag")) : "");
|
||||
}
|
||||
if (deleted) {
|
||||
tr.td().tx(e.has("deleted") ? e.get("deleted").primitiveValue() : "");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public boolean render(XhtmlNode x, ListResource list) throws FHIRFormatError, DefinitionException, IOException {
|
||||
if (list.hasTitle()) {
|
||||
x.h2().tx(list.getTitle());
|
||||
}
|
||||
XhtmlNode t = x.table("clstu");
|
||||
XhtmlNode tr = t.tr();
|
||||
if (list.hasDate()) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DATE, displayDateTime(list.getDateElement()))+" ");
|
||||
}
|
||||
if (list.hasMode()) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_MODE, list.getMode().getDisplay())+" ");
|
||||
}
|
||||
if (list.hasStatus()) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_STAT, list.getStatus().getDisplay())+" ");
|
||||
}
|
||||
if (list.hasCode()) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.GENERAL_CODE, display(list.getCode()))+" ");
|
||||
}
|
||||
tr = t.tr();
|
||||
if (list.hasSubject()) {
|
||||
if (list.getSubject().size() == 1) {
|
||||
shortForRef(tr.td().txN("Subject: "), list.getSubjectFirstRep());
|
||||
} else {
|
||||
XhtmlNode td = tr.td();
|
||||
td.txN(context.formatPhrase(RenderingContext.LIST_REND_SUB)+" ");
|
||||
int i = 0;
|
||||
for (Reference subj : list.getSubject()) {
|
||||
if (i == list.getSubject().size() - 1) {
|
||||
td.tx(" and ");
|
||||
} else if (i > 0) {
|
||||
td.tx(", ");
|
||||
}
|
||||
shortForRef(td, subj);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.hasEncounter()) {
|
||||
shortForRef(tr.td().txN(context.formatPhrase(RenderingContext.LIST_REND_ENC)+" "), list.getEncounter());
|
||||
}
|
||||
if (list.hasSource()) {
|
||||
shortForRef(tr.td().txN(context.formatPhrase(RenderingContext.LIST_REND_SRC)+" "), list.getEncounter());
|
||||
}
|
||||
if (list.hasOrderedBy()) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_ORD, display(list.getOrderedBy()))+" ");
|
||||
}
|
||||
for (Annotation a : list.getNote()) {
|
||||
renderAnnotation(x, a);
|
||||
}
|
||||
boolean flag = false;
|
||||
boolean deleted = false;
|
||||
boolean date = false;
|
||||
for (ListResourceEntryComponent e : list.getEntry()) {
|
||||
flag = flag || e.hasFlag();
|
||||
deleted = deleted || e.hasDeleted();
|
||||
date = date || e.hasDate();
|
||||
}
|
||||
t = x.table("grid");
|
||||
tr = t.tr().style("backgound-color: #eeeeee");
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.LIST_REND_ITEM));
|
||||
if (date) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DAT));
|
||||
}
|
||||
if (flag) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_FLAG));
|
||||
}
|
||||
if (deleted) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DEL));
|
||||
}
|
||||
for (ListResourceEntryComponent e : list.getEntry()) {
|
||||
tr = t.tr();
|
||||
shortForRef(tr.td(), e.getItem());
|
||||
if (date) {
|
||||
tr.td().tx(e.hasDate() ? e.getDate().toLocaleString() : "");
|
||||
}
|
||||
if (flag) {
|
||||
tr.td().tx(e.hasFlag() ? display(e.getFlag()) : "");
|
||||
}
|
||||
if (deleted) {
|
||||
tr.td().tx(e.hasDeleted() ? Boolean.toString(e.getDeleted()) : "");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void describe(XhtmlNode x, ListResource list) {
|
||||
x.tx(display(list));
|
||||
}
|
||||
|
||||
public String display(ListResource list) {
|
||||
return list.getTitle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(Resource r) throws UnsupportedEncodingException, IOException {
|
||||
return ((ListResource) r).getTitle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException {
|
||||
if (r.has("title")) {
|
||||
return r.children("title").get(0).getBase().primitiveValue();
|
||||
}
|
||||
return "??";
|
||||
}
|
||||
|
||||
private void shortForRef(XhtmlNode x, Reference ref) throws UnsupportedEncodingException, IOException {
|
||||
ResourceWithReference r = context.getResolver() == null ? null : context.getResolver().resolve(context, ref.getReference());
|
||||
if (r == null) {
|
||||
x.tx(display(ref));
|
||||
} else {
|
||||
RendererFactory.factory(r.getResource().getName(), context).renderReference(r.getResource(), x, ref);
|
||||
}
|
||||
}
|
||||
|
||||
private XhtmlNode shortForRef(XhtmlNode x, Base ref) throws UnsupportedEncodingException, IOException {
|
||||
if (ref == null) {
|
||||
x.tx("(null)");
|
||||
} else {
|
||||
String disp = ref.getChildByName("display") != null && ref.getChildByName("display").hasValues() ? ref.getChildByName("display").getValues().get(0).primitiveValue() : null;
|
||||
if (ref.getChildByName("reference").hasValues()) {
|
||||
String url = ref.getChildByName("reference").getValues().get(0).primitiveValue();
|
||||
if (url.startsWith("#")) {
|
||||
x.tx("?ngen-16a?");
|
||||
} else {
|
||||
ResourceWithReference r = context.getResolver().resolve(context, url);
|
||||
if (r == null) {
|
||||
if (disp == null) {
|
||||
disp = url;
|
||||
}
|
||||
x.tx(disp);
|
||||
} else if (r.getResource() != null) {
|
||||
RendererFactory.factory(r.getResource().getName(), context).renderReference(r.getResource(), x, (Reference) ref);
|
||||
} else {
|
||||
x.ah(r.getReference()).tx(url);
|
||||
}
|
||||
}
|
||||
} else if (disp != null) {
|
||||
x.tx(disp);
|
||||
} else {
|
||||
x.tx("?ngen-16?");
|
||||
}
|
||||
}
|
||||
return x;
|
||||
}
|
||||
}
|
||||
XhtmlNode t = x.table("clstu");
|
||||
XhtmlNode tr = t.tr();
|
||||
XhtmlNode td = tr.td();
|
||||
if (list.has("date")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_DATE, displayDateTime(list.get("date").dateTimeValue()))+" ");
|
||||
}
|
||||
if (list.has("mode")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_MODE, list.get("mode").primitiveValue())+" ");
|
||||
}
|
||||
if (list.has("status")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_STAT, list.get("status").primitiveValue())+" ");
|
||||
}
|
||||
if (list.has("code")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_CODE, displayBase(list.get("code")))+" ");
|
||||
}
|
||||
tr = t.tr();
|
||||
td = tr.td();
|
||||
if (list.has("subject")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_SUB)+" ");
|
||||
shortForRef(td, list.get("subject"));
|
||||
}
|
||||
if (list.has("encounter")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_ENC)+" ");
|
||||
shortForRef(td, list.get("encounter"));
|
||||
}
|
||||
if (list.has("source")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_SRC)+" ");
|
||||
shortForRef(td, list.get("encounter"));
|
||||
}
|
||||
if (list.has("orderedBy")) {
|
||||
td.tx(context.formatPhrase(RenderingContext.LIST_REND_ORD, displayBase(list.get("orderedBy")))+" ");
|
||||
}
|
||||
// for (Annotation a : list.getNote()) {
|
||||
// renderAnnotation(a, x);
|
||||
// }
|
||||
boolean flag = false;
|
||||
boolean deleted = false;
|
||||
boolean date = false;
|
||||
for (BaseWrapper e : list.children("entry")) {
|
||||
flag = flag || e.has("flag");
|
||||
deleted = deleted || e.has("deleted");
|
||||
date = date || e.has("date");
|
||||
}
|
||||
t = x.table("grid");
|
||||
tr = t.tr().style("backgound-color: #eeeeee");
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.LIST_REND_ITEM));
|
||||
if (date) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DAT));
|
||||
}
|
||||
if (flag) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_FLAG));
|
||||
}
|
||||
if (deleted) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DEL));
|
||||
}
|
||||
for (BaseWrapper e : list.children("entry")) {
|
||||
tr = t.tr();
|
||||
shortForRef(tr.td(), e.get("item"));
|
||||
if (date) {
|
||||
tr.td().tx(e.has("date") ? e.get("date").dateTimeValue().toHumanDisplay() : "");
|
||||
}
|
||||
if (flag) {
|
||||
tr.td().tx(e.has("flag") ? displayBase(e.get("flag")) : "");
|
||||
}
|
||||
if (deleted) {
|
||||
tr.td().tx(e.has("deleted") ? e.get("deleted").primitiveValue() : "");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public boolean render(XhtmlNode x, ListResource list) throws FHIRFormatError, DefinitionException, IOException {
|
||||
if (list.hasTitle()) {
|
||||
x.h2().tx(list.getTitle());
|
||||
}
|
||||
XhtmlNode t = x.table("clstu");
|
||||
XhtmlNode tr = t.tr();
|
||||
if (list.hasDate()) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DATE, displayDateTime(list.getDateElement()))+" ");
|
||||
}
|
||||
if (list.hasMode()) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_MODE, list.getMode().getDisplay())+" ");
|
||||
}
|
||||
if (list.hasStatus()) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_STAT, list.getStatus().getDisplay())+" ");
|
||||
}
|
||||
if (list.hasCode()) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_CODE, display(list.getCode()))+" ");
|
||||
}
|
||||
tr = t.tr();
|
||||
if (list.hasSubject()) {
|
||||
if (list.getSubject().size() == 1) {
|
||||
shortForRef(tr.td().txN("Subject: "), list.getSubjectFirstRep());
|
||||
} else {
|
||||
XhtmlNode td = tr.td();
|
||||
td.txN(context.formatPhrase(RenderingContext.LIST_REND_SUB)+" ");
|
||||
int i = 0;
|
||||
for (Reference subj : list.getSubject()) {
|
||||
if (i == list.getSubject().size() - 1) {
|
||||
td.tx(" and ");
|
||||
} else if (i > 0) {
|
||||
td.tx(", ");
|
||||
}
|
||||
shortForRef(td, subj);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.hasEncounter()) {
|
||||
shortForRef(tr.td().txN(context.formatPhrase(RenderingContext.LIST_REND_ENC)+" "), list.getEncounter());
|
||||
}
|
||||
if (list.hasSource()) {
|
||||
shortForRef(tr.td().txN(context.formatPhrase(RenderingContext.LIST_REND_SRC)+" "), list.getEncounter());
|
||||
}
|
||||
if (list.hasOrderedBy()) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_ORD, display(list.getOrderedBy()))+" ");
|
||||
}
|
||||
for (Annotation a : list.getNote()) {
|
||||
renderAnnotation(x, a);
|
||||
}
|
||||
boolean flag = false;
|
||||
boolean deleted = false;
|
||||
boolean date = false;
|
||||
for (ListResourceEntryComponent e : list.getEntry()) {
|
||||
flag = flag || e.hasFlag();
|
||||
deleted = deleted || e.hasDeleted();
|
||||
date = date || e.hasDate();
|
||||
}
|
||||
t = x.table("grid");
|
||||
tr = t.tr().style("backgound-color: #eeeeee");
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.LIST_REND_ITEM));
|
||||
if (date) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DAT));
|
||||
}
|
||||
if (flag) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_FLAG));
|
||||
}
|
||||
if (deleted) {
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DEL));
|
||||
}
|
||||
for (ListResourceEntryComponent e : list.getEntry()) {
|
||||
tr = t.tr();
|
||||
shortForRef(tr.td(), e.getItem());
|
||||
if (date) {
|
||||
tr.td().tx(e.hasDate() ? e.getDate().toLocaleString() : "");
|
||||
}
|
||||
if (flag) {
|
||||
tr.td().tx(e.hasFlag() ? display(e.getFlag()) : "");
|
||||
}
|
||||
if (deleted) {
|
||||
tr.td().tx(e.hasDeleted() ? Boolean.toString(e.getDeleted()) : "");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void describe(XhtmlNode x, ListResource list) {
|
||||
x.tx(display(list));
|
||||
}
|
||||
|
||||
public String display(ListResource list) {
|
||||
return list.getTitle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(Resource r) throws UnsupportedEncodingException, IOException {
|
||||
return ((ListResource) r).getTitle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException {
|
||||
if (r.has("title")) {
|
||||
return r.children("title").get(0).getBase().primitiveValue();
|
||||
}
|
||||
return "??";
|
||||
}
|
||||
|
||||
private void shortForRef(XhtmlNode x, Reference ref) throws UnsupportedEncodingException, IOException {
|
||||
ResourceWithReference r = context.getResolver() == null ? null : context.getResolver().resolve(context, ref.getReference());
|
||||
if (r == null) {
|
||||
x.tx(display(ref));
|
||||
} else {
|
||||
RendererFactory.factory(r.getResource().getName(), context).renderReference(r.getResource(), x, ref);
|
||||
}
|
||||
}
|
||||
|
||||
private XhtmlNode shortForRef(XhtmlNode x, Base ref) throws UnsupportedEncodingException, IOException {
|
||||
if (ref == null) {
|
||||
x.tx("(null)");
|
||||
} else {
|
||||
String disp = ref.getChildByName("display") != null && ref.getChildByName("display").hasValues() ? ref.getChildByName("display").getValues().get(0).primitiveValue() : null;
|
||||
if (ref.getChildByName("reference").hasValues()) {
|
||||
String url = ref.getChildByName("reference").getValues().get(0).primitiveValue();
|
||||
if (url.startsWith("#")) {
|
||||
x.tx("?ngen-16a?");
|
||||
} else {
|
||||
ResourceWithReference r = context.getResolver().resolve(context, url);
|
||||
if (r == null) {
|
||||
if (disp == null) {
|
||||
disp = url;
|
||||
}
|
||||
x.tx(disp);
|
||||
} else if (r.getResource() != null) {
|
||||
RendererFactory.factory(r.getResource().getName(), context).renderReference(r.getResource(), x, (Reference) ref);
|
||||
} else {
|
||||
x.ah(r.getReference()).tx(url);
|
||||
}
|
||||
}
|
||||
} else if (disp != null) {
|
||||
x.tx(disp);
|
||||
} else {
|
||||
x.tx("?ngen-16?");
|
||||
}
|
||||
}
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,189 +1,189 @@
|
|||
package org.hl7.fhir.r5.renderers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.CanonicalType;
|
||||
import org.hl7.fhir.r5.model.CodeType;
|
||||
import org.hl7.fhir.r5.model.Enumeration;
|
||||
import org.hl7.fhir.r5.model.Enumerations.FHIRTypes;
|
||||
import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAll;
|
||||
import org.hl7.fhir.r5.model.Extension;
|
||||
import org.hl7.fhir.r5.model.OperationDefinition;
|
||||
import org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent;
|
||||
import org.hl7.fhir.r5.model.OperationDefinition.OperationParameterScope;
|
||||
import org.hl7.fhir.r5.model.Resource;
|
||||
import org.hl7.fhir.r5.model.StructureDefinition;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext.KnownLinkType;
|
||||
import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceContext;
|
||||
import org.hl7.fhir.r5.utils.EOperationOutcome;
|
||||
import org.hl7.fhir.r5.utils.ToolingExtensions;
|
||||
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
|
||||
import org.hl7.fhir.utilities.StandardsStatus;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.VersionUtilities;
|
||||
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
|
||||
|
||||
public class OperationDefinitionRenderer extends TerminologyRenderer {
|
||||
|
||||
public OperationDefinitionRenderer(RenderingContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public OperationDefinitionRenderer(RenderingContext context, ResourceContext rcontext) {
|
||||
super(context, rcontext);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, Resource dr) throws IOException, FHIRException, EOperationOutcome {
|
||||
return render(x, (OperationDefinition) dr);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, OperationDefinition opd) throws IOException, FHIRException, EOperationOutcome {
|
||||
if (context.isHeader()) {
|
||||
x.h2().addText(opd.getName());
|
||||
x.para().addText(Utilities.capitalize(opd.getKind().toString())+": "+opd.getName());
|
||||
x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_OFFIC)+" ");
|
||||
x.pre().tx(opd.getUrl());
|
||||
addMarkdown(x, opd.getDescription());}
|
||||
|
||||
if (opd.getSystem())
|
||||
x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_URLS, opd.getCode()));
|
||||
for (Enumeration<VersionIndependentResourceTypesAll> c : opd.getResource()) {
|
||||
if (opd.getType())
|
||||
x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_URL, c.getCode()+"/$"+opd.getCode()));
|
||||
if (opd.getInstance())
|
||||
x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_URL, c.getCode()+"/[id]/$"+opd.getCode()));
|
||||
}
|
||||
|
||||
if (opd.hasInputProfile()) {
|
||||
XhtmlNode p = x.para();
|
||||
p.tx(context.formatPhrase(RenderingContext.OP_DEF_INPAR));
|
||||
StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, opd.getInputProfile(), opd);
|
||||
if (sd == null) {
|
||||
p.pre().tx(opd.getInputProfile());
|
||||
} else {
|
||||
p.ah(sd.getWebPath()).tx(sd.present());
|
||||
}
|
||||
}
|
||||
if (opd.hasOutputProfile()) {
|
||||
XhtmlNode p = x.para();
|
||||
p.tx(context.formatPhrase(RenderingContext.OP_DEF_OUTPAR));
|
||||
StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, opd.getOutputProfile(), opd);
|
||||
if (sd == null) {
|
||||
p.pre().tx(opd.getOutputProfile());
|
||||
} else {
|
||||
p.ah(sd.getWebPath()).tx(sd.present());
|
||||
}
|
||||
}
|
||||
x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_PAR));
|
||||
XhtmlNode tbl = x.table( "grid");
|
||||
XhtmlNode tr = tbl.tr();
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_USE));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_NAME));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_SCO));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CARDINALITY));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_TYPE));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_BINDING));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_DOC));
|
||||
for (OperationDefinitionParameterComponent p : opd.getParameter()) {
|
||||
genOpParam(tbl, "", p, opd);
|
||||
}
|
||||
addMarkdown(x, opd.getComment());
|
||||
return true;
|
||||
}
|
||||
|
||||
public void describe(XhtmlNode x, OperationDefinition opd) {
|
||||
x.tx(display(opd));
|
||||
}
|
||||
|
||||
public String display(OperationDefinition opd) {
|
||||
return opd.present();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(Resource r) throws UnsupportedEncodingException, IOException {
|
||||
return ((OperationDefinition) r).present();
|
||||
}
|
||||
|
||||
private void genOpParam(XhtmlNode tbl, String path, OperationDefinitionParameterComponent p, Resource opd) throws EOperationOutcome, FHIRException, IOException {
|
||||
XhtmlNode tr;
|
||||
tr = tbl.tr();
|
||||
tr.td().addText(p.getUse().toString());
|
||||
XhtmlNode td = tr.td();
|
||||
td.addText(path+p.getName());
|
||||
StandardsStatus ss = ToolingExtensions.getStandardsStatus(p);
|
||||
genStandardsStatus(td, ss);
|
||||
td = tr.td();
|
||||
if (p.hasScope()) {
|
||||
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
|
||||
for (Enumeration<OperationParameterScope> s : p.getScope()) {
|
||||
b.append(s.getCode());
|
||||
}
|
||||
td.tx(b.toString());
|
||||
}
|
||||
tr.td().addText(Integer.toString(p.getMin())+".."+p.getMax());
|
||||
td = tr.td();
|
||||
String actualType = translateTypeToVersion(p.getTypeElement());
|
||||
StructureDefinition sd = actualType != null ? context.getWorker().fetchTypeDefinition(actualType) : null;
|
||||
if (sd == null)
|
||||
td.tx(p.hasType() ? actualType : "");
|
||||
else if (sd.getAbstract() && p.hasExtension(ToolingExtensions.EXT_ALLOWED_TYPE)) {
|
||||
boolean first = true;
|
||||
for (Extension ex : p.getExtensionsByUrl(ToolingExtensions.EXT_ALLOWED_TYPE)) {
|
||||
if (first) first = false; else td.tx(" | ");
|
||||
String s = ex.getValue().primitiveValue();
|
||||
StructureDefinition sdt = context.getWorker().fetchTypeDefinition(s);
|
||||
if (sdt == null)
|
||||
td.tx(p.hasType() ? actualType : "");
|
||||
else
|
||||
td.ah(sdt.getWebPath()).tx(s);
|
||||
}
|
||||
} else
|
||||
td.ah(sd.getWebPath()).tx(actualType);
|
||||
if (p.hasTargetProfile()) {
|
||||
td.tx(" (");
|
||||
boolean first = true;
|
||||
for (CanonicalType tp : p.getTargetProfile()) {
|
||||
if (first) { first = false;} else {td.tx(", ");};
|
||||
StructureDefinition sdt = context.getWorker().fetchTypeDefinition(tp.asStringValue());
|
||||
if (sdt == null || !sdt.hasWebPath()) {
|
||||
td.code().tx(tp.asStringValue());
|
||||
} else {
|
||||
td.ah(sdt.getWebPath(), tp.asStringValue()).tx(sdt.present());
|
||||
}
|
||||
}
|
||||
td.tx(")");
|
||||
}
|
||||
if (p.hasSearchType()) {
|
||||
td.br();
|
||||
td.tx("(");
|
||||
td.ah( context.getLink(KnownLinkType.SPEC) == null ? "search.html#"+p.getSearchType().toCode() : Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "search.html#"+p.getSearchType().toCode())).tx(p.getSearchType().toCode());
|
||||
td.tx(")");
|
||||
}
|
||||
td = tr.td();
|
||||
if (p.hasBinding() && p.getBinding().hasValueSet()) {
|
||||
AddVsRef(p.getBinding().getValueSet(), td, opd);
|
||||
td.tx(" ("+p.getBinding().getStrength().getDisplay()+")");
|
||||
}
|
||||
addMarkdown(tr.td(), p.getDocumentation());
|
||||
if (!p.hasType()) {
|
||||
for (OperationDefinitionParameterComponent pp : p.getPart()) {
|
||||
genOpParam(tbl, path+p.getName()+".", pp, opd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final String EXT_OPDEF_ORIGINAL_TYPE = "http://hl7.org/fhir/4.0/StructureDefinition/extension-OperationDefinition.parameter.type";
|
||||
|
||||
private String translateTypeToVersion(Enumeration<FHIRTypes> src) {
|
||||
if (src.hasExtension(EXT_OPDEF_ORIGINAL_TYPE)) {
|
||||
return src.getExtensionString(EXT_OPDEF_ORIGINAL_TYPE);
|
||||
} else {
|
||||
return src.asStringValue();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
package org.hl7.fhir.r5.renderers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.CanonicalType;
|
||||
import org.hl7.fhir.r5.model.CodeType;
|
||||
import org.hl7.fhir.r5.model.Enumeration;
|
||||
import org.hl7.fhir.r5.model.Enumerations.FHIRTypes;
|
||||
import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAll;
|
||||
import org.hl7.fhir.r5.model.Extension;
|
||||
import org.hl7.fhir.r5.model.OperationDefinition;
|
||||
import org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent;
|
||||
import org.hl7.fhir.r5.model.OperationDefinition.OperationParameterScope;
|
||||
import org.hl7.fhir.r5.model.Resource;
|
||||
import org.hl7.fhir.r5.model.StructureDefinition;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext.KnownLinkType;
|
||||
import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceContext;
|
||||
import org.hl7.fhir.r5.utils.EOperationOutcome;
|
||||
import org.hl7.fhir.r5.utils.ToolingExtensions;
|
||||
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
|
||||
import org.hl7.fhir.utilities.StandardsStatus;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.VersionUtilities;
|
||||
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
|
||||
|
||||
public class OperationDefinitionRenderer extends TerminologyRenderer {
|
||||
|
||||
public OperationDefinitionRenderer(RenderingContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public OperationDefinitionRenderer(RenderingContext context, ResourceContext rcontext) {
|
||||
super(context, rcontext);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, Resource dr) throws IOException, FHIRException, EOperationOutcome {
|
||||
return render(x, (OperationDefinition) dr);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, OperationDefinition opd) throws IOException, FHIRException, EOperationOutcome {
|
||||
if (context.isHeader()) {
|
||||
x.h2().addText(opd.getName());
|
||||
x.para().addText(Utilities.capitalize(opd.getKind().toString())+": "+opd.getName());
|
||||
x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_OFFIC)+" ");
|
||||
x.pre().tx(opd.getUrl());
|
||||
addMarkdown(x, opd.getDescription());}
|
||||
|
||||
if (opd.getSystem())
|
||||
x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_URLS, opd.getCode()));
|
||||
for (Enumeration<VersionIndependentResourceTypesAll> c : opd.getResource()) {
|
||||
if (opd.getType())
|
||||
x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_URL, c.getCode()+"/$"+opd.getCode()));
|
||||
if (opd.getInstance())
|
||||
x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_URL, c.getCode()+"/[id]/$"+opd.getCode()));
|
||||
}
|
||||
|
||||
if (opd.hasInputProfile()) {
|
||||
XhtmlNode p = x.para();
|
||||
p.tx(context.formatPhrase(RenderingContext.OP_DEF_INPAR));
|
||||
StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, opd.getInputProfile(), opd);
|
||||
if (sd == null) {
|
||||
p.pre().tx(opd.getInputProfile());
|
||||
} else {
|
||||
p.ah(sd.getWebPath()).tx(sd.present());
|
||||
}
|
||||
}
|
||||
if (opd.hasOutputProfile()) {
|
||||
XhtmlNode p = x.para();
|
||||
p.tx(context.formatPhrase(RenderingContext.OP_DEF_OUTPAR));
|
||||
StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, opd.getOutputProfile(), opd);
|
||||
if (sd == null) {
|
||||
p.pre().tx(opd.getOutputProfile());
|
||||
} else {
|
||||
p.ah(sd.getWebPath()).tx(sd.present());
|
||||
}
|
||||
}
|
||||
x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_PAR));
|
||||
XhtmlNode tbl = x.table( "grid");
|
||||
XhtmlNode tr = tbl.tr();
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_USE));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_NAME));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_SCO));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_CARD));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_TYPE));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_BIND));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_DOC));
|
||||
for (OperationDefinitionParameterComponent p : opd.getParameter()) {
|
||||
genOpParam(tbl, "", p, opd);
|
||||
}
|
||||
addMarkdown(x, opd.getComment());
|
||||
return true;
|
||||
}
|
||||
|
||||
public void describe(XhtmlNode x, OperationDefinition opd) {
|
||||
x.tx(display(opd));
|
||||
}
|
||||
|
||||
public String display(OperationDefinition opd) {
|
||||
return opd.present();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(Resource r) throws UnsupportedEncodingException, IOException {
|
||||
return ((OperationDefinition) r).present();
|
||||
}
|
||||
|
||||
private void genOpParam(XhtmlNode tbl, String path, OperationDefinitionParameterComponent p, Resource opd) throws EOperationOutcome, FHIRException, IOException {
|
||||
XhtmlNode tr;
|
||||
tr = tbl.tr();
|
||||
tr.td().addText(p.getUse().toString());
|
||||
XhtmlNode td = tr.td();
|
||||
td.addText(path+p.getName());
|
||||
StandardsStatus ss = ToolingExtensions.getStandardsStatus(p);
|
||||
genStandardsStatus(td, ss);
|
||||
td = tr.td();
|
||||
if (p.hasScope()) {
|
||||
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
|
||||
for (Enumeration<OperationParameterScope> s : p.getScope()) {
|
||||
b.append(s.getCode());
|
||||
}
|
||||
td.tx(b.toString());
|
||||
}
|
||||
tr.td().addText(Integer.toString(p.getMin())+".."+p.getMax());
|
||||
td = tr.td();
|
||||
String actualType = translateTypeToVersion(p.getTypeElement());
|
||||
StructureDefinition sd = actualType != null ? context.getWorker().fetchTypeDefinition(actualType) : null;
|
||||
if (sd == null)
|
||||
td.tx(p.hasType() ? actualType : "");
|
||||
else if (sd.getAbstract() && p.hasExtension(ToolingExtensions.EXT_ALLOWED_TYPE)) {
|
||||
boolean first = true;
|
||||
for (Extension ex : p.getExtensionsByUrl(ToolingExtensions.EXT_ALLOWED_TYPE)) {
|
||||
if (first) first = false; else td.tx(" | ");
|
||||
String s = ex.getValue().primitiveValue();
|
||||
StructureDefinition sdt = context.getWorker().fetchTypeDefinition(s);
|
||||
if (sdt == null)
|
||||
td.tx(p.hasType() ? actualType : "");
|
||||
else
|
||||
td.ah(sdt.getWebPath()).tx(s);
|
||||
}
|
||||
} else
|
||||
td.ah(sd.getWebPath()).tx(actualType);
|
||||
if (p.hasTargetProfile()) {
|
||||
td.tx(" (");
|
||||
boolean first = true;
|
||||
for (CanonicalType tp : p.getTargetProfile()) {
|
||||
if (first) { first = false;} else {td.tx(", ");};
|
||||
StructureDefinition sdt = context.getWorker().fetchTypeDefinition(tp.asStringValue());
|
||||
if (sdt == null || !sdt.hasWebPath()) {
|
||||
td.code().tx(tp.asStringValue());
|
||||
} else {
|
||||
td.ah(sdt.getWebPath(), tp.asStringValue()).tx(sdt.present());
|
||||
}
|
||||
}
|
||||
td.tx(")");
|
||||
}
|
||||
if (p.hasSearchType()) {
|
||||
td.br();
|
||||
td.tx("(");
|
||||
td.ah( context.getLink(KnownLinkType.SPEC) == null ? "search.html#"+p.getSearchType().toCode() : Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "search.html#"+p.getSearchType().toCode())).tx(p.getSearchType().toCode());
|
||||
td.tx(")");
|
||||
}
|
||||
td = tr.td();
|
||||
if (p.hasBinding() && p.getBinding().hasValueSet()) {
|
||||
AddVsRef(p.getBinding().getValueSet(), td, opd);
|
||||
td.tx(" ("+p.getBinding().getStrength().getDisplay()+")");
|
||||
}
|
||||
addMarkdown(tr.td(), p.getDocumentation());
|
||||
if (!p.hasType()) {
|
||||
for (OperationDefinitionParameterComponent pp : p.getPart()) {
|
||||
genOpParam(tbl, path+p.getName()+".", pp, opd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final String EXT_OPDEF_ORIGINAL_TYPE = "http://hl7.org/fhir/4.0/StructureDefinition/extension-OperationDefinition.parameter.type";
|
||||
|
||||
private String translateTypeToVersion(Enumeration<FHIRTypes> src) {
|
||||
if (src.hasExtension(EXT_OPDEF_ORIGINAL_TYPE)) {
|
||||
return src.getExtensionString(EXT_OPDEF_ORIGINAL_TYPE);
|
||||
} else {
|
||||
return src.asStringValue();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,105 +1,105 @@
|
|||
package org.hl7.fhir.r5.renderers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import org.hl7.fhir.exceptions.DefinitionException;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r5.model.Extension;
|
||||
import org.hl7.fhir.r5.model.ExtensionHelper;
|
||||
import org.hl7.fhir.r5.model.OperationOutcome;
|
||||
import org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity;
|
||||
import org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent;
|
||||
import org.hl7.fhir.r5.model.Resource;
|
||||
import org.hl7.fhir.r5.model.StringType;
|
||||
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.ResourceWrapper;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext;
|
||||
import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceContext;
|
||||
import org.hl7.fhir.r5.utils.ToolingExtensions;
|
||||
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
|
||||
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
|
||||
|
||||
public class OperationOutcomeRenderer extends ResourceRenderer {
|
||||
|
||||
public OperationOutcomeRenderer(RenderingContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public OperationOutcomeRenderer(RenderingContext context, ResourceContext rcontext) {
|
||||
super(context, rcontext);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, Resource dr) throws FHIRFormatError, DefinitionException, IOException {
|
||||
return render(x, (OperationOutcome) dr);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, OperationOutcome op) throws FHIRFormatError, DefinitionException, IOException {
|
||||
boolean hasSource = false;
|
||||
boolean success = true;
|
||||
for (OperationOutcomeIssueComponent i : op.getIssue()) {
|
||||
success = success && i.getSeverity() == IssueSeverity.INFORMATION;
|
||||
hasSource = hasSource || ExtensionHelper.hasExtension(i, ToolingExtensions.EXT_ISSUE_SOURCE);
|
||||
}
|
||||
if (success)
|
||||
x.para().tx(context.formatPhrase(RenderingContext.OP_OUT_OK));
|
||||
if (op.getIssue().size() > 0) {
|
||||
XhtmlNode tbl = x.table("grid"); // on the basis that we'll most likely be rendered using the standard fhir css, but it doesn't really matter
|
||||
XhtmlNode tr = tbl.tr();
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_SEV));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_LOC));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_DET));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_DIAG));
|
||||
if (hasSource)
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_SRC));
|
||||
for (OperationOutcomeIssueComponent i : op.getIssue()) {
|
||||
tr = tbl.tr();
|
||||
tr.td().addText(i.getSeverity().toString());
|
||||
XhtmlNode td = tr.td();
|
||||
boolean d = false;
|
||||
for (StringType s : i.hasExpression() ? i.getExpression() : i.getLocation()) {
|
||||
if (d)
|
||||
td.tx(", ");
|
||||
else
|
||||
d = true;
|
||||
td.addText(s.getValue());
|
||||
}
|
||||
tr.td().addText(i.getCode().getDisplay());
|
||||
tr.td().addText(display(i.getDetails()));
|
||||
smartAddText(tr.td(), i.getDiagnostics());
|
||||
if (hasSource) {
|
||||
Extension ext = ExtensionHelper.getExtension(i, ToolingExtensions.EXT_ISSUE_SOURCE);
|
||||
tr.td().addText(ext == null ? "" : display(ext));
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public void describe(XhtmlNode x, OperationOutcome oo) {
|
||||
x.tx(display(oo));
|
||||
}
|
||||
|
||||
public String display(OperationOutcome oo) {
|
||||
return (context.formatPhrase(RenderingContext.OP_OUT_TODO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException {
|
||||
return (context.formatPhrase(RenderingContext.OP_OUT_NOT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(Resource r) throws UnsupportedEncodingException, IOException {
|
||||
return display((OperationOutcome) r);
|
||||
}
|
||||
|
||||
public static String toString(OperationOutcome oo) {
|
||||
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
|
||||
for (OperationOutcomeIssueComponent issue : oo.getIssue()) {
|
||||
b.append(issue.getSeverity().toCode()+": "+issue.getDetails().getText());
|
||||
}
|
||||
return b.toString();
|
||||
}
|
||||
}
|
||||
package org.hl7.fhir.r5.renderers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import org.hl7.fhir.exceptions.DefinitionException;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r5.model.Extension;
|
||||
import org.hl7.fhir.r5.model.ExtensionHelper;
|
||||
import org.hl7.fhir.r5.model.OperationOutcome;
|
||||
import org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity;
|
||||
import org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent;
|
||||
import org.hl7.fhir.r5.model.Resource;
|
||||
import org.hl7.fhir.r5.model.StringType;
|
||||
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.ResourceWrapper;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext;
|
||||
import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceContext;
|
||||
import org.hl7.fhir.r5.utils.ToolingExtensions;
|
||||
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
|
||||
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
|
||||
|
||||
public class OperationOutcomeRenderer extends ResourceRenderer {
|
||||
|
||||
public OperationOutcomeRenderer(RenderingContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public OperationOutcomeRenderer(RenderingContext context, ResourceContext rcontext) {
|
||||
super(context, rcontext);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, Resource dr) throws FHIRFormatError, DefinitionException, IOException {
|
||||
return render(x, (OperationOutcome) dr);
|
||||
}
|
||||
|
||||
public boolean render(XhtmlNode x, OperationOutcome op) throws FHIRFormatError, DefinitionException, IOException {
|
||||
boolean hasSource = false;
|
||||
boolean success = true;
|
||||
for (OperationOutcomeIssueComponent i : op.getIssue()) {
|
||||
success = success && i.getSeverity() == IssueSeverity.INFORMATION;
|
||||
hasSource = hasSource || ExtensionHelper.hasExtension(i, ToolingExtensions.EXT_ISSUE_SOURCE);
|
||||
}
|
||||
if (success)
|
||||
x.para().tx(context.formatPhrase(RenderingContext.OP_OUT_OK));
|
||||
if (op.getIssue().size() > 0) {
|
||||
XhtmlNode tbl = x.table("grid"); // on the basis that we'll most likely be rendered using the standard fhir css, but it doesn't really matter
|
||||
XhtmlNode tr = tbl.tr();
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_SEV));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_LOC));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_CODE));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_DET));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_DIAG));
|
||||
if (hasSource)
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_SRC));
|
||||
for (OperationOutcomeIssueComponent i : op.getIssue()) {
|
||||
tr = tbl.tr();
|
||||
tr.td().addText(i.getSeverity().toString());
|
||||
XhtmlNode td = tr.td();
|
||||
boolean d = false;
|
||||
for (StringType s : i.hasExpression() ? i.getExpression() : i.getLocation()) {
|
||||
if (d)
|
||||
td.tx(", ");
|
||||
else
|
||||
d = true;
|
||||
td.addText(s.getValue());
|
||||
}
|
||||
tr.td().addText(i.getCode().getDisplay());
|
||||
tr.td().addText(display(i.getDetails()));
|
||||
smartAddText(tr.td(), i.getDiagnostics());
|
||||
if (hasSource) {
|
||||
Extension ext = ExtensionHelper.getExtension(i, ToolingExtensions.EXT_ISSUE_SOURCE);
|
||||
tr.td().addText(ext == null ? "" : display(ext));
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public void describe(XhtmlNode x, OperationOutcome oo) {
|
||||
x.tx(display(oo));
|
||||
}
|
||||
|
||||
public String display(OperationOutcome oo) {
|
||||
return (context.formatPhrase(RenderingContext.OP_OUT_TODO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException {
|
||||
return (context.formatPhrase(RenderingContext.OP_OUT_NOT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(Resource r) throws UnsupportedEncodingException, IOException {
|
||||
return display((OperationOutcome) r);
|
||||
}
|
||||
|
||||
public static String toString(OperationOutcome oo) {
|
||||
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
|
||||
for (OperationOutcomeIssueComponent issue : oo.getIssue()) {
|
||||
b.append(issue.getSeverity().toCode()+": "+issue.getDetails().getText());
|
||||
}
|
||||
return b.toString();
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -211,7 +211,7 @@ public abstract class TerminologyRenderer extends ResourceRenderer {
|
|||
if (hasHierarchy) {
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.TERMINOLOGY_LVL));
|
||||
}
|
||||
tr.td().attribute("style", "white-space:nowrap").b().tx(formatPhrase(RenderingContext.GENERAL_CODE));
|
||||
tr.td().attribute("style", "white-space:nowrap").b().tx(formatPhrase(RenderingContext.TX_CODE));
|
||||
if (hasDisplay) {
|
||||
tr.td().b().tx(formatPhrase(RenderingContext.TX_DISPLAY));
|
||||
}
|
||||
|
@ -229,7 +229,13 @@ public abstract class TerminologyRenderer extends ResourceRenderer {
|
|||
}
|
||||
if (properties != null) {
|
||||
for (PropertyComponent pc : properties) {
|
||||
String display = getPropertyDisplay(pc);
|
||||
String display = ToolingExtensions.getPresentation(pc, pc.getCodeElement());
|
||||
if (display == null || display.equals(pc.getCode()) && pc.hasUri()) {
|
||||
display = getDisplayForProperty(pc.getUri());
|
||||
if (display == null) {
|
||||
display = pc.getCode();
|
||||
}
|
||||
}
|
||||
tr.td().b().tx(display);
|
||||
}
|
||||
}
|
||||
|
@ -248,17 +254,6 @@ public abstract class TerminologyRenderer extends ResourceRenderer {
|
|||
return tr;
|
||||
}
|
||||
|
||||
protected String getPropertyDisplay(PropertyComponent pc) {
|
||||
String display = ToolingExtensions.getPresentation(pc, pc.getCodeElement());
|
||||
if (display == null || display.equals(pc.getCode()) && pc.hasUri()) {
|
||||
display = getDisplayForProperty(pc.getUri());
|
||||
if (display == null) {
|
||||
display = pc.getCode();
|
||||
}
|
||||
}
|
||||
return display;
|
||||
}
|
||||
|
||||
|
||||
protected String getDisplayForProperty(String uri) {
|
||||
if (Utilities.noString(uri)){
|
||||
|
|
|
@ -208,7 +208,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
|
|||
if (vs.getExpansion().getContains().isEmpty()) {
|
||||
msg = context.formatPhrase(RenderingContext.VALUE_SET_TOO_COSTLY);
|
||||
} else {
|
||||
msg = context.formatPhrase(RenderingContext.GENERAL_CODE_SELEC, countMembership(vs));
|
||||
msg = context.formatPhrase(RenderingContext.VALUE_SET_CODE_SELEC, countMembership(vs));
|
||||
}
|
||||
x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px").addText(msg);
|
||||
} else {
|
||||
|
@ -216,9 +216,9 @@ public class ValueSetRenderer extends TerminologyRenderer {
|
|||
if (vs.getExpansion().hasTotal()) {
|
||||
if (count != vs.getExpansion().getTotal()) {
|
||||
x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px")
|
||||
.addText(context.formatPhrase(hasFragment ? RenderingContext.VALUE_SET_HAS_AT_LEAST : RenderingContext.VALUE_SET_HAS, vs.getExpansion().getTotal(), count));
|
||||
.addText(context.formatPhrase(hasFragment ? RenderingContext.VALUE_SET_HAS_AT_LEAST : RenderingContext.VALUE_SET_HAS, vs.getExpansion().getTotal()));
|
||||
} else {
|
||||
x.para().tx(context.formatPhrase(hasFragment ? RenderingContext.VALUE_SET_CONTAINS_AT_LEAST : RenderingContext.VALUE_SET_CONTAINS, vs.getExpansion().getTotal(), count));
|
||||
x.para().tx(context.formatPhrase(hasFragment ? RenderingContext.VALUE_SET_CONTAINS_AT_LEAST : RenderingContext.VALUE_SET_CONTAINS, vs.getExpansion().getTotal()));
|
||||
}
|
||||
} else if (count == 1000) {
|
||||
// it's possible that there's exactly 1000 codes, in which case wht we're about to do is wrong
|
||||
|
@ -245,7 +245,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
|
|||
XhtmlNode tr = t.tr();
|
||||
if (doLevel)
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_LEVEL));
|
||||
tr.td().attribute("style", "white-space:nowrap").b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE));
|
||||
tr.td().attribute("style", "white-space:nowrap").b().tx(context.formatPhrase(RenderingContext.VALUE_SET_CODE));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_SYSTEM));
|
||||
XhtmlNode tdDisp = tr.td();
|
||||
tdDisp.b().tx(context.formatPhrase(RenderingContext.VALUE_SET_DISPLAY));
|
||||
|
@ -294,7 +294,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
|
|||
if (!doDesignations && langs.size() + designations.size() > 0) {
|
||||
Collections.sort(langs);
|
||||
if (designations.size() == 0) {
|
||||
x.para().b().tx(context.formatPhrase(RenderingContext.GENERAL_ADD_LANG));
|
||||
x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_ADD_LANG));
|
||||
} else if (langs.size() == 0) {
|
||||
x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_DESIG));
|
||||
} else {
|
||||
|
@ -302,7 +302,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
|
|||
}
|
||||
t = x.table("codes");
|
||||
tr = t.tr();
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_CODE));
|
||||
for (String url : designations.keySet()) {
|
||||
tr.td().b().addText(designations.get(url));
|
||||
}
|
||||
|
@ -989,7 +989,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
|
|||
if (!doDesignations && langs.size() + designations.size() > 0) {
|
||||
Collections.sort(langs);
|
||||
if (designations.size() == 0) {
|
||||
x.para().b().tx(context.formatPhrase(RenderingContext.GENERAL_ADD_LANG));
|
||||
x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_ADD_LANG));
|
||||
} else if (langs.size() == 0) {
|
||||
x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_DESIG));
|
||||
} else {
|
||||
|
@ -997,7 +997,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
|
|||
}
|
||||
XhtmlNode t = x.table("codes");
|
||||
XhtmlNode tr = t.tr();
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE));
|
||||
tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_CODE));
|
||||
for (String url : designations.keySet()) {
|
||||
tr.td().b().addText(designations.get(url));
|
||||
}
|
||||
|
@ -1032,7 +1032,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
|
|||
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, context.getDestDir(), context.isInlineGraphics(), true);
|
||||
TableModel model = gen.new TableModel("exp.h="+index, context.getRules() == GenerationRules.IG_PUBLISHER);
|
||||
model.setAlternating(true);
|
||||
model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.GENERAL_CODE), context.formatPhrase(RenderingContext.GENERAL_CODE_ITEM), null, 0));
|
||||
model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.VALUE_SET_CODE), context.formatPhrase(RenderingContext.VALUE_SET_CODE_ITEM), null, 0));
|
||||
model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.VALUE_SET_DISPLAY), context.formatPhrase(RenderingContext.VALUE_SET_DISPLAY_ITEM), null, 0));
|
||||
|
||||
for (Extension ext : inc.getExtensionsByUrl(ToolingExtensions.EXT_EXPAND_GROUP)) {
|
||||
|
@ -1211,7 +1211,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
|
|||
}
|
||||
}
|
||||
if (inc.getFilter().size() > 0) {
|
||||
li.addText(type+" "+ context.formatPhrase(RenderingContext.GENERAL_CODES_FROM));
|
||||
li.addText(type+" "+ context.formatPhrase(RenderingContext.VALUE_SET_CODES_FROM));
|
||||
addCsRef(inc, li, e);
|
||||
li.tx(" "+ context.formatPhrase(RenderingContext.VALUE_SET_WHERE)+" ");
|
||||
for (int i = 0; i < inc.getFilter().size(); i++) {
|
||||
|
|
|
@ -17,7 +17,7 @@ public class I18nConstantMaintainer {
|
|||
rename("/Users/grahamegrieve/work/core", "OP_DEF_CARD", "GENERAL_CARDINALITY");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_CARD", "GENERAL_CARDINALITY");
|
||||
|
||||
// rename("/Users/grahamegrieve/work/core", "CODEPROP_CODE", "GENERAL_CODE");
|
||||
rename("/Users/grahamegrieve/work/core", "CODEPROP_CODE", "GENERAL_CODE");
|
||||
replace("/Users/grahamegrieve/work/core", "CODE_SYS_CODE", "GENERAL_CODE");
|
||||
replace("/Users/grahamegrieve/work/core", "CONC_MAP_CODE", "GENERAL_CODE");
|
||||
replace("/Users/grahamegrieve/work/core", "DATA_REND_CODE", "GENERAL_CODE");
|
||||
|
@ -28,12 +28,381 @@ public class I18nConstantMaintainer {
|
|||
replace("/Users/grahamegrieve/work/core", "VALUE_SET_CODE", "GENERAL_CODE");
|
||||
replace("/Users/grahamegrieve/work/core", "DATA_REND_GETCODE", "GENERAL_CODE");
|
||||
replace("/Users/grahamegrieve/work/core", "LIST_REND_CODE", "GENERAL_CODE");
|
||||
|
||||
// Comment
|
||||
rename("/Users/grahamegrieve/work/core", "CONC_MAP_CMNT", "GENERAL_COMMENT");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_COM", "GENERAL_COMMENT");
|
||||
|
||||
// Comments
|
||||
rename("/Users/grahamegrieve/work/core", "SD_COMP_HEAD_COMP", "GENERAL_COMMENTS");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_COMMENTS", "GENERAL_COMMENTS");
|
||||
replace("/Users/grahamegrieve/work/core", "TX_COMMENTS", "GENERAL_COMMENTS");
|
||||
|
||||
// Comparators
|
||||
rename("/Users/grahamegrieve/work/core", "SEARCH_PAR_COMP", "GENERAL_COMPARATORS");
|
||||
replace("/Users/grahamegrieve/work/core", "SUB_TOPIC_COMP", "GENERAL_COMPARATORS");
|
||||
|
||||
// Component
|
||||
rename("/Users/grahamegrieve/work/core", "ADD_BIND_COMPONENT", "GENERAL_COMPONENT");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_COMP", "GENERAL_COMPONENT");
|
||||
|
||||
// Conformance
|
||||
rename("/Users/grahamegrieve/work/core", "CAPABILITY_CONF", "GENERAL_CONFORMANCE");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_CONFORMANCE", "GENERAL_CONFORMANCE");
|
||||
|
||||
// Contact:
|
||||
rename("/Users/grahamegrieve/work/core", "PAT_NOK_CONTACT", "GENERAL_CONTACT");
|
||||
replace("/Users/grahamegrieve/work/core", "TEST_PLAN_CONT", "GENERAL_CONTACT");
|
||||
|
||||
// Content
|
||||
rename("/Users/grahamegrieve/work/core", "CODE_SYS_CONTENT", "GENERAL_CONTENT");
|
||||
replace("/Users/grahamegrieve/work/core", "EX_SCEN_CONT", "GENERAL_CONTENT");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_CONTENT", "GENERAL_CONTENT");
|
||||
replace("/Users/grahamegrieve/work/core", "TEST_PLAN_CONTENT", "GENERAL_CONTENT");
|
||||
|
||||
// Copyright
|
||||
rename("/Users/grahamegrieve/work/core", "CANON_REND_COPYRIGHT", "GENERAL_COPYRIGHT");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_COPY", "GENERAL_COPYRIGHT");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_COPYRIGHT", "GENERAL_COPYRIGHT");
|
||||
|
||||
// Criteria
|
||||
rename("/Users/grahamegrieve/work/core", "CAPABILITY_CRIT", "GENERAL_CRIT");
|
||||
replace("/Users/grahamegrieve/work/core", "SUB_TOPIC_CRITERIA", "GENERAL_CRIT");
|
||||
|
||||
// Defining URL
|
||||
rename("/Users/grahamegrieve/work/core", "CANON_REND_URL", "GENERAL_DEFINING_URL");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_URL", "GENERAL_DEFINING_URL");
|
||||
|
||||
// Definition
|
||||
rename("/Users/grahamegrieve/work/core", "CANON_REND_DEFINITION", "GENERAL_DEFINITION");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_DEF", "GENERAL_DEFINITION");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_DEFINITION", "GENERAL_DEFINITION");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_DEFINITION", "GENERAL_DEFINITION");
|
||||
replace("/Users/grahamegrieve/work/core", "TX_DEFINITION", "GENERAL_DEFINITION");
|
||||
replace("/Users/grahamegrieve/work/core", "VALUE_SET_DEF", "GENERAL_DEFINITION");
|
||||
|
||||
// Definition:
|
||||
rename("/Users/grahamegrieve/work/core", "QUEST_DEF", "GENERAL_DEFINITION_COLON");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_DEF", "GENERAL_DEFINITION_COLON");
|
||||
|
||||
// Deprecated
|
||||
rename("/Users/grahamegrieve/work/core", "CODESYSTEM_DEPRECATED", "CODESYSTEM_DEPRECATED");
|
||||
replace("/Users/grahamegrieve/work/core", "TX_DEPRECATED", "CODESYSTEM_DEPRECATED");
|
||||
|
||||
// Description
|
||||
rename("/Users/grahamegrieve/work/core", "CODESYSTEM_DESC", "GENERAL_DESC");
|
||||
replace("/Users/grahamegrieve/work/core", "CODESYSTEM_PROP_DESC", "GENERAL_DESC");
|
||||
replace("/Users/grahamegrieve/work/core", "EX_SCEN_DESC", "GENERAL_DESC");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_DESCRIPTION", "GENERAL_DESC");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_DESC", "GENERAL_DESC");
|
||||
replace("/Users/grahamegrieve/work/core", "SUB_TOPIC_DESC", "GENERAL_DESC");
|
||||
|
||||
// Description & Constraints
|
||||
rename("/Users/grahamegrieve/work/core", "QUEST_DESC", "GENERAL_DESC_CONST");
|
||||
replace("/Users/grahamegrieve/work/core", "SD_HEAD_DESC", "GENERAL_DESC_CONST");
|
||||
|
||||
// Details
|
||||
rename("/Users/grahamegrieve/work/core", "OP_OUT_DET", "GENERAL_DETAILS");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_DETAILS", "GENERAL_DETAILS");
|
||||
|
||||
// Display
|
||||
rename("/Users/grahamegrieve/work/core", "TX_DISPLAY", "TX_DISPLAY");
|
||||
replace("/Users/grahamegrieve/work/core", "VALUE_SET_DISPLAY", "TX_DISPLAY");
|
||||
|
||||
// Documentation
|
||||
rename("/Users/grahamegrieve/work/core", "ADD_BIND_DOC", "GENERAL_DOCUMENTATION");
|
||||
replace("/Users/grahamegrieve/work/core", "CAPABILITY_DOC", "GENERAL_DOCUMENTATION");
|
||||
replace("/Users/grahamegrieve/work/core", "OBLIG_DOC", "GENERAL_DOCUMENTATION");
|
||||
replace("/Users/grahamegrieve/work/core", "OP_DEF_DOC", "GENERAL_DOCUMENTATION");
|
||||
|
||||
// Example
|
||||
rename("/Users/grahamegrieve/work/core", "STRUC_DEF_EX", "GENERAL_EXAMPLE");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_EXAMPLE", "GENERAL_EXAMPLE");
|
||||
|
||||
// Experimental
|
||||
rename("/Users/grahamegrieve/work/core", "QUEST_EXPER", "GENERAL_EXPER");
|
||||
replace("/Users/grahamegrieve/work/core", "RES_REND_EXP", "GENERAL_EXPER");
|
||||
|
||||
// Filter
|
||||
rename("/Users/grahamegrieve/work/core", "DATA_REND_FILT", "GENERAL_FILTER");
|
||||
replace("/Users/grahamegrieve/work/core", "OBLIG_FILT", "GENERAL_FILTER");
|
||||
|
||||
// Flags
|
||||
rename("/Users/grahamegrieve/work/core", "DIAG_REP_REND_FLAG", "GENERAL_FLAGS");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_FLAG", "GENERAL_FLAGS");
|
||||
replace("/Users/grahamegrieve/work/core", "SD_HEAD_FLAGS", "GENERAL_FLAGS");
|
||||
|
||||
// Id is required to be present (this is the default for resources but not elements)
|
||||
rename("/Users/grahamegrieve/work/core", "STRUC_DEF_ID_MAY", "STRUC_DEF_ID_MAY");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_ID_REQ", "STRUC_DEF_ID_MAY");
|
||||
|
||||
// Instances of this logical model are not marked to be the target of a Reference
|
||||
rename("/Users/grahamegrieve/work/core", "STRUC_DEF_NOT_MARK", "STRUC_DEF_NOT_MARK");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_NOT_MARKED", "STRUC_DEF_NOT_MARK");
|
||||
|
||||
// Instances of this logical model can be the target of a Reference
|
||||
rename("/Users/grahamegrieve/work/core", "STRUC_DEF_CAN_TARGET", "STRUC_DEF_CAN_TARGET");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_REF", "STRUC_DEF_CAN_TARGET");
|
||||
|
||||
// Instances of this type are validated using an unknown approach: {0}
|
||||
rename("/Users/grahamegrieve/work/core", "STRUC_DEF_UNKNOWN_APPROACH", "STRUC_DEF_UNKNOWN_APPROACH");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_VALID_UNKNOWN", "STRUC_DEF_UNKNOWN_APPROACH");
|
||||
|
||||
// Location
|
||||
rename("/Users/grahamegrieve/work/core", "OP_OUT_LOC", "GENERAL_LOCATION");
|
||||
replace("/Users/grahamegrieve/work/core", "PROV_LOC", "GENERAL_LOCATION");
|
||||
|
||||
// Logical Container
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_LOGIC", "STRUC_DEF_LOGICAL_CONT");
|
||||
|
||||
// Maturity
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_MATURITY", "CANON_REND_MATURITY");
|
||||
|
||||
// Max Length:
|
||||
rename("/Users/grahamegrieve/work/core", "QUEST_MAX", "GENERAL_MAX_LENGTH");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_MAX_LENGTH", "GENERAL_MAX_LENGTH");
|
||||
|
||||
// Modifiers
|
||||
rename("/Users/grahamegrieve/work/core", "SEARCH_PAR_MOD", "GENERAL_MODIFIERS");
|
||||
replace("/Users/grahamegrieve/work/core", "SUB_TOPIC_MOD", "GENERAL_MODIFIERS");
|
||||
|
||||
// Name
|
||||
rename("/Users/grahamegrieve/work/core", "CANON_REND_NAME", "GENERAL_NAME");
|
||||
replace("/Users/grahamegrieve/work/core", "CODESYSTEM_PROP_NAME", "GENERAL_NAME");
|
||||
replace("/Users/grahamegrieve/work/core", "DATA_REND_NAME", "GENERAL_NAME");
|
||||
replace("/Users/grahamegrieve/work/core", "EX_SCEN_NAME", "GENERAL_NAME");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_NAME", "GENERAL_NAME");
|
||||
replace("/Users/grahamegrieve/work/core", "OP_DEF_NAME", "GENERAL_NAME");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_NAME", "GENERAL_NAME");
|
||||
replace("/Users/grahamegrieve/work/core", "SD_COMP_HEAD_NAME", "GENERAL_NAME");
|
||||
replace("/Users/grahamegrieve/work/core", "SD_GRID_HEAD_NAME", "GENERAL_NAME");
|
||||
replace("/Users/grahamegrieve/work/core", "SD_HEAD_NAME", "GENERAL_NAME");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_NAME", "GENERAL_NAME");
|
||||
|
||||
// Not done yet
|
||||
rename("/Users/grahamegrieve/work/core", "DIAG_REP_REND_NOTDONE", "GENERAL_TODO");
|
||||
replace("/Users/grahamegrieve/work/core", "OP_OUT_NOT", "GENERAL_TODO");
|
||||
replace("/Users/grahamegrieve/work/core", "PROV_NOT", "GENERAL_TODO");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_NOT_DONE", "GENERAL_TODO");
|
||||
|
||||
// Note
|
||||
rename("/Users/grahamegrieve/work/core", "DIAG_REP_REND_NOTE", "GENERAL_NOTE");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_NOTE_C", "GENERAL_NOTE");
|
||||
|
||||
// OID
|
||||
rename("/Users/grahamegrieve/work/core", "CODE_SYS_OID", "GENERAL_OID");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_OID", "GENERAL_OID");
|
||||
replace("/Users/grahamegrieve/work/core", "VALUE_SET_OID", "GENERAL_OID");
|
||||
|
||||
// Obligations
|
||||
rename("/Users/grahamegrieve/work/core", "OBLIG_OBLIG", "GENERAL_OBLIG");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_OBLIGATIONS", "GENERAL_OBLIG");
|
||||
|
||||
// Parameter
|
||||
rename("/Users/grahamegrieve/work/core", "CAPABILITY_PAR", "GENERAL_PAR");
|
||||
replace("/Users/grahamegrieve/work/core", "SEARCH_PAR_PAR", "GENERAL_PAR");
|
||||
|
||||
// Parameters
|
||||
rename("/Users/grahamegrieve/work/core", "CAPABILITY_PARS", "GENERAL_PARS");
|
||||
replace("/Users/grahamegrieve/work/core", "LIB_REND_PARA", "GENERAL_PARS");
|
||||
replace("/Users/grahamegrieve/work/core", "OP_DEF_PAR", "GENERAL_PARS");
|
||||
replace("/Users/grahamegrieve/work/core", "PAR_REND_PAR", "GENERAL_PARS");
|
||||
|
||||
// Preferred
|
||||
rename("/Users/grahamegrieve/work/core", "ADD_BIND_PREFERRED", "GENERAL_PREFERRED");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_PREF", "GENERAL_PREFERRED");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_PREF", "GENERAL_PREFERRED");
|
||||
|
||||
// Profile
|
||||
rename("/Users/grahamegrieve/work/core", "CAPABILITY_PROF", "GENERAL_PROF");
|
||||
replace("/Users/grahamegrieve/work/core", "RES_REND_PROF", "GENERAL_PROF");
|
||||
replace("/Users/grahamegrieve/work/core", "RES_REND_PROFILE", "GENERAL_PROF");
|
||||
replace("/Users/grahamegrieve/work/core", "TEXT_ICON_PROFILE", "GENERAL_PROF");
|
||||
|
||||
// Properties
|
||||
rename("/Users/grahamegrieve/work/core", "CODESYSTEM_PROPS", "GENERAL_PROPS");
|
||||
replace("/Users/grahamegrieve/work/core", "CONC_MAP_PROP", "GENERAL_PROPS");
|
||||
|
||||
// Publisher
|
||||
rename("/Users/grahamegrieve/work/core", "CANON_REND_PUBLISHER", "CANON_REND_PUBLISHER");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_PUB", "CANON_REND_PUBLISHER");
|
||||
|
||||
// Purpose
|
||||
rename("/Users/grahamegrieve/work/core", "ADD_BIND_PUR", "GENERAL_PURPOSE");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_PURPOSE", "GENERAL_PURPOSE");
|
||||
|
||||
// Reference to the type of the element
|
||||
replace("/Users/grahamegrieve/work/core", "SD_HEAD_TYPE_DESC", "SD_GRID_HEAD_TYPE_DESC");
|
||||
|
||||
// References:
|
||||
rename("/Users/grahamegrieve/work/core", "ACTOR_DEF_REF", "GENERAL_REFS");
|
||||
replace("/Users/grahamegrieve/work/core", "REQ_REFERENCES", "GENERAL_REFS");
|
||||
|
||||
// Request
|
||||
rename("/Users/grahamegrieve/work/core", "DIAG_REP_REND_REQUEST", "GENERAL_REQUEST");
|
||||
replace("/Users/grahamegrieve/work/core", "EX_SCEN_REQ", "GENERAL_REQUEST");
|
||||
|
||||
// Required
|
||||
rename("/Users/grahamegrieve/work/core", "ADD_BIND_REQUIRED", "GENERAL_REQUIRED");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_REQ", "GENERAL_REQUIRED");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_REQ", "GENERAL_REQUIRED");
|
||||
|
||||
// Resource
|
||||
rename("/Users/grahamegrieve/work/core", "RES_REND_RESOURCE", "GENERAL_RESOURCE");
|
||||
replace("/Users/grahamegrieve/work/core", "SEARCH_PAR_REND_RES", "GENERAL_RESOURCE");
|
||||
replace("/Users/grahamegrieve/work/core", "SUB_TOPIC_RES", "GENERAL_RESOURCE");
|
||||
replace("/Users/grahamegrieve/work/core", "TEXT_ICON_RESOURCE", "GENERAL_RESOURCE");
|
||||
|
||||
// SNOMED-CT
|
||||
rename("/Users/grahamegrieve/work/core", "STRUC_DEF_SNOMED_CT", "GENERAL_SNOMED_CT");
|
||||
replace("/Users/grahamegrieve/work/core", "TERMINOLOGY_SNOMED", "GENERAL_SNOMED_CT");
|
||||
|
||||
// Security Label
|
||||
rename("/Users/grahamegrieve/work/core", "RES_REND_SECURITY", "GENERAL_SECURITY_LABEL");
|
||||
replace("/Users/grahamegrieve/work/core", "RES_REND_SECURITY_LABEL", "GENERAL_SECURITY_LABEL");
|
||||
|
||||
// Source:
|
||||
rename("/Users/grahamegrieve/work/core", "LIST_REND_SRC", "GENERAL_SRC");
|
||||
replace("/Users/grahamegrieve/work/core", "REQ_SOURCES", "GENERAL_SRC");
|
||||
|
||||
// Starter
|
||||
rename("/Users/grahamegrieve/work/core", "ADD_BIND_STARTER", "GENERAL_STARTER");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_START", "GENERAL_STARTER");
|
||||
|
||||
// Status
|
||||
rename("/Users/grahamegrieve/work/core", "CANON_REND_STATUS", "GENERAL_STATUS");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_STAT", "GENERAL_STATUS");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_STATUS", "GENERAL_STATUS");
|
||||
|
||||
// Subject
|
||||
rename("/Users/grahamegrieve/work/core", "DATA_REND_SUB", "GENERAL_SUBJ");
|
||||
replace("/Users/grahamegrieve/work/core", "DIAG_REP_REND_SUB", "GENERAL_SUBJ");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_SUB", "GENERAL_SUBJ");
|
||||
|
||||
// Summary
|
||||
rename("/Users/grahamegrieve/work/core", "CAPABILITY_SUMM", "GENERAL_SUMM");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_SUM", "GENERAL_SUMM");
|
||||
replace("/Users/grahamegrieve/work/core", "PROV_SUM", "GENERAL_SUMM");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_SUMMARY", "GENERAL_SUMM");
|
||||
|
||||
// The logical name of the element
|
||||
rename("/Users/grahamegrieve/work/core", "SD_COMP_HEAD_NAME_DESC", "GENERAL_LOGICAL_NAME");
|
||||
replace("/Users/grahamegrieve/work/core", "SD_HEAD_NAME_DESC", "GENERAL_LOGICAL_NAME");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_LOGIC_NAME", "GENERAL_LOGICAL_NAME");
|
||||
|
||||
// The minimum allowable value set - any conformant system SHALL support all these codes
|
||||
rename("/Users/grahamegrieve/work/core", "ADD_BIND_MIN_ALLOW", "GENERAL_BIND_MIN_ALLOW");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_MIN_ALLOW", "GENERAL_BIND_MIN_ALLOW");
|
||||
|
||||
// This content has been removed since {0}
|
||||
rename("/Users/grahamegrieve/work/core", "REND_ROW_REMOVED_SINCE", "GENERAL_REMOVED_SINCE");
|
||||
replace("/Users/grahamegrieve/work/core", "REND_SINCE_DELETED", "GENERAL_REMOVED_SINCE");
|
||||
|
||||
// This element can be extended by named JSON elements
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_JSON_ELE", "STRUC_DEF_EXT_JSON");
|
||||
|
||||
// This element is a modifier element
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_MOD_ELEMENT", "STRUC_DEF_MOD");
|
||||
|
||||
// This element is included in summaries
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_SUMM", "STRUC_DEF_ELE_INCLUDED");
|
||||
|
||||
// This element must be supported
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_SUPP", "STRUC_DEF_ELE_MUST_SUPP");
|
||||
|
||||
// This is a repeating choice group that does not appear directly in the instance
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_REP_CHOICE", "STRUC_DEF_REPEAT");
|
||||
|
||||
// This value set is a good set of codes to start with when designing your system
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_START_DEF", "ADD_BIND_DESIG_SYS");
|
||||
|
||||
// Title
|
||||
rename("/Users/grahamegrieve/work/core", "CANON_REND_TITLE", "GENERAL_TITLE");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_TITLE", "GENERAL_TITLE");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_TITLE", "GENERAL_TITLE");
|
||||
|
||||
// Type
|
||||
rename("/Users/grahamegrieve/work/core", "CAPABILITY_TYP", "GENERAL_TYPE");
|
||||
replace("/Users/grahamegrieve/work/core", "CODESYSTEM_PROP_TYPE", "GENERAL_TYPE");
|
||||
replace("/Users/grahamegrieve/work/core", "DATA_REND_TYPE", "GENERAL_TYPE");
|
||||
replace("/Users/grahamegrieve/work/core", "EX_SCEN_TYPE", "GENERAL_TYPE");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_TYPE", "GENERAL_TYPE");
|
||||
replace("/Users/grahamegrieve/work/core", "OP_DEF_TYPE", "GENERAL_TYPE");
|
||||
replace("/Users/grahamegrieve/work/core", "PROV_TYPE", "GENERAL_TYPE");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_TYPE", "GENERAL_TYPE");
|
||||
replace("/Users/grahamegrieve/work/core", "SD_GRID_HEAD_TYPE", "GENERAL_TYPE");
|
||||
replace("/Users/grahamegrieve/work/core", "SD_HEAD_TYPE", "GENERAL_TYPE");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_TYPE", "GENERAL_TYPE");
|
||||
replace("/Users/grahamegrieve/work/core", "TEST_PLAN_TYPE", "GENERAL_TYPE");
|
||||
|
||||
// UCUM
|
||||
rename("/Users/grahamegrieve/work/core", "DATA_REND_UCUM", "GENERAL_UCUM");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_UCUM", "GENERAL_UCUM");
|
||||
|
||||
// URI
|
||||
rename("/Users/grahamegrieve/work/core", "CODESYSTEM_PROP_URI", "GENERAL_URI");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_URI", "GENERAL_URI");
|
||||
|
||||
// URL
|
||||
rename("/Users/grahamegrieve/work/core", "QUEST_URL", "GENERAL_URL");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_URL", "GENERAL_URL");
|
||||
|
||||
// Usage
|
||||
rename("/Users/grahamegrieve/work/core", "ADD_BIND_USE", "GENERAL_USAGE");
|
||||
replace("/Users/grahamegrieve/work/core", "OBLIG_USE", "GENERAL_USAGE");
|
||||
|
||||
// Value
|
||||
rename("/Users/grahamegrieve/work/core", "CODESYSTEM_FILTER_VALUE", "GENERAL_VALUE");
|
||||
replace("/Users/grahamegrieve/work/core", "DATA_REND_VALUE", "GENERAL_VALUE");
|
||||
replace("/Users/grahamegrieve/work/core", "DIAG_REP_REND_VALUE", "GENERAL_VALUE");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_VALUE", "GENERAL_VALUE");
|
||||
|
||||
// Value Set
|
||||
rename("/Users/grahamegrieve/work/core", "CODE_SYS_VALUE_SET", "GENERAL_VALUESET");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_VALUE_SET", "GENERAL_VALUESET");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_VALUE", "GENERAL_VALUESET");
|
||||
|
||||
// Version
|
||||
rename("/Users/grahamegrieve/work/core", "CANON_REND_VER", "GENERAL_VER");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_VER", "GENERAL_VER");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_VERSION", "GENERAL_VER");
|
||||
replace("/Users/grahamegrieve/work/core", "RES_REND_VERSION", "GENERAL_VER");
|
||||
replace("/Users/grahamegrieve/work/core", "TX_VERSION", "GENERAL_VER");
|
||||
|
||||
// XML
|
||||
rename("/Users/grahamegrieve/work/core", "CANON_REND_XML", "GENERAL_XML");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_XML", "GENERAL_XML");
|
||||
|
||||
// for OID based terminology systems
|
||||
rename("/Users/grahamegrieve/work/core", "CODE_SYS_FOR_OID", "CODE_SYS_FOR_OID");
|
||||
replace("/Users/grahamegrieve/work/core", "NAME_SYS_FOROID", "CODE_SYS_FOR_OID");
|
||||
replace("/Users/grahamegrieve/work/core", "VALUE_SET_OID_TERM_SYS", "CODE_SYS_FOR_OID");
|
||||
|
||||
// is prefixed to the value before validation
|
||||
rename("/Users/grahamegrieve/work/core", "STRUC_DEF_PREFIXED", "STRUC_DEF_PREFIXED");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_PREFIX_VALID", "STRUC_DEF_PREFIXED");
|
||||
|
||||
// todo
|
||||
replace("/Users/grahamegrieve/work/core", "OP_OUT_TODO", "GENERAL_TODO");
|
||||
replace("/Users/grahamegrieve/work/core", "QUEST_TODO", "GENERAL_TODO");
|
||||
replace("/Users/grahamegrieve/work/core", "RES_REND_TODO", "GENERAL_TODO");
|
||||
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_TODO", "GENERAL_TODO");
|
||||
|
||||
// version
|
||||
rename("/Users/grahamegrieve/work/core", "EX_SCEN_VER", "GENERAL_VER_LOW");
|
||||
replace("/Users/grahamegrieve/work/core", "VALUE_SET_VERSION", "GENERAL_VER_LOW");
|
||||
|
||||
// {0}, {1} by {2}
|
||||
rename("/Users/grahamegrieve/work/core", "SD_SLICING_INFO", "SD_SLICING_INFO");
|
||||
replace("/Users/grahamegrieve/work/core", "SD_SUMMARY_INFO", "SD_SLICING_INFO");
|
||||
}
|
||||
|
||||
private static void replace(String dir, String src, String tgt) throws FileNotFoundException, IOException {
|
||||
System.out.println("Replace "+src+" with "+tgt+" in "+dir);
|
||||
int count = replace(new File(dir), src, tgt);
|
||||
System.out.println("Done. "+count+" files changed");
|
||||
if (!src.equals(tgt)) {
|
||||
System.out.println("Replace "+src+" with "+tgt+" in "+dir);
|
||||
int count = replace(new File(dir), src, tgt);
|
||||
System.out.println("Done. "+count+" files changed");
|
||||
}
|
||||
}
|
||||
|
||||
private static int replace(File file, String src, String tgt) throws FileNotFoundException, IOException {
|
||||
|
@ -47,18 +416,34 @@ public class I18nConstantMaintainer {
|
|||
if ("java".equals(ext)) {
|
||||
String source = TextFile.fileToString(file);
|
||||
boolean mod = false;
|
||||
if (source.contains("I18nConstants."+src)) {
|
||||
source = source.replace("I18nConstants."+src, "I18nConstants."+tgt);
|
||||
if (source.contains("I18nConstants."+src+",")) {
|
||||
source = source.replace("I18nConstants."+src+",", "I18nConstants."+tgt+",");
|
||||
mod = true;
|
||||
}
|
||||
if (source.contains("RenderingI18nContext."+src)) {
|
||||
source = source.replace("RenderingI18nContext."+src, "RenderingI18nContext."+tgt);
|
||||
if (source.contains("I18nConstants."+src+")")) {
|
||||
source = source.replace("I18nConstants."+src+")", "I18nConstants."+tgt+")");
|
||||
mod = true;
|
||||
}
|
||||
if (source.contains("RenderingContext."+src)) {
|
||||
source = source.replace("RenderingContext."+src, "RenderingContext."+tgt);
|
||||
|
||||
if (source.contains("RenderingI18nContext."+src+",")) {
|
||||
source = source.replace("RenderingI18nContext."+src+",", "RenderingI18nContext."+tgt+",");
|
||||
mod = true;
|
||||
}
|
||||
if (source.contains("RenderingI18nContext."+src+")")) {
|
||||
source = source.replace("RenderingI18nContext."+src+")", "RenderingI18nContext."+tgt+")");
|
||||
mod = true;
|
||||
}
|
||||
|
||||
if (source.contains("RenderingContext."+src+",")) {
|
||||
source = source.replace("RenderingContext."+src+",", "RenderingContext."+tgt+",");
|
||||
mod = true;
|
||||
}
|
||||
|
||||
if (source.contains("RenderingContext."+src+")")) {
|
||||
source = source.replace("RenderingContext."+src+")", "RenderingContext."+tgt+")");
|
||||
mod = true;
|
||||
}
|
||||
|
||||
if (file.getName().equals("I18nConstants.java") && source.contains(src)) {
|
||||
source = removeLines(source, src);
|
||||
mod = true;
|
||||
|
@ -71,7 +456,7 @@ public class I18nConstantMaintainer {
|
|||
TextFile.stringToFile(source, file);
|
||||
count++;
|
||||
}
|
||||
|
||||
|
||||
} else if (Utilities.existsInList(ext, "properties")) {
|
||||
String source = TextFile.fileToString(file);
|
||||
if (source.contains(src)) {
|
||||
|
@ -83,12 +468,12 @@ public class I18nConstantMaintainer {
|
|||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
private static String removeLines(String source, String src) {
|
||||
String[] lines = Utilities.splitLines(source);
|
||||
StringBuilder b = new StringBuilder();
|
||||
for (String s : lines) {
|
||||
if (!s.contains(src)) {
|
||||
if (!(s.contains(src+"\"") || s.contains(src+"=") || s.contains(src+" "))) {
|
||||
b.append(s);
|
||||
b.append("\r\n");
|
||||
}
|
||||
|
@ -97,9 +482,11 @@ public class I18nConstantMaintainer {
|
|||
}
|
||||
|
||||
private static void rename(String dir, String src, String tgt) throws FileNotFoundException, IOException {
|
||||
System.out.println("Rename "+src+" to "+tgt+" in "+dir);
|
||||
int count = rename(new File(dir), src, tgt);
|
||||
System.out.println("Done. "+count+" files changed");
|
||||
if (!src.equals(tgt)) {
|
||||
System.out.println("Rename "+src+" to "+tgt+" in "+dir);
|
||||
int count = rename(new File(dir), src, tgt);
|
||||
System.out.println("Done. "+count+" files changed");
|
||||
}
|
||||
}
|
||||
|
||||
private static int rename(File file, String src, String tgt) throws FileNotFoundException, IOException {
|
||||
|
@ -113,31 +500,67 @@ public class I18nConstantMaintainer {
|
|||
if ("java".equals(ext)) {
|
||||
String source = TextFile.fileToString(file);
|
||||
boolean mod = false;
|
||||
if (source.contains("I18nConstants."+src)) {
|
||||
source = source.replace("I18nConstants."+src, "I18nConstants."+tgt);
|
||||
|
||||
if (source.contains("I18nConstants."+src+",")) {
|
||||
source = source.replace("I18nConstants."+src+",", "I18nConstants."+tgt+",");
|
||||
mod = true;
|
||||
}
|
||||
if (source.contains("RenderingI18nContext."+src)) {
|
||||
source = source.replace("RenderingI18nContext."+src, "RenderingI18nContext."+tgt);
|
||||
if (source.contains("I18nConstants."+src+")")) {
|
||||
source = source.replace("I18nConstants."+src+")", "I18nConstants."+tgt+")");
|
||||
mod = true;
|
||||
}
|
||||
if (source.contains("RenderingContext."+src)) {
|
||||
source = source.replace("RenderingContext."+src, "RenderingContext."+tgt);
|
||||
|
||||
if (source.contains("RenderingI18nContext."+src+",")) {
|
||||
source = source.replace("RenderingI18nContext."+src+",", "RenderingI18nContext."+tgt+",");
|
||||
mod = true;
|
||||
}
|
||||
if (file.getName().equals("I18nConstants.java") && source.contains(src)) {
|
||||
source = source.replace(src, tgt);
|
||||
if (source.contains("RenderingI18nContext."+src+")")) {
|
||||
source = source.replace("RenderingI18nContext."+src+")", "RenderingI18nContext."+tgt+")");
|
||||
mod = true;
|
||||
}
|
||||
if (file.getName().equals("RenderingI18nContext.java") && source.contains(src)) {
|
||||
source = source.replace(src, tgt);
|
||||
|
||||
if (source.contains("RenderingContext."+src+",")) {
|
||||
source = source.replace("RenderingContext."+src+",", "RenderingContext."+tgt+",");
|
||||
mod = true;
|
||||
}
|
||||
|
||||
if (source.contains("RenderingContext."+src+")")) {
|
||||
source = source.replace("RenderingContext."+src+")", "RenderingContext."+tgt+")");
|
||||
mod = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (file.getName().equals("I18nConstants.java") && source.contains(src+" =")) {
|
||||
source = source.replace(src+" =", tgt+" =");
|
||||
mod = true;
|
||||
}
|
||||
if (file.getName().equals("I18nConstants.java") && source.contains(src+"=")) {
|
||||
source = source.replace(src+"=", tgt+" =");
|
||||
mod = true;
|
||||
}
|
||||
if (file.getName().equals("I18nConstants.java") && source.contains(src+" =")) {
|
||||
source = source.replace(src+" =", tgt+" =");
|
||||
mod = true;
|
||||
}
|
||||
if (file.getName().equals("I18nConstants.java") && source.contains(src+"=")) {
|
||||
source = source.replace(src+"=", tgt+" =");
|
||||
mod = true;
|
||||
}
|
||||
if (file.getName().equals("RenderingI18nContext.java") && source.contains(src+" =")) {
|
||||
source = source.replace(src+" =", tgt+" =");
|
||||
mod = true;
|
||||
}
|
||||
if (file.getName().equals("RenderingI18nContext.java") && source.contains(src+"=")) {
|
||||
source = source.replace(src+"=", tgt+" =");
|
||||
mod = true;
|
||||
}
|
||||
|
||||
if (mod) {
|
||||
TextFile.stringToFile(source, file);
|
||||
count++;
|
||||
}
|
||||
|
||||
|
||||
} else if (Utilities.existsInList(ext, "po", "properties")) {
|
||||
String source = TextFile.fileToString(file);
|
||||
if (source.contains(src)) {
|
||||
|
|
|
@ -1079,6 +1079,11 @@ public class I18nConstants {
|
|||
public static final String _HAS_CHILDREN__AND_MULTIPLE_TYPES__IN_PROFILE_ = "_has_children__and_multiple_types__in_profile_";
|
||||
public static final String _HAS_CHILDREN__FOR_TYPE__IN_PROFILE__BUT_CANT_FIND_TYPE = "_has_children__for_type__in_profile__but_cant_find_type";
|
||||
public static final String _HAS_NO_CHILDREN__AND_NO_TYPES_IN_PROFILE_ = "_has_no_children__and_no_types_in_profile_";
|
||||
public static final String TERMINOLOGY_TX_CODE_NOTVALID = "Terminology_TX_Code_NotValid";
|
||||
public static final String TERMINOLOGY_TX_CODE_UNKNOWN = "Terminology_TX_Code_Unknown";
|
||||
public static final String TERMINOLOGY_TX_CODE_VALUESET = "Terminology_TX_Code_ValueSet";
|
||||
public static final String TERMINOLOGY_TX_CODE_VALUESETMAX = "Terminology_TX_Code_ValueSetMax";
|
||||
public static final String TERMINOLOGY_TX_CODE_VALUESET_EXT = "Terminology_TX_Code_ValueSet_Ext";
|
||||
|
||||
//public static final String DUPLICATE_RESOURCE_VERSION = "DUPLICATE_RESOURCE_VERSION";
|
||||
//public static final String FHIRPATH_BAD_DATE = "FHIRPATH_BAD_DATE";
|
||||
|
|
|
@ -41,26 +41,29 @@ public class POGenerator {
|
|||
private String comment;
|
||||
private List<String> msgstr = new ArrayList<String>();
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
new POGenerator().execute(args[0], args[1]);
|
||||
new POGenerator().execute(args[0]);
|
||||
}
|
||||
|
||||
private List<String> prefixes = new ArrayList<>();
|
||||
|
||||
private void execute(String source, String dest) throws IOException {
|
||||
generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(dest, "rendering-phrases-de.po"));
|
||||
generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(dest, "rendering-phrases-es.po"));
|
||||
generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(dest, "rendering-phrases-ja.po"));
|
||||
generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(dest, "rendering-phrases-nl.po"));
|
||||
private void execute(String source) throws IOException {
|
||||
generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(source, "source", "rendering-phrases-de.po"), Utilities.path(source, "rendering-phrases_de.properties"), true);
|
||||
generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(source, "source", "rendering-phrases-es.po"), Utilities.path(source, "rendering-phrases_es.properties"), false);
|
||||
generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(source, "source", "rendering-phrases-ja.po"), Utilities.path(source, "rendering-phrases_ja.properties"), false);
|
||||
generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(source, "source", "rendering-phrases-nl.po"), Utilities.path(source, "rendering-phrases_nl.properties"), false);
|
||||
generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(source, "source", "rendering-phrases-pt-BR.po"), Utilities.path(source, "rendering-phrases_pt-BR.properties"), false);
|
||||
|
||||
generate(Utilities.path(source, "Messages.properties"), Utilities.path(dest, "validator-messages-de.po"));
|
||||
generate(Utilities.path(source, "Messages.properties"), Utilities.path(dest, "validator-messages-es.po"));
|
||||
generate(Utilities.path(source, "Messages.properties"), Utilities.path(dest, "validator-messages-ja.po"));
|
||||
generate(Utilities.path(source, "Messages.properties"), Utilities.path(dest, "validator-messages-nl.po"));
|
||||
generate(Utilities.path(source, "Messages.properties"), Utilities.path(source, "source", "validator-messages-de.po"), Utilities.path(source, "Messages_de.properties"), true);
|
||||
generate(Utilities.path(source, "Messages.properties"), Utilities.path(source, "source", "validator-messages-es.po"), Utilities.path(source, "Messages_es.properties"), false);
|
||||
generate(Utilities.path(source, "Messages.properties"), Utilities.path(source, "source", "validator-messages-ja.po"), Utilities.path(source, "Messages_ja.properties"), false);
|
||||
generate(Utilities.path(source, "Messages.properties"), Utilities.path(source, "source", "validator-messages-nl.po"), Utilities.path(source, "Messages_nl.properties"), false);
|
||||
generate(Utilities.path(source, "Messages.properties"), Utilities.path(source, "source", "validator-messages-pt-BR.po"), Utilities.path(source, "Messages_pt-BR.properties"), false);
|
||||
|
||||
}
|
||||
|
||||
private void generate(String source, String dest) throws IOException {
|
||||
private void generate(String source, String dest, String tgt, boolean firstRun) throws IOException {
|
||||
// load the destination file
|
||||
// load the source file
|
||||
// update the destination object set for changes from the source file
|
||||
|
@ -95,10 +98,12 @@ public class POGenerator {
|
|||
objects.removeIf(o -> o.orphan);
|
||||
Collections.sort(objects, new POObjectSorter());
|
||||
Map<String, Integer> sources = new HashMap<>();
|
||||
Set<String> dups = new HashSet<>();
|
||||
for (POObject o : objects) {
|
||||
if (sources.containsKey(o.msgid)) {
|
||||
Integer c = sources.get(o.msgid)+1;
|
||||
sources.put(o.msgid, c);
|
||||
dups.add(o.msgid);
|
||||
// System.out.println("Duplicate in "+dest.substring(dest.lastIndexOf("/")+1)+": "+o.msgid+" on ("+CommaSeparatedStringBuilder.join(",", listIds(objects, o.msgid))+")");
|
||||
} else {
|
||||
sources.put(o.msgid, 1);
|
||||
|
@ -110,7 +115,29 @@ public class POGenerator {
|
|||
o.duplicate = true;
|
||||
}
|
||||
}
|
||||
if (firstRun) {
|
||||
for (String s : Utilities.sorted(dups)) {
|
||||
String mid = null;
|
||||
boolean first = true;
|
||||
for (POObject o : objects) {
|
||||
if (o.msgid.equals(s) && o.msgidPlural == null) {
|
||||
if (mid == null) {
|
||||
mid = o.id;
|
||||
} else {
|
||||
if (first) {
|
||||
System.out.println("");
|
||||
System.out.println("// "+s);
|
||||
System.out.println("rename(\"/Users/grahamegrieve/work/core\", \""+mid+"\", \""+mid+"\");");
|
||||
first = false;
|
||||
}
|
||||
System.out.println("replace(\"/Users/grahamegrieve/work/core\", \""+o.id+"\", \""+mid+"\");");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
savePOFile(dest, objects);
|
||||
savePropFile(tgt, objects);
|
||||
}
|
||||
|
||||
private Set<String> listIds(List<POObject> objects, String msgid) {
|
||||
|
@ -198,12 +225,12 @@ public class POGenerator {
|
|||
// we don't care; nothing to do
|
||||
}
|
||||
} else if (mode == 2) {
|
||||
if (!value.equals(o.msgid)) {
|
||||
if (!value.equals(o.msgidPlural)) {
|
||||
// the english string has changed, and the other language string is now out of date
|
||||
// if (o.oldMsgId != null) {
|
||||
// o.oldMsgId = o.msgid;
|
||||
// }
|
||||
o.msgid = value;
|
||||
o.msgidPlural = value;
|
||||
if (o.msgstr.size() > 1 && !Utilities.noString(o.msgstr.get(1))) {
|
||||
o.msgstr.set(1, "!!"+o.msgstr.get(1));
|
||||
}
|
||||
|
@ -290,9 +317,32 @@ public class POGenerator {
|
|||
if (!(v.length() == 3 && v.startsWith("{") && v.endsWith("}"))) {
|
||||
res.add(new StringPair(n, v));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private void savePropFile(String tgt, List<POObject> objects) throws IOException {
|
||||
String nameLine = TextFile.fileToLines(tgt)[0];
|
||||
String[] parts = nameLine.substring(1).trim().split("\\=");
|
||||
String[] names = parts[1].split("\\,");
|
||||
|
||||
StringBuilder b = new StringBuilder();
|
||||
b.append(nameLine+"\r\n");
|
||||
for (POObject o : objects) {
|
||||
if (o.msgidPlural == null) {
|
||||
b.append(o.id+" = "+(o.msgstr.size() > 0 ? o.msgstr.get(0) : "")+"\r\n");
|
||||
} else {
|
||||
for (int i = 0; i < names.length; i++) {
|
||||
b.append(o.id+"_"+names[i].trim()+" = "+(o.msgstr.size() > i ? o.msgstr.get(i) : "")+"\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TextFile.stringToFile(b.toString(), tgt);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -153,17 +153,20 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String CODESYSTEM_CONTENT_SUPPLEMENT = "CODESYSTEM_CONTENT_SUPPLEMENT";
|
||||
public static final String CODESYSTEM_DEPRECATED = "CODESYSTEM_DEPRECATED";
|
||||
public static final String CODESYSTEM_FILTERS = "CODESYSTEM_FILTERS";
|
||||
public static final String GENERAL_CODE = "GENERAL_CODE";
|
||||
public static final String CODESYSTEM_FILTER_CODE = "CODESYSTEM_FILTER_CODE";
|
||||
public static final String CODESYSTEM_FILTER_DESC = "CODESYSTEM_FILTER_DESC";
|
||||
public static final String CODESYSTEM_FILTER_OP = "CODESYSTEM_FILTER_OP";
|
||||
public static final String CODESYSTEM_FILTER_VALUE = "CODESYSTEM_FILTER_VALUE";
|
||||
public static final String CODESYSTEM_PROPS = "CODESYSTEM_PROPS";
|
||||
public static final String CODESYSTEM_PROPS_DESC = "CODESYSTEM_PROPS_DESC";
|
||||
public static final String CODESYSTEM_PROP_CODE = "CODESYSTEM_PROP_CODE";
|
||||
public static final String CODESYSTEM_PROP_DESC = "CODESYSTEM_PROP_DESC";
|
||||
public static final String CODESYSTEM_PROP_NAME = "CODESYSTEM_PROP_NAME";
|
||||
public static final String CODESYSTEM_PROP_TYPE = "CODESYSTEM_PROP_TYPE";
|
||||
public static final String CODESYSTEM_PROP_URI = "CODESYSTEM_PROP_URI";
|
||||
public static final String GENERAL_ADD_LANG = "GENERAL_ADD_LANG";
|
||||
public static final String CODE_SYS_ADD_LANG = "CODE_SYS_ADD_LANG";
|
||||
public static final String CODE_SYS_CODE = "CODE_SYS_CODE";
|
||||
public static final String CODE_SYS_CODE_NOT_HERE = "CODE_SYS_CODE_NOT_HERE";
|
||||
public static final String CODE_SYS_COMPLETE = "CODE_SYS_COMPLETE";
|
||||
public static final String CODE_SYS_CONTENT = "CODE_SYS_CONTENT";
|
||||
public static final String CODE_SYS_COPY = "CODE_SYS_COPY";
|
||||
|
@ -184,6 +187,9 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String CODE_SYS_UNKN_MODE = "CODE_SYS_UNKN_MODE";
|
||||
public static final String CODE_SYS_VALUE_SET = "CODE_SYS_VALUE_SET";
|
||||
public static final String CONC_MAP_CMNT = "CONC_MAP_CMNT";
|
||||
public static final String CONC_MAP_CODE = "CONC_MAP_CODE";
|
||||
public static final String CONC_MAP_CODES = "CONC_MAP_CODES";
|
||||
public static final String CONC_MAP_CODE_SYS_UNSPEC = "CONC_MAP_CODE_SYS_UNSPEC";
|
||||
public static final String CONC_MAP_FRM = "CONC_MAP_FRM";
|
||||
public static final String CONC_MAP_FROM = "CONC_MAP_FROM";
|
||||
public static final String CONC_MAP_GRP = "CONC_MAP_GRP";
|
||||
|
@ -212,6 +218,8 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String DATA_REND_BFMEALS = "DATA_REND_BFMEALS";
|
||||
public static final String DATA_REND_BFSLEEP = "DATA_REND_BFSLEEP";
|
||||
public static final String DATA_REND_BY = "DATA_REND_BY";
|
||||
public static final String DATA_REND_CODE = "DATA_REND_CODE";
|
||||
public static final String DATA_REND_CODES = "DATA_REND_CODES";
|
||||
public static final String DATA_REND_COND = "DATA_REND_COND";
|
||||
public static final String DATA_REND_COUNT = "DATA_REND_COUNT";
|
||||
public static final String DATA_REND_DATA = "DATA_REND_DATA";
|
||||
|
@ -226,6 +234,7 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String DATA_REND_FACT = "DATA_REND_FACT";
|
||||
public static final String DATA_REND_FAX = "DATA_REND_FAX";
|
||||
public static final String DATA_REND_FILT = "DATA_REND_FILT";
|
||||
public static final String DATA_REND_GETCODE = "DATA_REND_GETCODE";
|
||||
public static final String DATA_REND_GLN = "DATA_REND_GLN";
|
||||
public static final String DATA_REND_ICD = "DATA_REND_ICD";
|
||||
public static final String DATA_REND_INT = "DATA_REND_INT";
|
||||
|
@ -264,6 +273,8 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String DATA_REND_VALUESET = "DATA_REND_VALUESET";
|
||||
public static final String DATA_REND_VERSION = "DATA_REND_VERSION";
|
||||
public static final String DIAG_REP_REND_AGE = "DIAG_REP_REND_AGE";
|
||||
public static final String DIAG_REP_REND_CODE = "DIAG_REP_REND_CODE";
|
||||
public static final String DIAG_REP_REND_CODECON = "DIAG_REP_REND_CODECON";
|
||||
public static final String DIAG_REP_REND_ERR = "DIAG_REP_REND_ERR";
|
||||
public static final String DIAG_REP_REND_FLAG = "DIAG_REP_REND_FLAG";
|
||||
public static final String DIAG_REP_REND_FOR = "DIAG_REP_REND_FOR";
|
||||
|
@ -322,6 +333,7 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String LIB_REND_REV = "LIB_REND_REV";
|
||||
public static final String LIB_REND_SHOW = "LIB_REND_SHOW";
|
||||
public static final String LIB_REND_SIZE = "LIB_REND_SIZE";
|
||||
public static final String LIST_REND_CODE = "LIST_REND_CODE";
|
||||
public static final String LIST_REND_DAT = "LIST_REND_DAT";
|
||||
public static final String LIST_REND_DATE = "LIST_REND_DATE";
|
||||
public static final String LIST_REND_DEL = "LIST_REND_DEL";
|
||||
|
@ -357,8 +369,8 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String OBLIG_FILT = "OBLIG_FILT";
|
||||
public static final String OBLIG_OBLIG = "OBLIG_OBLIG";
|
||||
public static final String OBLIG_USE = "OBLIG_USE";
|
||||
public static final String GENERAL_BINDING = "GENERAL_BINDING";
|
||||
public static final String GENERAL_CARDINALITY = "GENERAL_CARDINALITY";
|
||||
public static final String OP_DEF_BIND = "OP_DEF_BIND";
|
||||
public static final String OP_DEF_CARD = "OP_DEF_CARD";
|
||||
public static final String OP_DEF_DOC = "OP_DEF_DOC";
|
||||
public static final String OP_DEF_INPAR = "OP_DEF_INPAR";
|
||||
public static final String OP_DEF_NAME = "OP_DEF_NAME";
|
||||
|
@ -370,6 +382,7 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String OP_DEF_URL = "OP_DEF_URL";
|
||||
public static final String OP_DEF_URLS = "OP_DEF_URLS";
|
||||
public static final String OP_DEF_USE = "OP_DEF_USE";
|
||||
public static final String OP_OUT_CODE = "OP_OUT_CODE";
|
||||
public static final String OP_OUT_DET = "OP_OUT_DET";
|
||||
public static final String OP_OUT_DIAG = "OP_OUT_DIAG";
|
||||
public static final String OP_OUT_LOC = "OP_OUT_LOC";
|
||||
|
@ -446,7 +459,9 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String QUEST_ATTRIBUTES = "QUEST_ATTRIBUTES";
|
||||
public static final String QUEST_CALC = "QUEST_CALC";
|
||||
public static final String QUEST_CAND = "QUEST_CAND";
|
||||
public static final String QUEST_CARD = "QUEST_CARD";
|
||||
public static final String QUEST_CAT = "QUEST_CAT";
|
||||
public static final String QUEST_CODE = "QUEST_CODE";
|
||||
public static final String QUEST_CONT = "QUEST_CONT";
|
||||
public static final String QUEST_COPYRIGHT = "QUEST_COPYRIGHT";
|
||||
public static final String QUEST_DEF = "QUEST_DEF";
|
||||
|
@ -586,14 +601,16 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String SD_COMP_HEAD_TYPE_R = "SD_COMP_HEAD_TYPE_R";
|
||||
public static final String SD_COMP_HEAD_TYPE_R_DESC ="SD_COMP_HEAD_TYPE_R_DESC";
|
||||
public static final String SD_DOCO = "SD_DOCO";
|
||||
public static final String GENERAL_CARD = "GENERAL_CARD";
|
||||
public static final String GENERAL_CARD_DESC = "GENERAL_CARD_DESC";
|
||||
public static final String SD_GRID_HEAD_CARD = "SD_GRID_HEAD_CARD";
|
||||
public static final String SD_GRID_HEAD_CARD_DESC = "SD_GRID_HEAD_CARD_DESC";
|
||||
public static final String SD_GRID_HEAD_DESC = "SD_GRID_HEAD_DESC";
|
||||
public static final String SD_GRID_HEAD_DESC_DESC = "SD_GRID_HEAD_DESC_DESC";
|
||||
public static final String SD_GRID_HEAD_NAME = "SD_GRID_HEAD_NAME";
|
||||
public static final String SD_GRID_HEAD_NAME_DESC = "SD_GRID_HEAD_NAME_DESC";
|
||||
public static final String SD_GRID_HEAD_TYPE = "SD_GRID_HEAD_TYPE";
|
||||
public static final String SD_GRID_HEAD_TYPE_DESC = "SD_GRID_HEAD_TYPE_DESC";
|
||||
public static final String SD_HEAD_CARD = "SD_HEAD_CARD";
|
||||
public static final String SD_HEAD_CARD_DESC = "SD_HEAD_CARD_DESC";
|
||||
public static final String SD_HEAD_DESC = "SD_HEAD_DESC";
|
||||
public static final String SD_HEAD_DESC_DESC = "SD_HEAD_DESC_DESC";
|
||||
public static final String SD_HEAD_FLAGS = "SD_HEAD_FLAGS";
|
||||
|
@ -648,6 +665,9 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String STRUC_DEF_APPROP_CON = "STRUC_DEF_APPROP_CON";
|
||||
public static final String STRUC_DEF_AS_SHOWN = "STRUC_DEF_AS_SHOWN";
|
||||
public static final String STRUC_DEF_BECAUSE = "STRUC_DEF_BECAUSE";
|
||||
public static final String STRUC_DEF_BINDING = "STRUC_DEF_BINDING";
|
||||
public static final String STRUC_DEF_BINDINGS = "STRUC_DEF_BINDINGS";
|
||||
public static final String STRUC_DEF_BINDING_STYLE = "STRUC_DEF_BINDING_STYLE";
|
||||
public static final String STRUC_DEF_BIND_STYLE = "STRUC_DEF_BIND_STYLE";
|
||||
public static final String STRUC_DEF_BLACK = "STRUC_DEF_BLACK";
|
||||
public static final String STRUC_DEF_BUSINESS_ID = "STRUC_DEF_BUSINESS_ID";
|
||||
|
@ -658,6 +678,7 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String STRUC_DEF_CANT_FIND = "STRUC_DEF_CANT_FIND";
|
||||
public static final String STRUC_DEF_CAN_TARGET = "STRUC_DEF_CAN_TARGET";
|
||||
public static final String STRUC_DEF_CAP = "STRUC_DEF_CAP";
|
||||
public static final String STRUC_DEF_CARD = "STRUC_DEF_CARD";
|
||||
public static final String STRUC_DEF_CDA = "STRUC_DEF_CDA";
|
||||
public static final String STRUC_DEF_CHILD = "STRUC_DEF_CHILD";
|
||||
public static final String STRUC_DEF_CHOICE = "STRUC_DEF_CHOICE";
|
||||
|
@ -849,6 +870,7 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String STRUC_DEF_SLICE_NAME = "STRUC_DEF_SLICE_NAME";
|
||||
public static final String STRUC_DEF_SLICE_PAR = "STRUC_DEF_SLICE_PAR";
|
||||
public static final String STRUC_DEF_SNOMED = "STRUC_DEF_SNOMED";
|
||||
public static final String STRUC_DEF_SNOMED_CODE = "STRUC_DEF_SNOMED_CODE";
|
||||
public static final String STRUC_DEF_SNOMED_CT = "STRUC_DEF_SNOMED_CT";
|
||||
public static final String STRUC_DEF_STAND_STAT = "STRUC_DEF_STAND_STAT";
|
||||
public static final String STRUC_DEF_STAND_STATUS = "STRUC_DEF_STAND_STATUS";
|
||||
|
@ -956,17 +978,23 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String TEXT_ICON_REUSE = "TEXT_ICON_REUSE";
|
||||
public static final String TEXT_ICON_SLICE = "TEXT_ICON_SLICE";
|
||||
public static final String TEXT_ICON_SLICE_ITEM = "TEXT_ICON_SLICE_ITEM";
|
||||
public static final String TX_CODE = "TX_CODE";
|
||||
public static final String TX_COMMENTS = "TX_COMMENTS";
|
||||
public static final String TX_DEFINITION = "TX_DEFINITION";
|
||||
public static final String TX_DEPRECATED = "TX_DEPRECATED";
|
||||
public static final String TX_DISPLAY = "TX_DISPLAY";
|
||||
public static final String TX_VERSION = "TX_VERSION";
|
||||
public static final String VALUE_SET_ADD_DESIG = "VALUE_SET_ADD_DESIG";
|
||||
public static final String VALUE_SET_ADD_LANG = "VALUE_SET_ADD_LANG";
|
||||
public static final String VALUE_SET_ALL_CODE = "VALUE_SET_ALL_CODE";
|
||||
public static final String VALUE_SET_ALL_CODES_DEF = "VALUE_SET_ALL_CODES_DEF";
|
||||
public static final String VALUE_SET_AND = "VALUE_SET_AND";
|
||||
public static final String VALUE_SET_HAS_AT_LEAST = "VALUE_SET_HAS_AT_LEAST";
|
||||
public static final String VALUE_SET_AUS = "VALUE_SET_AUS";
|
||||
public static final String VALUE_SET_CODE = "VALUE_SET_CODE";
|
||||
public static final String VALUE_SET_CODES_FROM = "VALUE_SET_CODES_FROM";
|
||||
public static final String VALUE_SET_CODE_ITEM = "VALUE_SET_CODE_ITEM";
|
||||
public static final String VALUE_SET_CODE_SELEC = "VALUE_SET_CODE_SELEC";
|
||||
public static final String VALUE_SET_COMMA = "VALUE_SET_COMMA";
|
||||
public static final String VALUE_SET_CONT = "VALUE_SET_CONT";
|
||||
public static final String VALUE_SET_CONTAINS = "VALUE_SET_CONTAINS";
|
||||
|
|
|
@ -673,7 +673,7 @@ public class HierarchicalTableGenerator {
|
|||
model.setDocoRef(Utilities.pathURL("https://build.fhir.org/ig/FHIR/ig-guidance", "readingIgs.html#table-views"));
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_NAME), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_NAME_DESC), null, 0));
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_FLAGS), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_FLAGS_DESC), null, 0));
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.GENERAL_CARD), i18n.formatPhrase(RenderingI18nContext.GENERAL_CARD_DESC), null, 0));
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_CARD), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_CARD_DESC), null, 0));
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_TYPE), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_TYPE_DESC), null, 100));
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_DESC), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_DESC_DESC), null, 0));
|
||||
if (isLogical) {
|
||||
|
@ -710,7 +710,7 @@ public class HierarchicalTableGenerator {
|
|||
public TableModel initGridTable(String prefix, String id) {
|
||||
TableModel model = new TableModel(id, false);
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_NAME), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_NAME_DESC), null, 0));
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.GENERAL_CARD), i18n.formatPhrase(RenderingI18nContext.GENERAL_CARD_DESC), null, 0));
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_CARD), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_CARD_DESC), null, 0));
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_TYPE), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_TYPE_DESC), null, 100));
|
||||
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_DESC), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_DESC_DESC), null, 0));
|
||||
|
||||
|
|
|
@ -1171,7 +1171,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
CodeSystem cs = getCodeSystem(system);
|
||||
if (rule(errors, NO_RULE_DATE, IssueType.CODEINVALID, element.line(), element.col(), path, cs != null, I18nConstants.TERMINOLOGY_TX_SYSTEM_UNKNOWN, system)) {
|
||||
ConceptDefinitionComponent def = getCodeDefinition(cs, code);
|
||||
if (warning(errors, NO_RULE_DATE, IssueType.CODEINVALID, element.line(), element.col(), path, def != null, I18nConstants.TERMINOLOGY_TX_CODE_UNKNOWN, system, code))
|
||||
if (warning(errors, NO_RULE_DATE, IssueType.CODEINVALID, element.line(), element.col(), path, def != null, I18nConstants.UNKNOWN_CODESYSTEM, system, code))
|
||||
return warning(errors, NO_RULE_DATE, IssueType.CODEINVALID, element.line(), element.col(), path, display == null || display.equals(def.getDisplay()), I18nConstants.TERMINOLOGY_TX_DISPLAY_WRONG, def.getDisplay()) && ok;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue