mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-23 00:12:54 +08:00
22 lines
706 B
Python
22 lines
706 B
Python
import logging
|
|
|
|
from felicity.apps.patient import schemas
|
|
from felicity.apps.patient.services import IdentificationService
|
|
from felicity.core.config import get_settings
|
|
|
|
from .data import get_seeds
|
|
|
|
settings = get_settings()
|
|
logging.basicConfig(level=logging.INFO)
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
async def seed_person() -> None:
|
|
logger.info("Setting up person .....")
|
|
data = get_seeds("person")
|
|
identification_service = IdentificationService()
|
|
|
|
for id_type in data.get("identifiers"):
|
|
if not (await identification_service.get(name=id_type)):
|
|
inst_type_in = schemas.IdentificationCreate(name=id_type)
|
|
await identification_service.create(inst_type_in)
|