fix for #575 NPE in rendering Patient

This commit is contained in:
Grahame Grieve 2021-08-25 06:50:58 +10:00
parent fb0d90ad1f
commit 4ba9193a5e
2 changed files with 7 additions and 3 deletions

View File

@ -72,7 +72,7 @@ public class MedicationRequest10_40 {
if (src.hasDose())
dose_and_rate.setDose(ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().convertType(src.getDose()));
if (src.hasRate())
dose_and_rate.setDose(ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().convertType(src.getRate()));
dose_and_rate.setRate(ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().convertType(src.getRate()));
tgt.addDoseAndRate(dose_and_rate);
if (src.hasMaxDosePerPeriod())
tgt.setMaxDosePerPeriod(Ratio10_40.convertRatio(src.getMaxDosePerPeriod()));

View File

@ -195,9 +195,13 @@ public class PatientRenderer extends ResourceRenderer {
}
public void describe(XhtmlNode x, HumanName name, String gender, DateType dob, Identifier id) throws UnsupportedEncodingException, IOException {
render(x.b(), name);
if (name == null) {
x.b().tx("Unnamed Patient"); // todo: is this appropriate?
} else {
render(x.b(), name);
}
x.tx(" ");
if (dob == null) {
if (gender == null) {
x.tx("??");
} else {
x.tx(gender);