2021-02-26 22:20:03 +01:00
|
|
|
|
// swad_timeline_database.c: social timeline operations with database
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
SWAD (Shared Workspace At a Distance),
|
|
|
|
|
is a web platform developed at the University of Granada (Spain),
|
|
|
|
|
and used to support university teaching.
|
|
|
|
|
|
|
|
|
|
This file is part of SWAD core.
|
|
|
|
|
Copyright (C) 1999-2021 Antonio Ca<EFBFBD>as Vargas
|
|
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General 3 License as
|
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/*********************************** Headers *********************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "swad_database.h"
|
|
|
|
|
#include "swad_timeline.h"
|
2021-02-26 23:13:06 +01:00
|
|
|
|
#include "swad_timeline_database.h"
|
2021-02-26 22:20:03 +01:00
|
|
|
|
#include "swad_timeline_publication.h"
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/****************************** Public constants *****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************* Private constants and types ***********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************** External global variables from others modules ****************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************* Private global variables **************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***************************** Private prototypes ****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-02-27 15:09:23 +01:00
|
|
|
|
static long TL_DB_GetMedCodFromPub (long PubCod,const char *DBTable);
|
|
|
|
|
|
2021-02-27 14:12:41 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***************************** Create a new note *****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
// Returns code of note just created
|
|
|
|
|
|
|
|
|
|
long TL_DB_CreateNewNote (TL_Not_NoteType_t NoteType,long Cod,
|
|
|
|
|
long PublisherCod,long HieCod)
|
|
|
|
|
{
|
|
|
|
|
return
|
|
|
|
|
DB_QueryINSERTandReturnCode ("can not create new note",
|
|
|
|
|
"INSERT INTO tl_notes"
|
|
|
|
|
" (NoteType,Cod,UsrCod,HieCod,Unavailable,TimeNote)"
|
|
|
|
|
" VALUES"
|
|
|
|
|
" (%u,%ld,%ld,%ld,'N',NOW())",
|
|
|
|
|
(unsigned) NoteType, // Post, file, exam, notice, forum
|
|
|
|
|
Cod, // Post, file, exam, notice, forum code
|
|
|
|
|
PublisherCod, // Publisher code
|
|
|
|
|
HieCod); // Where in hierarchy
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-27 14:25:17 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************* Mark a note as unavailable ************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void TL_DB_MarkNoteAsUnavailable (TL_Not_NoteType_t NoteType,long Cod)
|
|
|
|
|
{
|
2021-02-27 14:39:16 +01:00
|
|
|
|
/***** Mark note as unavailable *****/
|
2021-02-27 14:25:17 +01:00
|
|
|
|
DB_QueryUPDATE ("can not mark note as unavailable",
|
|
|
|
|
"UPDATE tl_notes SET Unavailable='Y'"
|
|
|
|
|
" WHERE NoteType=%u AND Cod=%ld",
|
|
|
|
|
(unsigned) NoteType,Cod);
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-27 14:39:16 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***** Mark possible notes involving children of a folder as unavailable *****/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void TL_DB_MarkNotesChildrenOfFolderAsUnavailable (TL_Not_NoteType_t NoteType,
|
|
|
|
|
Brw_FileBrowser_t FileBrowser,
|
|
|
|
|
long Cod,
|
|
|
|
|
const char *Path)
|
|
|
|
|
{
|
|
|
|
|
/***** Mark notes as unavailable *****/
|
|
|
|
|
DB_QueryUPDATE ("can not mark notes as unavailable",
|
|
|
|
|
"UPDATE tl_notes SET Unavailable='Y'"
|
|
|
|
|
" WHERE NoteType=%u AND Cod IN"
|
|
|
|
|
" (SELECT FilCod FROM files"
|
|
|
|
|
" WHERE FileBrowser=%u AND Cod=%ld"
|
|
|
|
|
" AND Path LIKE '%s/%%' AND Public='Y')", // Only public files
|
|
|
|
|
(unsigned) NoteType,
|
|
|
|
|
(unsigned) FileBrowser,Cod,
|
|
|
|
|
Path);
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-27 14:12:41 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/**** Insert note in temporary tables used to not get notes already shown ****/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void TL_DB_InsertNoteInJustRetrievedNotes (long NotCod)
|
|
|
|
|
{
|
|
|
|
|
/* Insert note in temporary table with just retrieved notes.
|
|
|
|
|
This table will be used to not get notes already shown */
|
|
|
|
|
DB_QueryINSERT ("can not store note code",
|
|
|
|
|
"INSERT IGNORE INTO tl_tmp_just_retrieved_notes"
|
|
|
|
|
" SET NotCod=%ld",
|
|
|
|
|
NotCod);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TL_DB_InsertNoteInVisibleTimeline (long NotCod)
|
|
|
|
|
{
|
|
|
|
|
/* Insert note in temporary table with visible timeline.
|
|
|
|
|
This table will be used to not get notes already shown */
|
|
|
|
|
DB_QueryINSERT ("can not store note code",
|
|
|
|
|
"INSERT IGNORE INTO tl_tmp_visible_timeline"
|
|
|
|
|
" SET NotCod=%ld",
|
|
|
|
|
NotCod);
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-27 16:16:46 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/*************************** Remove favs for a note **************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void TL_DB_RemoveNoteFavs (long NotCod)
|
|
|
|
|
{
|
|
|
|
|
/***** Remove favs for note *****/
|
|
|
|
|
DB_QueryDELETE ("can not remove favs for note",
|
|
|
|
|
"DELETE FROM tl_notes_fav"
|
|
|
|
|
" WHERE NotCod=%ld",
|
|
|
|
|
NotCod);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/******************** Remove all publications of this note *******************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void TL_DB_RemoveNotePubs (long NotCod)
|
|
|
|
|
{
|
|
|
|
|
/***** Remove all publications of this note *****/
|
|
|
|
|
DB_QueryDELETE ("can not remove a publication",
|
|
|
|
|
"DELETE FROM tl_pubs"
|
|
|
|
|
" WHERE NotCod=%ld",
|
|
|
|
|
NotCod);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/******************* Remove note publication from database *******************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void TL_DB_RemoveNote (long NotCod,long PublisherCod)
|
|
|
|
|
{
|
|
|
|
|
/***** Remove note *****/
|
|
|
|
|
DB_QueryDELETE ("can not remove a note",
|
|
|
|
|
"DELETE FROM tl_notes"
|
|
|
|
|
" WHERE NotCod=%ld"
|
|
|
|
|
" AND UsrCod=%ld", // Extra check: author
|
|
|
|
|
NotCod,
|
|
|
|
|
PublisherCod);
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-27 15:09:23 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***************** Get code of media associated to post **********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
long TL_DB_GetMedCodFromPost (long PubCod)
|
|
|
|
|
{
|
|
|
|
|
return TL_DB_GetMedCodFromPub (PubCod,"tl_posts");
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-27 16:16:46 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************* Remove post from database *************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void TL_DB_RemovePost (long PstCod)
|
|
|
|
|
{
|
|
|
|
|
/***** Remove post *****/
|
|
|
|
|
DB_QueryDELETE ("can not remove a post",
|
|
|
|
|
"DELETE FROM tl_posts"
|
|
|
|
|
" WHERE PstCod=%ld",
|
|
|
|
|
PstCod);
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-26 22:25:48 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********************* Get number of comments in a note **********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
unsigned TL_DB_GetNumCommentsInNote (long NotCod)
|
|
|
|
|
{
|
|
|
|
|
return (unsigned)
|
|
|
|
|
DB_QueryCOUNT ("can not get number of comments in a note",
|
|
|
|
|
"SELECT COUNT(*) FROM tl_pubs"
|
|
|
|
|
" WHERE NotCod=%ld AND PubType=%u",
|
|
|
|
|
NotCod,(unsigned) TL_Pub_COMMENT_TO_NOTE);
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-26 22:34:11 +01:00
|
|
|
|
/*****************************************************************************/
|
2021-02-27 14:57:13 +01:00
|
|
|
|
/************** Get publication codes of comments of a note from database *****************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
// Returns the number of rows got
|
|
|
|
|
|
|
|
|
|
unsigned TL_DB_GetComments (long NotCod,MYSQL_RES **mysql_res)
|
|
|
|
|
{
|
|
|
|
|
return (unsigned)
|
|
|
|
|
DB_QuerySELECT (mysql_res,"can not get comments",
|
|
|
|
|
"SELECT PubCod" // row[0]
|
|
|
|
|
" FROM tl_pubs"
|
|
|
|
|
" WHERE NotCod=%ld AND PubType=%u",
|
|
|
|
|
NotCod,(unsigned) TL_Pub_COMMENT_TO_NOTE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2021-02-26 22:34:11 +01:00
|
|
|
|
/************** Get initial comments of a note from database *****************/
|
|
|
|
|
/*****************************************************************************/
|
2021-02-26 23:45:45 +01:00
|
|
|
|
// Returns the number of rows got
|
2021-02-26 22:34:11 +01:00
|
|
|
|
|
|
|
|
|
unsigned TL_DB_GetInitialComments (long NotCod,
|
|
|
|
|
unsigned NumInitialCommentsToGet,
|
|
|
|
|
MYSQL_RES **mysql_res)
|
|
|
|
|
{
|
|
|
|
|
return (unsigned)
|
|
|
|
|
DB_QuerySELECT (mysql_res,"can not get comments",
|
2021-02-27 13:17:15 +01:00
|
|
|
|
"SELECT tl_pubs.PubCod," // row[0]
|
|
|
|
|
"tl_pubs.PublisherCod," // row[1]
|
|
|
|
|
"tl_pubs.NotCod," // row[2]
|
|
|
|
|
"UNIX_TIMESTAMP(tl_pubs.TimePublish),"// row[3]
|
|
|
|
|
"tl_comments.Txt," // row[4]
|
|
|
|
|
"tl_comments.MedCod" // row[5]
|
2021-02-26 22:34:11 +01:00
|
|
|
|
" FROM tl_pubs,tl_comments"
|
|
|
|
|
" WHERE tl_pubs.NotCod=%ld"
|
|
|
|
|
" AND tl_pubs.PubType=%u"
|
|
|
|
|
" AND tl_pubs.PubCod=tl_comments.PubCod"
|
|
|
|
|
" ORDER BY tl_pubs.PubCod"
|
|
|
|
|
" LIMIT %lu",
|
|
|
|
|
NotCod,(unsigned) TL_Pub_COMMENT_TO_NOTE,
|
|
|
|
|
NumInitialCommentsToGet);
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-26 22:20:03 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/*************** Get final comments of a note from database ******************/
|
|
|
|
|
/*****************************************************************************/
|
2021-02-26 23:45:45 +01:00
|
|
|
|
// Returns the number of rows got
|
2021-02-26 22:20:03 +01:00
|
|
|
|
|
|
|
|
|
unsigned TL_DB_GetFinalComments (long NotCod,
|
|
|
|
|
unsigned NumFinalCommentsToGet,
|
|
|
|
|
MYSQL_RES **mysql_res)
|
|
|
|
|
{
|
|
|
|
|
/***** Get final comments of a note from database *****/
|
|
|
|
|
return (unsigned)
|
|
|
|
|
DB_QuerySELECT (mysql_res,"can not get comments",
|
2021-02-26 22:34:11 +01:00
|
|
|
|
"SELECT * FROM "
|
|
|
|
|
"("
|
2021-02-27 13:17:15 +01:00
|
|
|
|
"SELECT tl_pubs.PubCod," // row[0]
|
|
|
|
|
"tl_pubs.PublisherCod," // row[1]
|
|
|
|
|
"tl_pubs.NotCod," // row[2]
|
|
|
|
|
"UNIX_TIMESTAMP(tl_pubs.TimePublish),"// row[3]
|
|
|
|
|
"tl_comments.Txt," // row[4]
|
|
|
|
|
"tl_comments.MedCod" // row[5]
|
2021-02-26 22:34:11 +01:00
|
|
|
|
" FROM tl_pubs,tl_comments"
|
|
|
|
|
" WHERE tl_pubs.NotCod=%ld"
|
|
|
|
|
" AND tl_pubs.PubType=%u"
|
|
|
|
|
" AND tl_pubs.PubCod=tl_comments.PubCod"
|
|
|
|
|
" ORDER BY tl_pubs.PubCod DESC LIMIT %u"
|
|
|
|
|
") AS comments"
|
|
|
|
|
" ORDER BY PubCod",
|
|
|
|
|
NotCod,(unsigned) TL_Pub_COMMENT_TO_NOTE,
|
|
|
|
|
NumFinalCommentsToGet);
|
2021-02-26 22:20:03 +01:00
|
|
|
|
}
|
2021-02-26 23:13:06 +01:00
|
|
|
|
|
2021-02-27 13:17:15 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/******************* Get data of comment using its code **********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
// Returns the number of rows got
|
|
|
|
|
|
|
|
|
|
unsigned TL_DB_GetDataOfCommByCod (long PubCod,MYSQL_RES **mysql_res)
|
|
|
|
|
{
|
|
|
|
|
/***** Trivial check: publication code should be > 0 *****/
|
|
|
|
|
if (PubCod <= 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/***** Get data of comment from database *****/
|
|
|
|
|
return (unsigned)
|
2021-02-27 14:12:41 +01:00
|
|
|
|
DB_QuerySELECT (mysql_res,"can not get data of comment",
|
2021-02-27 13:17:15 +01:00
|
|
|
|
"SELECT tl_pubs.PubCod," // row[0]
|
|
|
|
|
"tl_pubs.PublisherCod," // row[1]
|
|
|
|
|
"tl_pubs.NotCod," // row[2]
|
|
|
|
|
"UNIX_TIMESTAMP(tl_pubs.TimePublish),"// row[3]
|
|
|
|
|
"tl_comments.Txt," // row[4]
|
|
|
|
|
"tl_comments.MedCod" // row[5]
|
|
|
|
|
" FROM tl_pubs,tl_comments"
|
|
|
|
|
" WHERE tl_pubs.PubCod=%ld"
|
|
|
|
|
" AND tl_pubs.PubType=%u"
|
|
|
|
|
" AND tl_pubs.PubCod=tl_comments.PubCod",
|
|
|
|
|
PubCod,(unsigned) TL_Pub_COMMENT_TO_NOTE);
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-26 23:13:06 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/******************* Insert comment content in database **********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void TL_DB_InsertCommentContent (long PubCod,
|
|
|
|
|
const struct TL_Pst_PostContent *Content)
|
|
|
|
|
{
|
|
|
|
|
/***** Insert comment content in database *****/
|
|
|
|
|
DB_QueryINSERT ("can not store comment content",
|
|
|
|
|
"INSERT INTO tl_comments"
|
|
|
|
|
" (PubCod,Txt,MedCod)"
|
|
|
|
|
" VALUES"
|
|
|
|
|
" (%ld,'%s',%ld)",
|
|
|
|
|
PubCod,
|
|
|
|
|
Content->Txt,
|
|
|
|
|
Content->Media.MedCod);
|
|
|
|
|
}
|
2021-02-26 23:45:45 +01:00
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2021-02-27 13:17:15 +01:00
|
|
|
|
/**************** Get code of media associated to comment ********************/
|
2021-02-26 23:45:45 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
long TL_DB_GetMedCodFromComment (long PubCod)
|
|
|
|
|
{
|
2021-02-27 15:09:23 +01:00
|
|
|
|
return TL_DB_GetMedCodFromPub (PubCod,"tl_comments");
|
2021-02-26 23:45:45 +01:00
|
|
|
|
}
|
2021-02-26 23:58:36 +01:00
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/****************** Remove favs for comment from database ********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void TL_DB_RemoveCommentFavs (long PubCod)
|
|
|
|
|
{
|
|
|
|
|
/***** Remove favs for comment *****/
|
|
|
|
|
DB_QueryDELETE ("can not remove favs for comment",
|
|
|
|
|
"DELETE FROM tl_comments_fav"
|
|
|
|
|
" WHERE PubCod=%ld",
|
|
|
|
|
PubCod);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***************** Remove content of comment from database *******************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void TL_DB_RemoveCommentContent (long PubCod)
|
|
|
|
|
{
|
|
|
|
|
/***** Remove content of comment *****/
|
2021-02-27 13:17:15 +01:00
|
|
|
|
DB_QueryDELETE ("can not remove comment content",
|
2021-02-26 23:58:36 +01:00
|
|
|
|
"DELETE FROM tl_comments"
|
|
|
|
|
" WHERE PubCod=%ld",
|
|
|
|
|
PubCod);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***************** Remove comment publication from database ******************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void TL_DB_RemoveCommentPub (long PubCod,long PublisherCod)
|
|
|
|
|
{
|
|
|
|
|
/***** Remove comment publication *****/
|
2021-02-27 13:17:15 +01:00
|
|
|
|
DB_QueryDELETE ("can not remove comment",
|
2021-02-26 23:58:36 +01:00
|
|
|
|
"DELETE FROM tl_pubs"
|
|
|
|
|
" WHERE PubCod=%ld"
|
2021-02-27 13:17:15 +01:00
|
|
|
|
" AND PublisherCod=%ld" // Extra check: author
|
2021-02-26 23:58:36 +01:00
|
|
|
|
" AND PubType=%u", // Extra check: it's a comment
|
|
|
|
|
PubCod,
|
|
|
|
|
PublisherCod,
|
|
|
|
|
(unsigned) TL_Pub_COMMENT_TO_NOTE);
|
|
|
|
|
}
|
2021-02-27 15:09:23 +01:00
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/*************** Get code of media associated to post/comment ****************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
static long TL_DB_GetMedCodFromPub (long PubCod,const char *DBTable)
|
|
|
|
|
{
|
|
|
|
|
MYSQL_RES *mysql_res;
|
|
|
|
|
MYSQL_ROW row;
|
|
|
|
|
long MedCod = -1L; // Default value
|
|
|
|
|
|
|
|
|
|
/***** Get code of media associated to comment *****/
|
|
|
|
|
if (DB_QuerySELECT (&mysql_res,"can not get media code",
|
|
|
|
|
"SELECT MedCod" // row[0]
|
|
|
|
|
" FROM %s"
|
|
|
|
|
" WHERE PubCod=%ld",
|
|
|
|
|
DBTable,PubCod) == 1) // Result should have a unique row
|
|
|
|
|
{
|
|
|
|
|
/* Get media code */
|
|
|
|
|
row = mysql_fetch_row (mysql_res);
|
|
|
|
|
MedCod = Str_ConvertStrCodToLongCod (row[0]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Free structure that stores the query result */
|
|
|
|
|
DB_FreeMySQLResult (&mysql_res);
|
|
|
|
|
|
|
|
|
|
return MedCod;
|
|
|
|
|
}
|