Generate Narrative correctly for ContactDetails

This commit is contained in:
Grahame Grieve 2020-04-29 14:49:08 +10:00
parent 6edcd20b66
commit 01a5420a68
2 changed files with 24 additions and 1 deletions

View File

@ -569,6 +569,10 @@ public class Coding extends DataType implements IBaseCoding, ICompositeType, ICo
} }
public boolean matches(Coding other) {
return other.hasCode() && this.hasCode() && other.hasSystem() && this.hasSystem() && this.getCode().equals(other.getCode()) && this.getSystem().equals(other.getSystem()) ;
}
// end addition // end addition

View File

@ -1542,6 +1542,16 @@ public class NarrativeGenerator implements INarrativeGenerator {
renderAddress((Address) e, x); renderAddress((Address) e, x);
} else if (e instanceof ContactPoint) { } else if (e instanceof ContactPoint) {
renderContactPoint((ContactPoint) e, x); renderContactPoint((ContactPoint) e, x);
} else if (e instanceof ContactDetail) {
ContactDetail cd = (ContactDetail) e;
if (cd.hasName()) {
x.tx(cd.getName()+": ");
}
boolean first = true;
for (ContactPoint c : cd.getTelecom()) {
if (first) first = false; else x.tx(",");
renderContactPoint(c, x);
}
} else if (e instanceof UriType) { } else if (e instanceof UriType) {
renderUri((UriType) e, x, defn.getPath(), rc != null && rc.resourceResource != null ? rc.resourceResource.getId() : null); renderUri((UriType) e, x, defn.getPath(), rc != null && rc.resourceResource != null ? rc.resourceResource.getId() : null);
} else if (e instanceof Timing) { } else if (e instanceof Timing) {
@ -1709,7 +1719,16 @@ public class NarrativeGenerator implements INarrativeGenerator {
} else if (e instanceof Resource) { } else if (e instanceof Resource) {
return false; return false;
} else if (e instanceof ContactDetail) { } else if (e instanceof ContactDetail) {
return false; ContactDetail cd = (ContactDetail) e;
if (cd.hasName()) {
x.tx(cd.getName()+": ");
}
boolean first = true;
for (ContactPoint c : cd.getTelecom()) {
if (first) first = false; else x.tx(",");
renderContactPoint(c, x);
}
return true;
} else if (e instanceof Range) { } else if (e instanceof Range) {
return false; return false;
} else if (e instanceof Meta) { } else if (e instanceof Meta) {