allergyIntoleranceRequest function

Future<Resource?> allergyIntoleranceRequest(
  1. UsCoreRequestType requestType,
  2. Uri base,
  3. String id, {
  4. String? reference,
  5. Id? patientId,
  6. AllergyIntoleranceClinicalStatus? clinicalStatus,
  7. bool? getProvenanceResources,
  8. Map<String, String>? headers,
  9. Resource? resource,
  10. Id? vid,
  11. Client? client,
  12. List<String> parameters = const <String>[],
  13. int? count,
  14. Instant? since,
  15. FhirDateTime? at,
})

Implementation

Future<Resource?> allergyIntoleranceRequest(
  UsCoreRequestType requestType,
  Uri base,
  String id, {
  String? reference,
  Id? patientId,
  AllergyIntoleranceClinicalStatus? clinicalStatus,
  bool? getProvenanceResources,
  Map<String, String>? headers,
  Resource? resource,
  Id? vid,
  Client? client,
  List<String> parameters = const <String>[],
  int? count,
  Instant? since,
  FhirDateTime? at,
}) async {
  if (patientId != null) {
    parameters.add('patient=$patientId');
  }
  if (clinicalStatus != null) {
    parameters.add(
        'clinical-status=http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical'
        '|${codeFromAllergyIntoleranceClinicalStatus[clinicalStatus]}');
  }
  if (getProvenanceResources ?? false) {
    parameters.add('_revinclude=Provenance:target');
  }
  return await makeRequest(
    requestType,
    base,
    R4ResourceType.AllergyIntolerance,
    id,
    resource: resource,
    headers: headers,
    vid: vid,
    client: client,
    parameters: parameters,
    count: count,
    since: since,
    at: at,
    reference: reference,
  );
}