toPatient method

Patient toPatient()

Implementation

Patient toPatient() =>
    Patient(
        id: this.id,
        identifiers: this.identifier.map((it) => it.toIdentifier()).toList(),
        labels: this.tags.map((it) => it.toCodingReference()).toSet(),
        codes: this.codes.map((it) => it.toCodingReference()).toSet(),
        names: this.names.map((it) => it.toPersonName()).toList(),
        languages: this.languages,
        addresses: this.addresses.map((it) => it.toAddress()).toList(),
        mergedIds: this.mergedIds,
        active: this.active,
        deactivationReason: this.deactivationReason.toDeactivationReason(),
        partnerships: this.partnerships.map((it) => it.toPartnership()).toList(),
        patientHealthCareParties: this.patientHealthCareParties.map((it) => it.toPatientHealthCareParty()).toList(),
        patientProfessions: this.patientProfessions.map((it) => it.toCodingReference()).toList(),
        parameters: this.parameters,
        properties: this.properties.map((it) => it.toProperty()).toSet(),
        rev: this.rev,
        created: this.created,
        modified: this.modified,
        author: this.author,
        responsible: this.responsible,
        endOfLife: this.endOfLife,
        deletionDate: this.deletionDate,
        firstName: this.firstName,
        lastName: this.lastName,
        companyName: this.companyName,
        civility: this.civility,
        gender: this.gender?.toGender(),
        birthSex: this.birthSex?.toBirthSex(),
        mergeToPatientId: this.mergeToPatientId,
        alias: this.alias,
        ssin: this.ssin,
        maidenName: this.maidenName,
        spouseName: this.spouseName,
        partnerName: this.partnerName,
        personalStatus: this.personalStatus?.toPersonalStatus(),
        dateOfBirth: this.dateOfBirth,
        dateOfDeath: this.dateOfDeath,
        placeOfBirth: this.placeOfBirth,
        placeOfDeath: this.placeOfDeath,
        deceased: this.deceased,
        education: this.education,
        profession: this.profession,
        note: this.note,
        administrativeNote: this.administrativeNote,
        nationality: this.nationality,
        race: this.race,
        ethnicity: this.ethnicity,
        picture: this.picture,
        externalId: this.externalId,
        systemMetaData: SystemMetaDataOwnerEncrypted(
          publicKey: this.publicKey,
          hcPartyKeys: this.hcPartyKeys,
          privateKeyShamirPartitions: this.privateKeyShamirPartitions,
          secretForeignKeys: this.secretForeignKeys.toList(),
          cryptedForeignKeys: this.cryptedForeignKeys.map((k, v) => MapEntry(k, v.map((it) => it.toDelegation()).toList())) ,
          delegations: this.delegations.map((k, v) => MapEntry(k, v.map((it) => it.toDelegation()).toList())),
          encryptionKeys: this.encryptionKeys.map((k, v) => MapEntry(k, v.map((it) => it.toDelegation()).toList())),
          aesExchangeKeys: this.aesExchangeKeys,
          transferKeys: this.transferKeys,
          encryptedSelf: this.encryptedSelf
        )
    );