Package ca.uhn.fhir.test.utilities
Interface ITestDataBuilder
- All Known Subinterfaces:
ITestDataBuilder.WithSupport
public interface ITestDataBuilder
This is an experiment to see if we can make test data creation for storage unit tests a bit more readable.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic classDummy support to use ITestDataBuilder as just a builder, not a DAOstatic interface -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic void__setPrimitiveChild(ca.uhn.fhir.context.FhirContext theFhirContext, org.hl7.fhir.instance.model.api.IBaseResource theTarget, String theElementName, String theElementType, String theValue) Name chosen to avoid potential for conflict.default <E extends org.hl7.fhir.instance.model.api.IBase>
voidapplyElementModifiers(E element, Consumer<E>[] theModifiers) default org.hl7.fhir.instance.model.api.IBaseResourcebuildPatient(Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) default org.hl7.fhir.instance.model.api.IBaseResourcebuildResource(String theResourceType, Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) default org.hl7.fhir.instance.model.api.IIdTypecreateEncounter(Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) default org.hl7.fhir.instance.model.api.IIdTypecreateGroup(Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) default org.hl7.fhir.instance.model.api.IIdTypecreateObservation(Collection<Consumer<org.hl7.fhir.instance.model.api.IBaseResource>> theModifiers) default org.hl7.fhir.instance.model.api.IIdTypecreateObservation(Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) default org.hl7.fhir.instance.model.api.IIdTypecreateOrganization(Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) default org.hl7.fhir.instance.model.api.IIdTypecreatePatient(Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) default org.hl7.fhir.instance.model.api.IIdTypecreateResource(String theResourceType, Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) default org.hl7.fhir.instance.model.api.IIdTypecreateResourceFromJson(String theJson, Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) org.hl7.fhir.instance.model.api.IIdTypedoCreateResource(org.hl7.fhir.instance.model.api.IBaseResource theResource) Users of this API must implement this methodorg.hl7.fhir.instance.model.api.IIdTypedoUpdateResource(org.hl7.fhir.instance.model.api.IBaseResource theResource) Users of this API must implement this methodca.uhn.fhir.context.FhirContextUsers of this API must implement this methoddefault Consumer<org.hl7.fhir.instance.model.api.IBaseResource>Set Patient.active = falsedefault Consumer<org.hl7.fhir.instance.model.api.IBaseResource>Set Patient.active = truedefault Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withBirthdate(String theBirthdate) Set Patient.birthdatedefault <T extends org.hl7.fhir.instance.model.api.IBase>
Consumer<T>withCodingAt(String thePath, String theSystem, String theValue) default <T extends org.hl7.fhir.instance.model.api.IBase>
Consumer<T>withCodingAt(String thePath, String theSystem, String theValue, String theDisplay) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withDateTimeAt(String thePath, String theDate) Set Observation.effectiveDatedefault Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withEffectiveDate(String theDate) Set Observation.effectiveDatedefault <T extends org.hl7.fhir.instance.model.api.IBase,E extends org.hl7.fhir.instance.model.api.IBase>
Consumer<T>withElementAt(String thePath, Consumer<E>... theModifiers) default org.hl7.fhir.instance.model.api.IBasewithElementOfType(String theElementType, Consumer<org.hl7.fhir.instance.model.api.IBase>... theModifiers) Create an Element and apply modifiersdefault Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withEncounter(String theEncounter) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withFamily(String theFamily) default <T extends org.hl7.fhir.instance.model.api.IBaseResource>
Consumer<T>Patient.name.givendefault Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withGroupMember(String theMember) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withGroupMember(org.hl7.fhir.instance.model.api.IIdType theMember) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withId(org.hl7.fhir.instance.model.api.IIdType theId) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withIdentifier(String theSystem, String theValue) Set [Resource].identifier.system and [Resource].identifier.valuedefault Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withLastUpdated(String theIsoDate) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withLastUpdated(Date theLastUpdated) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>Set Organization.namedefault Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withObservationCode(String theSystem, String theCode) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withObservationCode(String theSystem, String theCode, String theDisplay) default <T extends org.hl7.fhir.instance.model.api.IBaseResource,E extends org.hl7.fhir.instance.model.api.IBase>
Consumer<T>withObservationComponent(Consumer<E>... theModifiers) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withObservationHasMember(org.hl7.fhir.instance.model.api.IIdType theHasMember) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withOrganization(org.hl7.fhir.instance.model.api.IIdType theHasMember) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withPatient(String theSubject) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withPatient(org.hl7.fhir.instance.model.api.IIdType theSubject) default <T extends org.hl7.fhir.instance.model.api.IBase>
Consumer<T>withPrimitiveAttribute(String thePath, Object theValue) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withProfile(String theProfile) default <T extends org.hl7.fhir.instance.model.api.IBase>
Consumer<T>withQuantityAtPath(String thePath, Number theValue, String theSystem, String theCode) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withSecurity(String theSystem, String theCode) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withSource(ca.uhn.fhir.context.FhirContext theContext, String theSource) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withStatus(String theStatus) Set Observation.statusdefault Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withSubject(String theSubject) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>withSubject(org.hl7.fhir.instance.model.api.IIdType theSubject) default Consumer<org.hl7.fhir.instance.model.api.IBaseResource>
-
Field Details
-
ourLog
-
-
Method Details
-
withActiveTrue
Set Patient.active = true -
withActiveFalse
Set Patient.active = false -
withFamily
-
withGiven
default <T extends org.hl7.fhir.instance.model.api.IBaseResource> Consumer<T> withGiven(String theName) Patient.name.given -
withBirthdate
Set Patient.birthdate -
withStatus
Set Observation.status -
withEffectiveDate
Set Observation.effectiveDate -
withDateTimeAt
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withDateTimeAt(String thePath, String theDate) Set Observation.effectiveDate -
withIdentifier
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withIdentifier(String theSystem, String theValue) Set [Resource].identifier.system and [Resource].identifier.value -
withName
Set Organization.name -
withId
-
withId
-
withTag
-
withSecurity
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withSecurity(String theSystem, String theCode) -
withProfile
-
withSource
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withSource(ca.uhn.fhir.context.FhirContext theContext, String theSource) -
withLastUpdated
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withLastUpdated(Date theLastUpdated) -
withLastUpdated
-
createEncounter
default org.hl7.fhir.instance.model.api.IIdType createEncounter(Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) -
createGroup
default org.hl7.fhir.instance.model.api.IIdType createGroup(Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) -
createObservation
default org.hl7.fhir.instance.model.api.IIdType createObservation(Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) -
createObservation
default org.hl7.fhir.instance.model.api.IIdType createObservation(Collection<Consumer<org.hl7.fhir.instance.model.api.IBaseResource>> theModifiers) -
buildPatient
default org.hl7.fhir.instance.model.api.IBaseResource buildPatient(Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) -
createPatient
default org.hl7.fhir.instance.model.api.IIdType createPatient(Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) -
createOrganization
default org.hl7.fhir.instance.model.api.IIdType createOrganization(Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) -
createResource
default org.hl7.fhir.instance.model.api.IIdType createResource(String theResourceType, Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) -
createResourceFromJson
default org.hl7.fhir.instance.model.api.IIdType createResourceFromJson(String theJson, Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) -
buildResource
default org.hl7.fhir.instance.model.api.IBaseResource buildResource(String theResourceType, Consumer<org.hl7.fhir.instance.model.api.IBaseResource>... theModifiers) -
withSubject
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withSubject(@Nullable org.hl7.fhir.instance.model.api.IIdType theSubject) -
withSubject
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withSubject(@Nullable String theSubject) -
withPatient
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withPatient(@Nullable org.hl7.fhir.instance.model.api.IIdType theSubject) -
withPatient
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withPatient(@Nullable String theSubject) -
withGroupMember
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withGroupMember(@Nullable org.hl7.fhir.instance.model.api.IIdType theMember) -
withGroupMember
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withGroupMember(@Nullable String theMember) -
withEncounter
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withEncounter(@Nullable String theEncounter) -
withPrimitiveAttribute
default <T extends org.hl7.fhir.instance.model.api.IBase> Consumer<T> withPrimitiveAttribute(String thePath, Object theValue) -
withElementAt
default <T extends org.hl7.fhir.instance.model.api.IBase,E extends org.hl7.fhir.instance.model.api.IBase> Consumer<T> withElementAt(String thePath, Consumer<E>... theModifiers) -
withQuantityAtPath
-
withElementOfType
default org.hl7.fhir.instance.model.api.IBase withElementOfType(String theElementType, Consumer<org.hl7.fhir.instance.model.api.IBase>... theModifiers) Create an Element and apply modifiers- Parameters:
theElementType- the FHIR Element type to createtheModifiers- modifiers to apply after construction- Returns:
- the Element
-
applyElementModifiers
default <E extends org.hl7.fhir.instance.model.api.IBase> void applyElementModifiers(E element, Consumer<E>[] theModifiers) -
withObservationCode
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withObservationCode(@Nullable String theSystem, @Nullable String theCode) -
withObservationCode
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withObservationCode(@Nullable String theSystem, @Nullable String theCode, @Nullable String theDisplay) -
withCodingAt
default <T extends org.hl7.fhir.instance.model.api.IBase> Consumer<T> withCodingAt(String thePath, @Nullable String theSystem, @Nullable String theValue) -
withCodingAt
-
withObservationComponent
default <T extends org.hl7.fhir.instance.model.api.IBaseResource,E extends org.hl7.fhir.instance.model.api.IBase> Consumer<T> withObservationComponent(Consumer<E>... theModifiers) -
withObservationHasMember
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withObservationHasMember(@Nullable org.hl7.fhir.instance.model.api.IIdType theHasMember) -
withOrganization
default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withOrganization(@Nullable org.hl7.fhir.instance.model.api.IIdType theHasMember) -
doCreateResource
org.hl7.fhir.instance.model.api.IIdType doCreateResource(org.hl7.fhir.instance.model.api.IBaseResource theResource) Users of this API must implement this method -
doUpdateResource
org.hl7.fhir.instance.model.api.IIdType doUpdateResource(org.hl7.fhir.instance.model.api.IBaseResource theResource) Users of this API must implement this method -
getFhirContext
ca.uhn.fhir.context.FhirContext getFhirContext()Users of this API must implement this method -
__setPrimitiveChild
static void __setPrimitiveChild(ca.uhn.fhir.context.FhirContext theFhirContext, org.hl7.fhir.instance.model.api.IBaseResource theTarget, String theElementName, String theElementType, String theValue) Name chosen to avoid potential for conflict. This is an internal API to this interface.
-