parameters: (self, field_name: str,
                               field: descriptor.FieldDescriptor,
                               value: Any)
docstring: Prints the primitive field.
  
      Args:
        field_name: The name of the field.
        field: The FielDescriptor whose contents to print.
        value: The value present at field to print.
docstring_summary: Prints the primitive field.
docstring_tokens: Prints the primitive field .
function: def _print_primitive_field(self, field_name: str,
                               field: descriptor.FieldDescriptor,
                               value: Any) -> None:
      """Prints the primitive field.
  
      Args:
        field_name: The name of the field.
        field: The FielDescriptor whose contents to print.
        value: The value present at field to print.
      """
      if proto_utils.field_is_repeated(field):
        string_values = []
        elements = []
        extensions_found = False
        nonnull_values_found = False
        for primitive in value:
          wrapper = self.primitive_handler.primitive_wrapper_from_primitive(
              primitive)
          string_values.append(wrapper.json_value())
          elements.append(wrapper.get_element())
          nonnull_values_found = nonnull_values_found or wrapper.has_value()
          extensions_found = extensions_found or wrapper.has_element()
  
        # print string primitive representations
        if nonnull_values_found:
          self.generator.add_field(field_name)
          self._print_list(string_values, self.generator.push)
  
        # print Element representations
        if extensions_found:
          if nonnull_values_found:
            self.generator.push(',')
            self.generator.add_newline()
          self.generator.add_field(f'_{field_name}')
          self._print_list(elements, self._print)
      else:  # Singular field
        # TODO: Detect ReferenceId using an annotation
        if (self.json_format == _FhirJsonFormat.ANALYTIC and
            field.message_type.name == 'ReferenceId'):
          str_value = proto_utils.get_value_at_field(value, 'value')
          self.generator.add_field(field_name, f'"{str_value}"')
        else:  # Wrap and print primitive value and (optionally), its element
          wrapper = self.primitive_handler.primitive_wrapper_from_primitive(value)
          if wrapper.has_value():
            self.generator.add_field(field_name, wrapper.json_value())
          if wrapper.has_element() and self.json_format == _FhirJsonFormat.PURE:
            if wrapper.has_value():
              self.generator.push(',')
              self.generator.add_newline()
            self.generator.add_field(f'_{field_name}')
            self._print(wrapper.get_element())
function_tokens: def _print_primitive_field ( self , field_name : str , field : descriptor . FieldDescriptor , value : Any ) -> None : if proto_utils . field_is_repeated ( field ) : string_values = [ ] elements = [ ] extensions_found = False nonnull_values_found = False for primitive in value : wrapper = self . primitive_handler . primitive_wrapper_from_primitive ( primitive ) string_values . append ( wrapper . json_value ( ) ) elements . append ( wrapper . get_element ( ) ) nonnull_values_found = nonnull_values_found or wrapper . has_value ( ) extensions_found = extensions_found or wrapper . has_element ( ) # print string primitive representations if nonnull_values_found : self . generator . add_field ( field_name ) self . _print_list ( string_values , self . generator . push ) # print Element representations if extensions_found : if nonnull_values_found : self . generator . push ( ',' ) self . generator . add_newline ( ) self . generator . add_field ( f'_{field_name}' ) self . _print_list ( elements , self . _print ) else : # Singular field # TODO: Detect ReferenceId using an annotation if ( self . json_format == _FhirJsonFormat . ANALYTIC and field . message_type . name == 'ReferenceId' ) : str_value = proto_utils . get_value_at_field ( value , 'value' ) self . generator . add_field ( field_name , f'"{str_value}"' ) else : # Wrap and print primitive value and (optionally), its element wrapper = self . primitive_handler . primitive_wrapper_from_primitive ( value ) if wrapper . has_value ( ) : self . generator . add_field ( field_name , wrapper . json_value ( ) ) if wrapper . has_element ( ) and self . json_format == _FhirJsonFormat . PURE : if wrapper . has_value ( ) : self . generator . push ( ',' ) self . generator . add_newline ( ) self . generator . add_field ( f'_{field_name}' ) self . _print ( wrapper . get_element ( ) )