Test showing that extensions are not carried over

This commit is contained in:
Jens Kristian Villadsen 2023-01-16 20:07:20 +01:00
parent e55b342674
commit fed5d0c2f7
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());
}
}