toDbJson method

Map<String, dynamic> toDbJson()

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

Implementation

Map<String, dynamic> toDbJson() {
  final json = toJson();

  /// Again, for the database, the primary id is an integer, normally stored as dbId
  json['id'] = dbId;

  /// The fhirId, usually stored in json as id, in the database is going to be fhirId
  json['fhirId'] = fhirId;
  return json;
}