function rollBackClassMembership( $rollBackAction, $classMembershipId, $classId, $classMemberId, $operation ) {
	if ( shouldRemove( $rollBackAction, $operation ) ) {
		removeClassMembershipWithId( $classMembershipId );
	}
	elseif ( shouldRestore( $rollBackAction, $operation ) ) {
		addClassMembership( $classMemberId, $classId );
	}
}
	public function getOrCreateECNumberMeaningId( $EC ) {
		if ( array_key_exists( $EC, $this->ECNumbers ) ) {
			$definedMeaningId = $this->ECNumbers[$EC];
		}
		elseif ( array_key_exists( $EC, $this->EC2GoMeaningIdMapping ) ) {
			$definedMeaningId = $this->EC2GoMeaningIdMapping[$EC];
			$this->ECNumbers[$EC] = $definedMeaningId;
			$expression = $this->getOrCreateExpression( $EC );
			$expression->assureIsBoundToDefinedMeaning( $definedMeaningId, true );
		}
		else {
			$definedMeaningId = $this->addExpressionAsDefinedMeaning( $EC, $EC, $EC, $this->ECCollectionId );
			addClassMembership( $definedMeaningId, $this->enzymeCommissionNumberConceptId );
			$this->ECNumbers[$EC] = $definedMeaningId;
		}
		return $definedMeaningId;
	}
Ejemplo n.º 3
0
	public function add( IdStack $idPath, $record ) {
		$definedMeaningId = $idPath->getKeyStack()->peek( 0 )->definedMeaningId;
		$classId = $record->class;

		if ( $classId != 0 ) {
			addClassMembership( $definedMeaningId, $classId );
		}
	}
Ejemplo n.º 4
0
function importUMLSSemanticTypes( $sab, $collectionId, $attributeTypes ) {
	global
		$db;

	$query = "SELECT MRSTY.CUI, MRSTY.STY FROM MRCONSO,MRSTY where MRCONSO.SAB like '$sab' and MRCONSO.CUI=MRSTY.CUI";

	if ( $queryResult = mysql_query( $query, $db ) ) {
		$progressBar->initialize( mysql_num_rows( $queryResult ), 100 );
		
		while ( $attribute = mysql_fetch_object( $queryResult ) ) {
			$definedMeaningId = getDefinedMeaningFromCollection( $collectionId, $attribute->CUI );
			$attributeMeaningId = $attributeTypes[$attribute->STY];
	
			if ( !$definedMeaningId ) {
				echo "Unknown cui $attribute->CUI\n";
				print_r( $attribute );
				echo "get definedmeaning from collection = $collectionId, $attribute->CUI\n";
				die;
			}
			if ( !$attributeMeaningId ) {
				echo "Unknown attribute $attribute->STY\n";
				print_r( $attribute );
				echo "get definedmeaning from collection = $collectionId, $attribute->CUI\n";
				die;
			}
		
			if ( $definedMeaningId > 0 && $attributeMeaningId > 0 )
				addClassMembership( $definedMeaningId, $attributeMeaningId );
				
			$progressBar->advance( 1 );
		}
		
		$progressBar->clear();
	}
}