def get_person_by_params(param_dict): """Returns person by its id. Args: person_id (int): corresponds to personId in db Returns: dict: info about person as dict """ return db.get_db_item_by_params(models.Person, schemas.person.ma_schema, param_dict)
def get_dewar_by_id(dewar_id): """Returns dewar by its dewar_id Args: dewar_id (int): corresponds to dewarId in db Returns: dict: info about dewar as dict """ id_dict = {"dewarId": dewar_id} return db.get_db_item_by_params(models.Dewar, schemas.dewar.ma_schema, id_dict)
def get_container_by_id(container_id): """Returns container by its container_id Args: container_id (int): corresponds to containerId in db Returns: dict: info about container as dict """ id_dict = {"containerId": container_id} return db.get_db_item_by_params(models.Container, schemas.container.ma_schema, id_dict)
def get_loaded_sample_by_id(loaded_sample_id): """Returns loaded_sample by its loaded_sampleId. Args: loaded_sample_id (int): corresponds to loaded_sampleId in db Returns: dict: info about loaded_sample as dict """ id_dict = {"loaded_sampleId": loaded_sample_id} return db.get_db_item_by_params(models.LoadedSample, schemas.loaded_sample.ma_schema, id_dict)
def get_session_by_id(session_id): """Returns session info by its sessionId Args: session_id (int): corresponds to sessionId in db Returns: dict: info about session as dict """ data_dict = {"sessionId": session_id} return db.get_db_item_by_params(models.BLSession, schemas.session.ma_schema, data_dict)
def get_crystal_by_id(crystal_id): """ Returns crystal by its crystalId Args: crystal_id (int): corresponds to crystalId in db Returns: dict: info about crystal as dict """ data_dict = {"crystalId": crystal_id} return db.get_db_item_by_params(models.Crystal, schemas.crystal.ma_schema, data_dict)
def get_shipment_by_id(shipment_id): """ Returns shipment by its shipmentId Args: shipment_id (int): corresponds to shipmentId in db Returns: dict: info about shipment as dict """ id_dict = {"shippingId": shipment_id} return db.get_db_item_by_params(models.Shipping, schemas.shipping.ma_schema, id_dict)
def get_auto_proc_by_id(auto_proc_id): """ Returns auto_proc by its id Args: auto_proc_id (int): corresponds to autoProcId in db Returns: dict: info about auto_proc as dict """ data_dict = {"autoProcId": auto_proc_id} return db.get_db_item_by_params(models.AutoProc, schemas.auto_proc.ma_schema, data_dict)
def get_proposal_by_id(proposal_id): """ Returns proposal by its proposalId Args: proposal_id (int): corresponds to proposalId in db Returns: dict: info about proposal as dict """ id_dict = {"proposalId": proposal_id} return db.get_db_item_by_params(models.Proposal, schemas.proposal.ma_schema, id_dict)
def get_sample_by_id(sample_id): """ Returns sample by its sampleId. Args: sample (int): corresponds to sampleId in db Returns: dict: info about sample as dict """ data_dict = {"sampleId": sample_id} return db.get_db_item_by_params(models.BLSample, schemas.sample.ma_schema, data_dict)
def get_protein_by_id(protein_id): """ Returns protein by its proteinId Args: protein (int): corresponds to proteinId in db Returns: dict: info about protein as dict """ data_dict = {"proteinId": protein_id} return db.get_db_item_by_params(models.Protein, schemas.protein.ma_schema, data_dict)
def get_laboratory_by_id(laboratory_id): """Returns laboratory info by its laboratoryId Args: laboratory_id (int): corresponds to laboratoryId in db Returns: dict: info about laboratory as dict """ data_dict = {"laboratoryId": laboratory_id} return db.get_db_item_by_params( models.Laboratory, schemas.laboratory.ma_schema, data_dict )
def get_auto_proc_status_by_id(auto_proc_status_id): """ Returns auto_proc_status by its auto_proc_statusId. Args: auto_proc_status (int): corresponds to auto_proc_statusId in db Returns: dict: info about auto_proc_status as dict """ data_dict = {"auto_proc_statusId": auto_proc_status_id} return db.get_db_item_by_params(models.AutoProcStatus, schemas.auto_proc_status.ma_schema, data_dict)
def get_beamline_setup_by_id(beamline_setup_id): """ Returns beamline_setup by its beamline_setupId. Args: beamline_setup_id (int): corresponds to beamlineSetupId in db Returns: dict: info about beamline_setup as dict """ data_dict = {"beamLineSetupId": beamline_setup_id} return db.get_db_item_by_params( models.BeamLineSetup, schemas.beamline_setup.ma_schema, data_dict )
def get_data_collection_by_id(data_collection_id): """ Returns data_collection by its id Args: data_collection_id (int): corresponds to dataCollectionId in db Returns: dict: info about data_collection as dict """ data_dict = {"dataCollectionId": data_collection_id} return db.get_db_item_by_params( models.DataCollection, schemas.data_collection.ma_schema, data_dict )
def get_data_collection_group_by_id(data_collection_group_id): """ Returns data collection group by its id. Args: data_collection_group_id (int): corresponds to dataCollectionGroupId in db Returns: dict: info about data collection group as dict """ data_dict = {"dataCollectionGroupId": data_collection_group_id} return db.get_db_item_by_params( models.DataCollectionGroup, schemas.data_collection_group.ma_schema, data_dict )
def get_auto_proc_program_message_by_id(auto_proc_program_message_id): """ Returns auto_proc_program_message by its autoProcProgramMessageId Args: auto_proc_program_message (int): corresponds to autoProcProgramMessageId in db Returns: dict: info about auto_proc_program_message as dict """ data_dict = {"autoProcProgramMessageId": auto_proc_program_message_id} return db.get_db_item_by_params( models.AutoProcProgramMessage, schemas.auto_proc_program_message.ma_schema, data_dict, )
def get_auto_proc_program_attachment_by_id(auto_proc_program_attachment_id): """ Returns auto_proc_program_attachment by its auto_proc_program_attachmentId Args: auto_proc_program_attachment (int): corresponds to autoProcProgramAttachmentId in db Returns: dict: info about auto_proc_program_attachment as dict """ data_dict = { "autoProcProgramAttachmentId": auto_proc_program_attachment_id } return db.get_db_item_by_params( models.AutoProcProgramAttachment, schemas.auto_proc_program_attachment.ma_schema, data_dict, )
def get_lab_contact_by_params(param_dict): return db.get_db_item_by_params( models.LabContact, schemas.lab_contact.ma_schema, param_dict )