FhirRequest.operation constructor

const FhirRequest.operation({
  1. required Uri base,
  2. Stu3ResourceType? type,
  3. String? fhirId,
  4. @Default(false) bool pretty,
  5. @Default(Summary.none) Summary summary,
  6. @Default('json') String format,
  7. @Default(<String>[]) List<String> elements,
  8. @Default(<String>[]) List<String> parameters,
  9. Parameters? fhirParameter,
  10. required String operation,
  11. @Default(false) bool usePost,
  12. @Default(false) bool useFormData,
  13. MimeType? mimeType,
  14. @Default('application/fhir+json') String accept,
  15. @JsonKey(includeFromJson: false, includeToJson: false) Client? client,
  16. Map<String, String>? headers,
})

OPERATION constructor base - the base URI for the FHIR server type - the type of resource you're looking for fhirId - the id for the resource pretty - pretty print the json formatting in the response summary - do you want the result to be a summary format - currently requests json, but could consider requesting json+fhir or fhir+json (would not request XML as this library doesn't work with XML) elements - elements you need to pass in parameters - any extra parameters fhirParameter - any extra fhirParameters usePost - defines if you would prefer to use a post request instead of Get mimeType - specify the MimeType in the Header - this should be fhir+json but there are some older systems that won't accept that client - if there's a specific client that you're going to be using

Implementation

const factory FhirRequest.operation({
  /// [base] - the base URI for the FHIR server
  required Uri base,
  Stu3ResourceType? type,
  String? fhirId,

  /// [pretty] - pretty print the json formatting in the response
  @Default(false) bool pretty,

  /// [summary] - do you want the result to be a summary
  @Default(Summary.none) Summary summary,

  /// [format] - currently requests json, but could consider requesting
  ///   json+fhir or fhir+json (would not request XML as this library doesn't
  ///   work with XML)
  @Default('json') String format,

  /// [elements] - elements you need to pass in
  @Default(<String>[]) List<String> elements,

  /// [parameters] - any extra parameters
  @Default(<String>[]) List<String> parameters,

  /// [fhirParameter] any extra fhirParameters
  Parameters? fhirParameter,
  required String operation,

  /// [usePost] - defines if you would prefer to use a post request instead of
  ///   a get request for this search
  @Default(false) bool usePost,
  @Default(false) bool useFormData,

  /// [mimeType] - specify the MimeType in the Header - this should be fhir+json
  ///   but there are some older systems that won't accept that
  MimeType? mimeType,

  /// [accept] - this will default to fhir+json just so it will stop sending
  /// me XML - I hate XML
  @Default('application/fhir+json') String accept,

  /// [client] - if there's a specific client that you're going to be using
  // ignore: invalid_annotation_target
  @JsonKey(includeFromJson: false, includeToJson: false) Client? client,

  /// [headers] - because there are some times it's easier to incldue the
  /// headers in the object instead of only passing it in with the
  /// request
  Map<String, String>? headers,
}) = FhirOperationRequest;