1 #ifndef PUBSEQ_GATEWAY_INSDC_UTILS__HPP
2 #define PUBSEQ_GATEWAY_INSDC_UTILS__HPP
3 
4 /*  $Id: insdc_utils.hpp 597991 2019-12-02 21:23:08Z satskyse $
5  * ===========================================================================
6  *
7  *                            PUBLIC DOMAIN NOTICE
8  *               National Center for Biotechnology Information
9  *
10  *  This software/database is a "United States Government Work" under the
11  *  terms of the United States Copyright Act.  It was written as part of
12  *  the author's official duties as a United States Government employee and
13  *  thus cannot be copyrighted.  This software/database is freely available
14  *  to the public for use. The National Library of Medicine and the U.S.
15  *  Government have not placed any restriction on its use or reproduction.
16  *
17  *  Although all reasonable efforts have been taken to ensure the accuracy
18  *  and reliability of the software and data, the NLM and the U.S.
19  *  Government do not and cannot warrant the performance or results that
20  *  may be obtained by using this software or data. The NLM and the U.S.
21  *  Government disclaim all warranties, express or implied, including
22  *  warranties of performance, merchantability or fitness for any particular
23  *  purpose.
24  *
25  *  Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Sergey Satskiy
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/request_status.hpp>
36 #include <corelib/ncbidiag.hpp>
37 #include <objtools/pubseq_gateway/impl/cassandra/bioseq_info/record.hpp>
38 
39 #include "pubseq_gateway_types.hpp"
40 
41 USING_NCBI_SCOPE;
42 USING_IDBLOB_SCOPE;
43 
44 #include <string>
45 #include <vector>
46 using namespace std;
47 
48 
49 struct SINSDCDecision
50 {
51     CRequestStatus::ECode   status;     // 200, 404, 500
52     size_t                  index;      // If 200 then the vector index to take
53     string                  message;    // In case of errors
54 };
55 
56 
57 bool IsINSDCSeqIdType(CBioseqInfoRecord::TSeqIdType  seq_id_type);
58 string GetBioseqRecordId(const CBioseqInfoRecord &  record);
59 
60 // version is from the lookup request
61 // if version is -1 => the lookup was without version
62 SINSDCDecision DecideINSDC(const vector<CBioseqInfoRecord>&  records,
63                            CBioseqInfoRecord::TVersion  version);
64 
65 #endif
66