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'],
      dirty: json['dirty']);
}