@ResourceDef(name = "Observation", profile = CustomObservationDstu3.PROFILE) public class CustomObservationDstu3 extends Observation { public static final String PROFILE = "http://custom_ObservationDstu3"; private static final long serialVersionUID = 1L; @Extension(definedLocally = false, isModifier = false, url = "http://eyeColour") @Child(name = "eyeColour") private StringType myEyeColour; public StringType getEyeColour() { return myEyeColour; } public void setEyeColour(StringType theEyeColour) { myEyeColour = theEyeColour; } }
/** * @param theBoundTypeBinder * If the child is of a type that requires a constructor argument to instantiate, this is the argument to * use * @param theDefinedLocally * See {@link Extension#definedLocally()} */ RuntimeChildDeclaredExtensionDefinition(Field theField, Child theChild, Description theDescriptionAnnotation, Extension theExtension, String theElementName, String theExtensionUrl, Class<? extends IBase> theChildType, Object theBoundTypeBinder) throws ConfigurationException { super(theField, theElementName, theChild, theDescriptionAnnotation); assert isNotBlank(theExtensionUrl); myExtensionUrl = theExtensionUrl; myChildType = theChildType; myDefinedLocally = theExtension.definedLocally(); myModifier = theExtension.isModifier(); myInstanceConstructorArguments = theBoundTypeBinder; List<Class<? extends IBase>> choiceTypes = new ArrayList<Class<? extends IBase>>(); for (Class<? extends IElement> next : theChild.type()) { choiceTypes.add(next); } if (Modifier.isAbstract(theChildType.getModifiers()) == false) { choiceTypes.add(theChildType); } setChoiceTypes(choiceTypes); }
BaseRuntimeDeclaredChildDefinition nextDef = nextEntry.getValue(); if (nextDef instanceof RuntimeChildDeclaredExtensionDefinition) { if (nextDef.getExtensionUrl().equals(extensionAttr.url())) { orderIsReplaceParent = true; order = nextEntry.getKey(); + ") but no parent element with extension URL " + extensionAttr.url() + " could be found on type " + nextField.getDeclaringClass().getSimpleName()); def = new RuntimeChildDeclaredExtensionDefinition(nextField, childAnnotation, descriptionAnnotation, extensionAttr, elementName, extensionAttr.url(), et, binder);
@ResourceDef(name = "Observation", profile = CustomObservationR4.PROFILE) public class CustomObservationR4 extends Observation { public static final String PROFILE = "http://custom_ObservationR4"; private static final long serialVersionUID = 1L; @Extension(definedLocally = false, isModifier = false, url = "http://eyeColour") @Child(name = "eyeColour") private StringType myEyeColour; public StringType getEyeColour() { return myEyeColour; } public void setEyeColour(StringType theEyeColour) { myEyeColour = theEyeColour; } }
/** * @param theBoundTypeBinder * If the child is of a type that requires a constructor argument to instantiate, this is the argument to * use * @param theDefinedLocally * See {@link Extension#definedLocally()} */ RuntimeChildDeclaredExtensionDefinition(Field theField, Child theChild, Description theDescriptionAnnotation, Extension theExtension, String theElementName, String theExtensionUrl, Class<? extends IBase> theChildType, Object theBoundTypeBinder) throws ConfigurationException { super(theField, theElementName, theChild, theDescriptionAnnotation); assert isNotBlank(theExtensionUrl); myExtensionUrl = theExtensionUrl; myChildType = theChildType; myDefinedLocally = theExtension.definedLocally(); myModifier = theExtension.isModifier(); myInstanceConstructorArguments = theBoundTypeBinder; List<Class<? extends IBase>> choiceTypes = new ArrayList<Class<? extends IBase>>(); for (Class<? extends IElement> next : theChild.type()) { choiceTypes.add(next); } if (Modifier.isAbstract(theChildType.getModifiers()) == false) { choiceTypes.add(theChildType); } setChoiceTypes(choiceTypes); }
BaseRuntimeDeclaredChildDefinition nextDef = nextEntry.getValue(); if (nextDef instanceof RuntimeChildDeclaredExtensionDefinition) { if (nextDef.getExtensionUrl().equals(extensionAttr.url())) { orderIsReplaceParent = true; order = nextEntry.getKey(); + ") but no parent element with extension URL " + extensionAttr.url() + " could be found on type " + nextField.getDeclaringClass().getSimpleName()); def = new RuntimeChildDeclaredExtensionDefinition(nextField, childAnnotation, descriptionAnnotation, extensionAttr, elementName, extensionAttr.url(), et, binder);
@Extension(url="http://acme.org/fooParent", definedLocally = false, isModifier = false) protected FooParentExtension fooParentExtension;
@ResourceDef() public static class MyPatient extends Patient { @Child(name="petName") @Extension(url="http://example.com/dontuse#petname", definedLocally=false, isModifier=false) @Description(shortDefinition="The name of the patient's favourite pet") private StringDt myPetName; public StringDt getPetName() { if(myPetName==null) { myPetName = new StringDt(); } return myPetName; } public void setPetName(StringDt thePetName) { myPetName = thePetName; } public List<DateTimeDt> getImportantDates() { if (myImportantDates==null) { myImportantDates=new ArrayList<DateTimeDt>(); } return myImportantDates; } public void setImportantDates(List<DateTimeDt> theImportantDates) { myImportantDates = theImportantDates; } @Child(name="importantDates", max=Child.MAX_UNLIMITED) @Extension(url="http://example.com/dontuse#importantDates", definedLocally=false, isModifier=true) @Description(shortDefinition="Some dates of note for the patient") private List<DateTimeDt> myImportantDates; }
@Extension(url="http://example.com/dontuse#petname", definedLocally=false, isModifier=false) @Description(shortDefinition="The name of the patient's favourite pet") private StringType myPetName; @Extension(url="http://example.com/dontuse#importantDates", definedLocally=false, isModifier=true) @Description(shortDefinition="Some dates of note for this patient") private List<DateTimeType> myImportantDates;
@Extension(url = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race/ombCategory", definedLocally = false, isModifier = false) private Coding ombCategory; @Extension(url = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race/detailed", definedLocally = false, isModifier = false) private Coding detailed; @Extension(url = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race/text", definedLocally = false, isModifier = false) private StringType text;
@Extension(url = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity/ombCategory", definedLocally = false, isModifier = false) private Coding ombCategory; @Extension(url = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity/detailed", definedLocally = false, isModifier = false) private Coding detailed; @Extension(url = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity/text", definedLocally = false, isModifier = false) private StringType text;
@Extension(url = "http://hl7.org/fhir/StructureDefinition/patient-citizenship/code", definedLocally = false, isModifier = false) private CodeableConcept code; @Extension(url = "http://hl7.org/fhir/StructureDefinition/patient-citizenship/period", definedLocally = false, isModifier = false) private Period period;
@Extension(url = "http://hl7.org/fhir/StructureDefinition/birthPlace", isModifier = false, definedLocally = false) @Description(shortDefinition = "The registered place of birth of the patient. A system may use the address.text if they don't store the birthPlace address in discrete elements") private Address birthPlace; @Extension(url = "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName", isModifier = false, definedLocally = false) @Description(shortDefinition = "Mother's maiden name of a patient") private HumanName mothersMaidenName; @Extension(url = "http://hl7.org/fhir/StructureDefinition/patient-citizenship", isModifier = false, definedLocally = false) @Description(shortDefinition = "The citizenship of the patient") private List<Citizenship> citizenship; @Extension(url = "http://hl7.org/fhir/StructureDefinition/patient-religion", isModifier = false, definedLocally = false) @Description(shortDefinition = "The patient's professed religious affiliations") private List<CodeableConcept> religion; @Extension(url = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", isModifier = false, definedLocally = false) @Description(shortDefinition = "Concepts classifying the person into a named category of humans sharing common history, traits, geographical origin or nationality") private Race race; @Extension(url = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", isModifier = false, definedLocally = false) @Description(shortDefinition = "Concepts classifying the person into a named category of humans sharing common history, traits, geographical origin or nationality.") private Ethnicity ethnicity;
@ResourceDef(name = "Observation", profile = CustomObservationDstu3.PROFILE) public class CustomObservationDstu3 extends Observation { public static final String PROFILE = "http://custom_ObservationDstu3"; private static final long serialVersionUID = 1L; @Extension(definedLocally = false, isModifier = false, url = "http://eyeColour") @Child(name = "eyeColour") private StringType myEyeColour; public StringType getEyeColour() { return myEyeColour; } public void setEyeColour(StringType theEyeColour) { myEyeColour = theEyeColour; } }
@ResourceDef(name = "Observation", profile = CustomObservationR4.PROFILE) public class CustomObservationR4 extends Observation { public static final String PROFILE = "http://custom_ObservationR4"; private static final long serialVersionUID = 1L; @Extension(definedLocally = false, isModifier = false, url = "http://eyeColour") @Child(name = "eyeColour") private StringType myEyeColour; public StringType getEyeColour() { return myEyeColour; } public void setEyeColour(StringType theEyeColour) { myEyeColour = theEyeColour; } }
@ResourceDef(name="Patient") public class Example32_ExtendedPatient extends Patient { @Child(name = "eyeColour") @Extension(url="http://acme.org/#extpt", definedLocally = false, isModifier = false) private CodeType myEyeColour; public CodeType getEyeColour() { if (myEyeColour == null) { myEyeColour = new CodeType(); } return myEyeColour; } public void setEyeColour(CodeType theEyeColour) { myEyeColour = theEyeColour; } }
@Extension(url = "http://www.ihe.net/ITI-78/Profile/pdqm#mothersMaidenName", isModifier = false, definedLocally = false) @Description(shortDefinition = "Mother's maiden name of a patient") private HumanName mothersMaidenName;