TestScriptOperation.fromJson constructor

TestScriptOperation.fromJson(
  1. Map<String, dynamic> json
)

Factory constructor that accepts Map<String, dynamic> as an argument

Implementation

factory TestScriptOperation.fromJson(
  Map<String, dynamic> json,
) {
  return TestScriptOperation(
    id: JsonParser.parsePrimitive<FhirString>(
      json,
      'id',
      FhirString.fromJson,
    ),
    extension_: (json['extension'] as List<dynamic>?)
        ?.map<FhirExtension>(
          (v) => FhirExtension.fromJson(
            {...v as Map<String, dynamic>},
          ),
        )
        .toList(),
    modifierExtension: (json['modifierExtension'] as List<dynamic>?)
        ?.map<FhirExtension>(
          (v) => FhirExtension.fromJson(
            {...v as Map<String, dynamic>},
          ),
        )
        .toList(),
    type: JsonParser.parseObject<Coding>(
      json,
      'type',
      Coding.fromJson,
    ),
    resource: JsonParser.parsePrimitive<FhirUri>(
      json,
      'resource',
      FhirUri.fromJson,
    ),
    label: JsonParser.parsePrimitive<FhirString>(
      json,
      'label',
      FhirString.fromJson,
    ),
    description: JsonParser.parsePrimitive<FhirString>(
      json,
      'description',
      FhirString.fromJson,
    ),
    accept: JsonParser.parsePrimitive<FhirCode>(
      json,
      'accept',
      FhirCode.fromJson,
    ),
    contentType: JsonParser.parsePrimitive<FhirCode>(
      json,
      'contentType',
      FhirCode.fromJson,
    ),
    destination: JsonParser.parsePrimitive<FhirInteger>(
      json,
      'destination',
      FhirInteger.fromJson,
    ),
    encodeRequestUrl: JsonParser.parsePrimitive<FhirBoolean>(
      json,
      'encodeRequestUrl',
      FhirBoolean.fromJson,
    )!,
    method: JsonParser.parsePrimitive<TestScriptRequestMethodCode>(
      json,
      'method',
      TestScriptRequestMethodCode.fromJson,
    ),
    origin: JsonParser.parsePrimitive<FhirInteger>(
      json,
      'origin',
      FhirInteger.fromJson,
    ),
    params: JsonParser.parsePrimitive<FhirString>(
      json,
      'params',
      FhirString.fromJson,
    ),
    requestHeader: (json['requestHeader'] as List<dynamic>?)
        ?.map<TestScriptRequestHeader>(
          (v) => TestScriptRequestHeader.fromJson(
            {...v as Map<String, dynamic>},
          ),
        )
        .toList(),
    requestId: JsonParser.parsePrimitive<FhirId>(
      json,
      'requestId',
      FhirId.fromJson,
    ),
    responseId: JsonParser.parsePrimitive<FhirId>(
      json,
      'responseId',
      FhirId.fromJson,
    ),
    sourceId: JsonParser.parsePrimitive<FhirId>(
      json,
      'sourceId',
      FhirId.fromJson,
    ),
    targetId: JsonParser.parsePrimitive<FhirId>(
      json,
      'targetId',
      FhirId.fromJson,
    ),
    url: JsonParser.parsePrimitive<FhirString>(
      json,
      'url',
      FhirString.fromJson,
    ),
  );
}