<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_write_fields(self):
 """ Get the list of fields used to write the multi-segment header. Returns the default required fields, the user defined fields, and their dependencies. """


        # Record specification fields
        write_fields = self.get_write_subset('record')

        # Segment specification fields are all mandatory
        write_fields = write_fields + ['seg_name', 'seg_len']

        # Comments
        if self.comments !=None:
            write_fields.append('comments')
        return write_fields