netreconlab / parse-hipaa

HIPAA & GDPR compliant ready parse-server with postgres/mongo, parse-hipaa-dashboard. Compatible with ParseCareKit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error saving patient allergies

haydenfree opened this issue · comments

When saving patient allergies I get the following error:
Error in Patient.save(). ParseError(code: ParseSwift.ParseError.Code.incorrectType, message: "schema mismatch for Patient.allergies; expected String but got Array")

Here is the full error log, ["dairy"] is the array I am trying to pass in as patient.allergies

Successfully updated patient
Finished pulling default revision classes
Error in Patient.updateCloud(). UUID already exists in Cloud
2020-11-30 15:05:42.557690-0500 OCKSample[29906:1015906] [CareKitStore] Failed to automatically synchronize.
2020-11-30 15:05:42.557895-0500 OCKSample[29906:1015906] [CareKitStore] Error: Can't sync, the uuid already exists in the Cloud
Error in Patient.save(). ParseError(code: ParseSwift.ParseError.Code.incorrectType, message: "schema mismatch for Patient.allergies; expected String but got Array")
2020-11-30 15:05:42.636285-0500 OCKSample[29906:1015906] [CareKitStore] Failed to automatically synchronize.
2020-11-30 15:05:42.639837-0500 OCKSample[29906:1015906] [CareKitStore] Error: The operation couldn’t be completed. (ParseSwift.ParseError error 1.)
2020-11-30 15:05:42.666434-0500 OCKSample[29906:1015852] [WC] WCSession is not paired
2020-11-30 15:05:42.666712-0500 OCKSample[29906:1015852] [WC] -[WCSession _onqueue_notifyOfMessageError:messageID:withErrorHandler:] (null) errorHandler: YES with WCErrorCodeDeviceNotPaired
2020-11-30 15:05:42.667092-0500 OCKSample[29906:1015150] [WC] -[WCSession _onqueue_notifyOfMessageError:messageID:withErrorHandler:]_block_invoke dropping as pairingIDs no longer match. pairingID (null), client pairingID: (null)
Device is not paired.

If I try to do patientToUpdate.allergies = allergicTo[0], which is trying to set allergies the String "dairy", I get an error in Xcode: Cannot assign value of type 'String' to type '[String]'