SMART on FHIR Python Client  3.0.0
fhirclient.models.fhirabstractbase.FHIRAbstractBase Class Reference

Abstract base class for all FHIR elements. More...

Inheritance diagram for fhirclient.models.fhirabstractbase.FHIRAbstractBase:
fhirclient.models.element.Element fhirclient.models.fhirabstractresource.FHIRAbstractResource fhirclient.models.address.Address fhirclient.models.annotation.Annotation fhirclient.models.attachment.Attachment fhirclient.models.backboneelement.BackboneElement fhirclient.models.codeableconcept.CodeableConcept fhirclient.models.coding.Coding fhirclient.models.contactdetail.ContactDetail fhirclient.models.contactpoint.ContactPoint fhirclient.models.contributor.Contributor fhirclient.models.datarequirement.DataRequirement fhirclient.models.datarequirement.DataRequirementCodeFilter fhirclient.models.datarequirement.DataRequirementDateFilter fhirclient.models.dosage.Dosage fhirclient.models.elementdefinition.ElementDefinition fhirclient.models.elementdefinition.ElementDefinitionBase fhirclient.models.elementdefinition.ElementDefinitionBinding fhirclient.models.elementdefinition.ElementDefinitionConstraint fhirclient.models.elementdefinition.ElementDefinitionExample fhirclient.models.elementdefinition.ElementDefinitionMapping fhirclient.models.elementdefinition.ElementDefinitionSlicing fhirclient.models.elementdefinition.ElementDefinitionSlicingDiscriminator fhirclient.models.elementdefinition.ElementDefinitionType fhirclient.models.extension.Extension fhirclient.models.humanname.HumanName fhirclient.models.identifier.Identifier fhirclient.models.meta.Meta fhirclient.models.narrative.Narrative fhirclient.models.parameterdefinition.ParameterDefinition fhirclient.models.period.Period fhirclient.models.quantity.Quantity fhirclient.models.range.Range fhirclient.models.ratio.Ratio fhirclient.models.reference.Reference fhirclient.models.relatedartifact.RelatedArtifact fhirclient.models.sampleddata.SampledData fhirclient.models.signature.Signature fhirclient.models.timing.Timing fhirclient.models.timing.TimingRepeat fhirclient.models.triggerdefinition.TriggerDefinition fhirclient.models.usagecontext.UsageContext fhirclient.models.resource.Resource

Public Member Functions

def __init__ (self, jsondict=None, strict=True)
 Initializer. More...
 
def with_json (cls, jsonobj)
 Initialize an element from a JSON dictionary or array. More...
 
def with_json_and_owner (cls, jsonobj, owner)
 Instantiates by forwarding to with_json(), then remembers the "owner" of the instantiated elements. More...
 
def elementProperties (self)
 Returns a list of tuples, one tuple for each property that should be serialized, as: ("name", "json_name", type, is_list, "of_many", not_optional) More...
 
def update_with_json (self, jsondict)
 Update the receiver with data in a JSON dictionary. More...
 
def as_json (self)
 Serializes to JSON by inspecting elementProperties() and creating a JSON dictionary of all registered properties. More...
 
def owningResource (self)
 Walks the owner hierarchy and returns the next parent that is a DomainResource instance. More...
 
def owningBundle (self)
 Walks the owner hierarchy and returns the next parent that is a Bundle instance. More...
 
def resolvedReference (self, refid)
 Returns the resolved reference with the given id, if it has been resolved already. More...
 
def didResolveReference (self, refid, resolved)
 Called by FHIRResource when it resolves a reference. More...
 

Detailed Description

Abstract base class for all FHIR elements.

Constructor & Destructor Documentation

def fhirclient.models.fhirabstractbase.FHIRAbstractBase.__init__ (   self,
  jsondict = None,
  strict = True 
)

Initializer.

If strict is true, raises on errors, otherwise uses logger.warning().

:raises: FHIRValidationError on validation errors, unless strict is False :param dict jsondict: A JSON dictionary to use for initialization :param bool strict: If True (the default), invalid variables will raise a TypeError

Member Function Documentation

def fhirclient.models.fhirabstractbase.FHIRAbstractBase.as_json (   self)

Serializes to JSON by inspecting elementProperties() and creating a JSON dictionary of all registered properties.

Checks:

   - whether required properties are not None (and lists not empty)
   - whether not-None properties are of the correct type

   :raises: FHIRValidationError if properties have the wrong type or if
       required properties are empty
   :returns: A validated dict object that can be JSON serialized
def fhirclient.models.fhirabstractbase.FHIRAbstractBase.didResolveReference (   self,
  refid,
  resolved 
)

Called by FHIRResource when it resolves a reference.

Stores the resolved reference into the _resolved dictionary.

:param refid: The id of the resource that was resolved :param refid: The resolved resource, ready to be cached

def fhirclient.models.fhirabstractbase.FHIRAbstractBase.elementProperties (   self)

Returns a list of tuples, one tuple for each property that should be serialized, as: ("name", "json_name", type, is_list, "of_many", not_optional)

def fhirclient.models.fhirabstractbase.FHIRAbstractBase.owningBundle (   self)

Walks the owner hierarchy and returns the next parent that is a Bundle instance.

def fhirclient.models.fhirabstractbase.FHIRAbstractBase.owningResource (   self)

Walks the owner hierarchy and returns the next parent that is a DomainResource instance.

def fhirclient.models.fhirabstractbase.FHIRAbstractBase.resolvedReference (   self,
  refid 
)

Returns the resolved reference with the given id, if it has been resolved already.

If it hasn't, forwards the call to its owner if it has one.

You should probably use resolve() on the FHIRReference itself.

:param refid: The id of the resource to resolve :returns: An instance of Resource, if it was found

def fhirclient.models.fhirabstractbase.FHIRAbstractBase.update_with_json (   self,
  jsondict 
)

Update the receiver with data in a JSON dictionary.

:raises: FHIRValidationError on validation errors :param dict jsondict: The JSON dictionary to use to update the receiver :returns: None on success, a list of errors if there were errors

def fhirclient.models.fhirabstractbase.FHIRAbstractBase.with_json (   cls,
  jsonobj 
)

Initialize an element from a JSON dictionary or array.

If the JSON dictionary has a "resourceType" entry and the specified resource type is not the receiving classes type, uses FHIRElementFactory to return a correct class instance.

:raises: TypeError on anything but dict or list of dicts :raises: FHIRValidationError if instantiation fails :param jsonobj: A dict or list of dicts to instantiate from :returns: An instance or a list of instances created from JSON data

def fhirclient.models.fhirabstractbase.FHIRAbstractBase.with_json_and_owner (   cls,
  jsonobj,
  owner 
)

Instantiates by forwarding to with_json(), then remembers the "owner" of the instantiated elements.

The "owner" is the resource containing the receiver and is used to resolve contained resources.

:raises: TypeError on anything but dict or list of dicts :raises: FHIRValidationError if instantiation fails :param dict jsonobj: Decoded JSON dictionary (or list thereof) :param FHIRElement owner: The owning parent :returns: An instance or a list of instances created from JSON data


The documentation for this class was generated from the following file: