Merge pull request #759 from hapifhir/R4B-datatypes-and-xml-cleanup

R4 b datatypes and xml cleanup
This commit is contained in:
Grahame Grieve 2022-03-11 10:53:52 +11:00 committed by GitHub
commit a3e8fca51a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 241 additions and 237 deletions

View File

@ -132,7 +132,9 @@ public class TypesUtilities {
res.add(new WildcardInformation("Annotation", TypeClassification.DATATYPE));
res.add(new WildcardInformation("Attachment", TypeClassification.DATATYPE));
res.add(new WildcardInformation("CodeableConcept", TypeClassification.DATATYPE));
if (!VersionUtilities.isR4BVer(version)) {
res.add(new WildcardInformation("CodeableReference", TypeClassification.DATATYPE));
}
res.add(new WildcardInformation("Coding", TypeClassification.DATATYPE));
res.add(new WildcardInformation("ContactPoint", TypeClassification.DATATYPE));
res.add(new WildcardInformation("Count", TypeClassification.DATATYPE));
@ -145,7 +147,9 @@ public class TypesUtilities {
res.add(new WildcardInformation("Quantity", TypeClassification.DATATYPE));
res.add(new WildcardInformation("Range", TypeClassification.DATATYPE));
res.add(new WildcardInformation("Ratio", TypeClassification.DATATYPE));
if (!VersionUtilities.isR4BVer(version)) {
res.add(new WildcardInformation("RatioRange", TypeClassification.DATATYPE));
}
res.add(new WildcardInformation("Reference", " - a reference to another resource", TypeClassification.DATATYPE));
res.add(new WildcardInformation("SampledData", TypeClassification.DATATYPE));
res.add(new WildcardInformation("Signature", TypeClassification.DATATYPE));

View File

@ -273,9 +273,9 @@ public class XMLUtil {
for (int i = 0; i < rawContent.length(); i++) {
char ch = rawContent.charAt(i);
if (ch == '\'')
sb.append("&#39;");
else if (ch == '&')
// We don't escape ' because our code always spits out attributes surrounded by "", which means
// it's not necessary to escape ' - and it's *much* less ugly and more bandwidth-efficient when we don't.
if (ch == '&')
sb.append("&amp;");
else if (ch == '"')
sb.append("&quot;");