package utils

import "database/sql"

func GetChainIDByStr(db *sql.DB, chainCode string) (int, error) {
	var chainID int
	err := db.QueryRow(`select id from chain_main where chain_code = ?`, chainCode).Scan(&chainID)
	return chainID, err
}

func GetHospitalIDByStr(db *sql.DB, chainCode string) (int, error) {
	var chainID int
	err := db.QueryRow(`select id from hospital_main where hospital_code = ?`, chainCode).Scan(&chainID)
	return chainID, err
}
