fix NPE
This commit is contained in:
parent
2dc72fcaf1
commit
f11bdb9560
|
@ -83,6 +83,9 @@ public class FmlParser extends ParserBase {
|
||||||
if (!result.hasChild("status")) {
|
if (!result.hasChild("status")) {
|
||||||
result.makeElement("status").setValue("draft");
|
result.makeElement("status").setValue("draft");
|
||||||
}
|
}
|
||||||
|
if (!result.hasChild("id") && result.hasChild("name")) {
|
||||||
|
result.makeElement("id").setValue(result.getChildValue("name"));
|
||||||
|
}
|
||||||
if (!result.hasChild("description") && result.hasChild("title")) {
|
if (!result.hasChild("description") && result.hasChild("title")) {
|
||||||
result.makeElement("description").setValue(result.getChildValue("title"));
|
result.makeElement("description").setValue(result.getChildValue("title"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -5027,10 +5027,11 @@ public class FHIRPathEngine {
|
||||||
if (s != null) {
|
if (s != null) {
|
||||||
Base res = null;
|
Base res = null;
|
||||||
if (s.startsWith("#")) {
|
if (s.startsWith("#")) {
|
||||||
|
String t = s.substring(1);
|
||||||
Property p = context.rootResource.getChildByName("contained");
|
Property p = context.rootResource.getChildByName("contained");
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
for (Base c : p.getValues()) {
|
for (Base c : p.getValues()) {
|
||||||
if (chompHash(s).equals(chompHash(c.getIdBase()))) {
|
if (t.equals(c.getIdBase())) {
|
||||||
res = c;
|
res = c;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5052,17 +5053,6 @@ public class FHIRPathEngine {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Strips a leading hashmark (#) if present at the start of a string
|
|
||||||
*/
|
|
||||||
private String chompHash(String theId) {
|
|
||||||
String retVal = theId;
|
|
||||||
while (retVal.startsWith("#")) {
|
|
||||||
retVal = retVal.substring(1);
|
|
||||||
}
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<Base> funcExtension(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws FHIRException {
|
private List<Base> funcExtension(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws FHIRException {
|
||||||
List<Base> result = new ArrayList<Base>();
|
List<Base> result = new ArrayList<Base>();
|
||||||
List<Base> nl = execute(context, focus, exp.getParameters().get(0), true);
|
List<Base> nl = execute(context, focus, exp.getParameters().get(0), true);
|
||||||
|
|
Loading…
Reference in New Issue