Resource class abstract mixin

This class ends up functioning mostly like an abstract superclass. Some of the fields in other classes contain a generic resource, so in order for them to be able to implement a resource.toJson() function, it also has to be implemented here (although it is always overridden). Each resource class also has it's own fromJson() function as well. The fromJson function in this class is only used if the resourceType is not previously known

Implementers
Annotations
  • @JsonSerializable()

Constructors

Resource()

Properties

contained List<Resource>?
no setter
dbId int?
no setter
extension_ List<FhirExtension>?
no setter
fhirId String?
no setter
hashCode int
The hash code for this object.
no setterinherited
implicitRules FhirUri?
no setter
implicitRulesElement Element?
no setter
language FhirCode?
no setter
languageElement Element?
no setter
meta FhirMeta?
no setter
modifierExtension List<FhirExtension>?
no setter
path String
Local Reference for this Resource, form is "ResourceType/Id"
no setter
resourceType R4ResourceType?
no setter
resourceTypeString String?
produce a string of the resourceType
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text Narrative?
no setter
thisReference Reference
Convenience method to return a Reference referring to that Resource
no setter

Methods

newId() Resource
returns the same resource with a new ID (even if there is already an ID present)
newIdIfNoId() Resource
returns the same resource with a new ID if there is no current ID
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDbJson() Map<String, dynamic>
The normal toJson ignores the dbId, and produces the fhirId as the id However, if you're going to use this as a database entry, you have to switch those two ids
toJson() Map<String, dynamic>
Returns a Map<String, dynamic> of the Resource
toJsonString() String
Another convenience method because more and more I'm transmitting FHIR data as a String and not a Map
toString() String
A string representation of this object.
inherited
toYaml() String
Produces a Yaml formatted String version of the object
updateVersion({FhirMeta? oldMeta}) Resource
Updates the meta field of this Resource, updates the meta.lastUpdated field, adds 1 to the version number

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromDbJson(Map<String, dynamic> json) Resource
Likewise, if you're using one of those DBs, then you may need to get that resource back, and so we'll need to switch those IDs back before we turn them into a Dart class again
fromJson(Map<String, dynamic> json) Resource
Acts like a constructor, returns a Resource, accepts a Map<String, Dynamic> as an argument
fromJsonString(String source) Resource
Acts like a constructor, returns a Resource, accepts a String as an argument, mostly because I got tired of typing it out
fromXml(String xmlString) Resource
I don't like XML. However, there appears to be times when it's unavoidable. Thus, I'm going to include this so that we can work with it, yuck.
fromYaml(dynamic yaml) Resource
Returns a Resource, accepts a String in YAML format as an argument
resourceTypeFromString(String type) R4ResourceType?
resourceTypeToString(R4ResourceType type) String