createPatient method

Future<EncryptedPatient> createPatient(
  1. String sdkId,
  2. EncryptedPatient patient
)

Implementation

Future<EncryptedPatient> createPatient(String sdkId, EncryptedPatient patient) async {
	final res = await _methodChannel.invokeMethod<String>(
		'PatientBasicApi.createPatient',
		{
			"sdkId": sdkId,
			"patient": jsonEncode(EncryptedPatient.encode(patient)),
		}
	).catchError(convertPlatformException);
	if (res == null) throw AssertionError("received null result from platform method createPatient");
	final parsedResJson = jsonDecode(res);
	return EncryptedPatient.fromJSON(parsedResJson);
}