def update_collections(self):
for value in record_get_field_values(self.record, '<STR_LIT>', code='<STR_LIT:a>'):<EOL><INDENT>if '<STR_LIT>' in value.upper():<EOL><INDENT>self.collections.add('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in value.upper():<EOL><INDENT>self.collections.add('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in value.upper():<EOL><INDENT>self.collections.add('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in value.upper():<EOL><INDENT>self.collections.add('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in value.upper():<EOL><INDENT>self.collections.add('<STR_LIT>')<EOL><DEDENT>elif '<STR_LIT>' in value.upper() and"<STR_LIT>" not in self.collections:<EOL><INDENT>self.collections.add('<STR_LIT>')<EOL>if self.is_published() and "<STR_LIT>" not in self.collections:<EOL><INDENT>self.collections.add('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>self.collections.add('<STR_LIT>')<EOL><DEDENT><DEDENT>if "<STR_LIT>" in value.upper():<EOL><INDENT>self.hidden = True<EOL><DEDENT><DEDENT>record_delete_fields(self.record, "<STR_LIT>")<EOL>if not self.collections:<EOL><INDENT>self.collections.add('<STR_LIT>')<EOL><DEDENT>for collection in self.collections:<EOL><INDENT>record_add_field(self.record,<EOL>tag='<STR_LIT>',<EOL>subfields=[('<STR_LIT:a>', collection)])<EOL>if collection in self.collection_base:<EOL><INDENT>subs = [('<STR_LIT:a>', self.collection_base[collection])]<EOL>record_add_field(self.record,<EOL>tag='<STR_LIT>',<EOL>subfields=subs)<EOL><DEDENT><DEDENT>
Try to determine which collections this record should belong to.