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.
  • Field Details

    • ourLog

      static final org.slf4j.Logger ourLog
  • Method Details

    • withActiveTrue

      default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withActiveTrue()
      Set Patient.active = true
    • withActiveFalse

      default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withActiveFalse()
      Set Patient.active = false
    • withFamily

      default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withFamily(String theFamily)
    • withGiven

      default <T extends org.hl7.fhir.instance.model.api.IBaseResource> Consumer<T> withGiven(String theName)
      Patient.name.given
    • withBirthdate

      default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withBirthdate(String theBirthdate)
      Set Patient.birthdate
    • withStatus

      default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withStatus(String theStatus)
      Set Observation.status
    • withEffectiveDate

      default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withEffectiveDate(String theDate)
      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

      default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withName(String theStatus)
      Set Organization.name
    • withId

      default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withId(String theId)
    • withId

      default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withId(org.hl7.fhir.instance.model.api.IIdType theId)
    • withTag

      default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withTag(String theSystem, String theCode)
    • withSecurity

      default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withSecurity(String theSystem, String theCode)
    • withProfile

      default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withProfile(String theProfile)
    • 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

      default Consumer<org.hl7.fhir.instance.model.api.IBaseResource> withLastUpdated(String theIsoDate)
    • 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

      default <T extends org.hl7.fhir.instance.model.api.IBase> Consumer<T> withQuantityAtPath(String thePath, Number theValue, String theSystem, String theCode)
    • 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 create
      theModifiers - 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

      default <T extends org.hl7.fhir.instance.model.api.IBase> Consumer<T> withCodingAt(String thePath, @Nullable String theSystem, @Nullable String theValue, @Nullable String theDisplay)
    • 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.