public function __invoke(RegisterWalkIn $registerWalkIn) { $patient = Patient::walkIn(PersonalInformation::fromDetails(FullName::fromParts($registerWalkIn->firstName, $registerWalkIn->lastName), BirthDate::fromYearMonthDayFormat($registerWalkIn->dateOfBirth), new Sex($registerWalkIn->sex), $registerWalkIn->patientId), $registerWalkIn->indication, $registerWalkIn->patientId); $this->patientRepository->add($patient); }