First step of pmsi insert in db