Implementation
static Map<String, dynamic> encode(DecryptedPatient value) {
Map<String, dynamic> entityAsMap = {
"id" : value.id,
"identifier" : value.identifier.map((x0) => Identifier.encode(x0)).toList(),
"rev" : value.rev,
"created" : value.created,
"modified" : value.modified,
"author" : value.author,
"responsible" : value.responsible,
"tags" : value.tags.map((x0) => CodeStub.encode(x0)).toList(),
"codes" : value.codes.map((x0) => CodeStub.encode(x0)).toList(),
"endOfLife" : value.endOfLife,
"deletionDate" : value.deletionDate,
"firstName" : value.firstName,
"lastName" : value.lastName,
"names" : value.names.map((x0) => PersonName.encode(x0)).toList(),
"companyName" : value.companyName,
"languages" : value.languages.map((x0) => x0).toList(),
"addresses" : value.addresses.map((x0) => DecryptedAddress.encode(x0)).toList(),
"civility" : value.civility,
"gender" : value.gender == null ? null : Gender.encode(value.gender!),
"birthSex" : value.birthSex == null ? null : Gender.encode(value.birthSex!),
"mergeToPatientId" : value.mergeToPatientId,
"mergedIds" : value.mergedIds.map((x0) => x0).toList(),
"alias" : value.alias,
"active" : value.active,
"deactivationReason" : DeactivationReason.encode(value.deactivationReason),
"deactivationDate" : value.deactivationDate,
"ssin" : value.ssin,
"maidenName" : value.maidenName,
"spouseName" : value.spouseName,
"partnerName" : value.partnerName,
"personalStatus" : value.personalStatus == null ? null : PersonalStatus.encode(value.personalStatus!),
"dateOfBirth" : value.dateOfBirth,
"dateOfDeath" : value.dateOfDeath,
"timestampOfLatestEidReading" : value.timestampOfLatestEidReading,
"placeOfBirth" : value.placeOfBirth,
"placeOfDeath" : value.placeOfDeath,
"deceased" : value.deceased,
"education" : value.education,
"profession" : value.profession,
"notes" : value.notes.map((x0) => Annotation.encode(x0)).toList(),
"note" : value.note,
"administrativeNote" : value.administrativeNote,
"nationality" : value.nationality,
"race" : value.race,
"ethnicity" : value.ethnicity,
"preferredUserId" : value.preferredUserId,
"picture" : value.picture == null ? null : base64Encode(value.picture as List<int>),
"externalId" : value.externalId,
"insurabilities" : value.insurabilities.map((x0) => DecryptedInsurability.encode(x0)).toList(),
"partnerships" : value.partnerships.map((x0) => Partnership.encode(x0)).toList(),
"patientHealthCareParties" : value.patientHealthCareParties.map((x0) => DecryptedPatientHealthCareParty.encode(x0)).toList(),
"financialInstitutionInformation" : value.financialInstitutionInformation.map((x0) => DecryptedFinancialInstitutionInformation.encode(x0)).toList(),
"medicalHouseContracts" : value.medicalHouseContracts.map((x0) => DecryptedMedicalHouseContract.encode(x0)).toList(),
"patientProfessions" : value.patientProfessions.map((x0) => CodeStub.encode(x0)).toList(),
"parameters" : value.parameters.map((k0, v0) => MapEntry(k0, v0.map((x1) => x1).toList())),
"properties" : value.properties.map((x0) => DecryptedPropertyStub.encode(x0)).toList(),
"hcPartyKeys" : value.hcPartyKeys.map((k0, v0) => MapEntry(k0, v0.map((x1) => x1).toList())),
"aesExchangeKeys" : value.aesExchangeKeys.map((k0, v0) => MapEntry(k0, v0.map((k1, v1) => MapEntry(k1, v1.map((k2, v2) => MapEntry(k2, v2)))))),
"transferKeys" : value.transferKeys.map((k0, v0) => MapEntry(k0, v0.map((k1, v1) => MapEntry(k1, v1)))),
"privateKeyShamirPartitions" : value.privateKeyShamirPartitions.map((k0, v0) => MapEntry(k0, v0)),
"publicKey" : value.publicKey,
"publicKeysForOaepWithSha256" : value.publicKeysForOaepWithSha256.map((x0) => x0).toList(),
"secretForeignKeys" : value.secretForeignKeys.map((x0) => x0).toList(),
"cryptedForeignKeys" : value.cryptedForeignKeys.map((k0, v0) => MapEntry(k0, v0.map((x1) => Delegation.encode(x1)).toList())),
"delegations" : value.delegations.map((k0, v0) => MapEntry(k0, v0.map((x1) => Delegation.encode(x1)).toList())),
"encryptionKeys" : value.encryptionKeys.map((k0, v0) => MapEntry(k0, v0.map((x1) => Delegation.encode(x1)).toList())),
"encryptedSelf" : value.encryptedSelf,
"securityMetadata" : value.securityMetadata == null ? null : SecurityMetadata.encode(value.securityMetadata!),
"medicalLocationId" : value.medicalLocationId,
"nonDuplicateIds" : value.nonDuplicateIds.map((x0) => x0).toList(),
"encryptedAdministrativesDocuments" : value.encryptedAdministrativesDocuments.map((x0) => x0).toList(),
"comment" : value.comment,
"warning" : value.warning,
"fatherBirthCountry" : value.fatherBirthCountry == null ? null : CodeStub.encode(value.fatherBirthCountry!),
"birthCountry" : value.birthCountry == null ? null : CodeStub.encode(value.birthCountry!),
"nativeCountry" : value.nativeCountry == null ? null : CodeStub.encode(value.nativeCountry!),
"socialStatus" : value.socialStatus == null ? null : CodeStub.encode(value.socialStatus!),
"mainSourceOfIncome" : value.mainSourceOfIncome == null ? null : CodeStub.encode(value.mainSourceOfIncome!),
"schoolingInfos" : value.schoolingInfos.map((x0) => SchoolingInfo.encode(x0)).toList(),
"employementInfos" : value.employementInfos.map((x0) => EmploymentInfo.encode(x0)).toList()
};
return entityAsMap;
}