ProgramRuleVariable.fromJson constructor

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

Implementation

factory ProgramRuleVariable.fromJson(Map<String, dynamic> json) {
  return ProgramRuleVariable(
      id: json['id'],
      name: json['name'],
      displayName: json['displayName'],
      programRuleVariableSourceType: json['programRuleVariableSourceType'],
      useCodeForOptionSet: json['useCodeForOptionSet'],
      dataElement: json['dataElement'] != null
          ? json['dataElement'] is String
              ? json['dataElement']
              : json['dataElement']['id']
          : null,
      trackedEntityAttribute: json['trackedEntityAttribute'] != null
          ? json['trackedEntityAttribute'] is String
              ? json['trackedEntityAttribute']
              : json['trackedEntityAttribute']['id']
          : null,
      program: json['program'],
      option: json['option'] != null
          ? json['option'] is String
              ? json['option']
              : json['option']['id']
          : null,
      section: json['section'] != null
          ? json['section'] is String
              ? json['section']
              : json['section']['id']
          : null,
      dirty: json['dirty']);
}