toJson method

Map<String, Object?> toJson()

Converts the Test instance to a JSON map.

Returns a map containing the test data.

Implementation

Map<String, Object?> toJson() {
  return {
    'documentId': documentId,
    'motherId': motherId,
    'deviceId': deviceId,
    'doctorId': doctorId,
    'weight': weight,
    'gAge': gAge,
    'fisherScore': fisherScore,
    'fisherScore2': fisherScore2,
    'motherName': motherName,
    'deviceName': deviceName,
    'doctorName': doctorName,
    'patientId': patientId,
    'organizationId': organizationId,
    'organizationName': organizationName,
    'audioLocalPath': audioLocalPath,
    'bpmEntries': bpmEntries,
    'bpmEntries2': bpmEntries2,
    'mhrEntries': mhrEntries,
    'spo2Entries': spo2Entries,
    'baseLineEntries': baseLineEntries,
    'movementEntries': movementEntries,
    'autoFetalMovement': autoFetalMovement,
    'tocoEntries': tocoEntries,
    'lengthOfTest': lengthOfTest,
    'averageFHR': averageFHR,
    'live': live ?? false,
    'testByMother': testByMother,
    'testById': testById,
    'interpretationType': interpretationType,
    'interpretationExtraComments': interpretationExtraComments,
    'association': associations,
    'autoInterpretations': autoInterpretations,
    'type': "test",
    'delete': delete,
    'createdOn': createdOn!.millisecondsSinceEpoch,
    'createdBy': createdBy,
  };
}