Merge pull request #1077 from jkiddo/master

Reopen PR
This commit is contained in:
Grahame Grieve 2023-01-18 06:58:48 +11:00 committed by GitHub
commit 054fba7505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 11 deletions

View File

@ -1,21 +1,11 @@
package org.hl7.fhir.r4.test;
import org.fhir.ucum.UcumException;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.formats.IParser;
import org.hl7.fhir.r4.formats.IParser.OutputStyle;
import org.hl7.fhir.r4.formats.JsonParser;
import org.hl7.fhir.r4.formats.XmlParser;
import org.hl7.fhir.r4.model.*;
import org.hl7.fhir.r4.test.utils.TestingUtilities;
import org.hl7.fhir.r4.utils.EOperationOutcome;
import org.hl7.fhir.r4.utils.NarrativeGenerator;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.io.*;
import java.io.IOException;
public class ResourceCopyTests {
@ -53,4 +43,17 @@ public class ResourceCopyTests {
Assertions.assertEquals(obs.equalsDeep(copyObs),true,"DeepEquals fails");
}
@Test
void missingExtension()
{
Patient patient1 = new Patient().setGender(Enumerations.AdministrativeGender.FEMALE);
Enumeration genderElement = patient1.getGenderElement();
genderElement.addExtension(new Extension(("1"),new StringType("2")));
genderElement.addExtension(new Extension(("3"),new StringType("4")));
Patient patient2 = new Patient();
patient2.setProperty("gender", genderElement);
Assertions.assertEquals(2, patient2.getGenderElement().getExtension().size());
}
}