Merge pull request #589 from hapifhir/gg-202108-dr-npe2

fix for #575 NPE in rendering Patient
This commit is contained in:
Grahame Grieve 2021-08-25 08:10:16 +10:00 committed by GitHub
commit 1d5fb74fc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);