updateAllergyMutationVariables function

Map<String, dynamic> updateAllergyMutationVariables(
  1. AllergyIntolerance payload,
  2. String reason
)

Implementation

Map<String, dynamic> updateAllergyMutationVariables(
    AllergyIntolerance payload, String reason) {
  final AllergyIntolerance payloadWithStatusUpdate = payload.copyWith.call(
    clinicalStatus: payload.clinicalStatus!.copyWith(
      coding: <Coding>[
        payload.clinicalStatus!.coding!.first!.copyWith.call(
          display: 'Resolved',
          code: 'resolved',
          userSelected: true,
        )
      ],
      text: 'Resolved',
    ),
  );

  return <String, dynamic>{'input': payloadWithStatusUpdate.toJson()};
}