toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  json[r'id'] = id;
  if (rev != null) {
    json[r'rev'] = rev;
  }
  if (created != null) {
    json[r'created'] = created;
  }
  if (modified != null) {
    json[r'modified'] = modified;
  }
  if (author != null) {
    json[r'author'] = author;
  }
  if (responsible != null) {
    json[r'responsible'] = responsible;
  }
  if (medicalLocationId != null) {
    json[r'medicalLocationId'] = medicalLocationId;
  }
  json[r'tags'] = tags.toList();

  json[r'codes'] = codes.toList();

  if (endOfLife != null) {
    json[r'endOfLife'] = endOfLife;
  }
  if (deletionDate != null) {
    json[r'deletionDate'] = deletionDate;
  }
  if (fromAddress != null) {
    json[r'fromAddress'] = fromAddress;
  }
  if (fromHealthcarePartyId != null) {
    json[r'fromHealthcarePartyId'] = fromHealthcarePartyId;
  }
  if (formId != null) {
    json[r'formId'] = formId;
  }
  if (status != null) {
    json[r'status'] = status;
  }
  if (recipientsType != null) {
    json[r'recipientsType'] = recipientsType;
  }
  json[r'recipients'] = recipients.toList();
  json[r'toAddresses'] = toAddresses.toList();
  if (received != null) {
    json[r'received'] = received;
  }
  if (sent != null) {
    json[r'sent'] = sent;
  }
  json[r'metas'] = metas;
  json[r'readStatus'] = readStatus;
  if (transportGuid != null) {
    json[r'transportGuid'] = transportGuid;
  }
  if (remark != null) {
    json[r'remark'] = remark;
  }
  if (conversationGuid != null) {
    json[r'conversationGuid'] = conversationGuid;
  }
  if (subject != null) {
    json[r'subject'] = subject;
  }
  json[r'invoiceIds'] = invoiceIds.toList();
  if (parentId != null) {
    json[r'parentId'] = parentId;
  }
  if (externalRef != null) {
    json[r'externalRef'] = externalRef;
  }
  json[r'unassignedResults'] = unassignedResults.toList();
  json[r'assignedResults'] = assignedResults;
  json[r'senderReferences'] = senderReferences;
  json[r'secretForeignKeys'] = secretForeignKeys.toList();
  json[r'cryptedForeignKeys'] = cryptedForeignKeys.map((k, v) => MapEntry(k, v.toList()));
  json[r'delegations'] = delegations.map((k, v) => MapEntry(k, v.toList()));
  json[r'encryptionKeys'] = encryptionKeys.map((k, v) => MapEntry(k, v.toList()));
  if (encryptedSelf != null) {
    json[r'encryptedSelf'] = encryptedSelf;
  }
  return json;
}