Compare commits

...

5 Commits

28 changed files with 2749 additions and 6 deletions

View File

@ -0,0 +1,174 @@
<?php
namespace App\Controller;
use App\Entity\Member;
use App\Entity\User;
use App\Entity\MemberCase;
use App\Form\MemberFormType;
use App\Libs\NavList;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\CurrentUser;
class MemberController extends AbstractController
{
public function __construct(
private EntityManagerInterface $entityManager,
private array $navLinks = [],
) {
$this->navLinks = NavList::LIST;
}
#[Route('/list-members/{id}', name: 'app_case_members')]
public function listMembers(Request $request, #[CurrentUser()] User $user, string $id): Response
{
$case = $this->entityManager->getRepository(MemberCase::class)->find($id);
$members = $this->entityManager->getRepository(Member::class)->getCaseMembersByName($case);
return $this->render(
'internal/cases/members/list-members.html.twig',
array_merge(
$this->navLinks,
[
'breadcrumbs' => [
'Case',
'Members'
],
'notifications' => $user->retrieveUnreadNotifications(),
'case' => $case,
'members' => $members,
]
)
);
}
#[Route('/add-member/{id}', name: 'app_case_add_member')]
public function addMember(Request $request, #[CurrentUser()] User $user, string $id): Response
{
/** @var MemberCase $case */
$case = $this->entityManager->getRepository(MemberCase::class)->find($id);
$member = new Member();
$form = $this->createForm(MemberFormType::class, $member);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$member->setCaseId($case)
->setFirstName($form->get('firstName')->getData())
->setLastName($form->get('lastName')->getData())
->setDob($form->get('dob')->getData())
->setGender($form->get('gender')->getData())
->setRace($form->get('race')->getData())
->setLanguage($form->get('language')->getData())
->setPersonalId($form->get('personalId')->getData())
->setEmergencyContact($form->get('emergencyContact')->getData())
->setEmail($form->get('email')->getData())
->setAddress($form->get('address')->getData())
->setCity($form->get('city')->getData())
->setState($form->get('state')->getData())
->setZip($form->get('zip')->getData())
->setPhone($form->get('phone')->getData())
->setRelationship($form->get('relationship')->getData())
->setDayPhone($form->get('dayPhone')->getData())
->setEveningPhone($form->get('eveningPhone')->getData())
->setCellPhone($form->get('cellPhone')->getData())
->setSchool($form->get('school')->getData())
->setMaritalStatus($form->get('maritalStatus')->getData())
->setChild($form->get('isChild')->getData())
->setParent($form->get('isParent')->getData())
->setAdultChild($form->get('isAdultChild')->getData())
->setLegalGuardian($form->get('isLegalGuardian')->getData())
->setParentsLiveTogether($form->get('parentsLiveTogether')->getData())
->setDcsApproved($form->get('dcsApproved')->getData())
;
$this->entityManager->persist($member);
$this->entityManager->flush();
return $this->redirectToRoute('app_case_members', ['id' => $case->getId()]);
}
return $this->render(
'internal/cases/members/add-member.html.twig',
array_merge(
$this->navLinks,
[
'breadcrumbs' => [
'Case',
'Members',
'Add Member'
],
'notifications' => $user->retrieveUnreadNotifications(),
'case' => $case,
'form' => $form->createView(),
]
)
);
}
#[Route('/case/{caseId}/edit-member/{memberId}', name: 'app_case_edit_member')]
public function editMember(Request $request, #[CurrentUser()] User $user, string $caseId, string $memberId): Response
{
$member = $this->entityManager->getRepository(Member::class)->find($memberId);
$form = $this->createForm(MemberFormType::class, $member);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$member->setFirstName($form->get('firstName')->getData())
->setLastName($form->get('lastName')->getData())
->setDob($form->get('dob')->getData())
->setGender($form->get('gender')->getData())
->setRace($form->get('race')->getData())
->setLanguage($form->get('language')->getData())
->setPersonalId($form->get('personalId')->getData())
->setEmergencyContact($form->get('emergencyContact')->getData())
->setEmail($form->get('email')->getData())
->setAddress($form->get('address')->getData())
->setCity($form->get('city')->getData())
->setState($form->get('state')->getData())
->setZip($form->get('zip')->getData())
->setPhone($form->get('phone')->getData())
->setRelationship($form->get('relationship')->getData())
->setDayPhone($form->get('dayPhone')->getData())
->setEveningPhone($form->get('eveningPhone')->getData())
->setCellPhone($form->get('cellPhone')->getData())
->setSchool($form->get('school')->getData())
->setMaritalStatus($form->get('maritalStatus')->getData())
->setChild($form->get('isChild')->getData())
->setParent($form->get('isParent')->getData())
->setAdultChild($form->get('isAdultChild')->getData())
->setLegalGuardian($form->get('isLegalGuardian')->getData())
->setParentsLiveTogether($form->get('parentsLiveTogether')->getData())
->setDcsApproved($form->get('dcsApproved')->getData())
;
$this->entityManager->flush();
return $this->redirectToRoute('app_case_members', ['id' => $caseId]);
}
return $this->render(
'internal/cases/members/edit-member.html.twig',
array_merge(
$this->navLinks,
[
'breadcrumbs' => [
'Case',
'Members',
'Edit Member'
],
'notifications' => $user->retrieveUnreadNotifications(),
'member' => $member,
'form' => $form->createView(),
'caseId' => $caseId,
]
)
);
}
}

View File

@ -0,0 +1,122 @@
<?php
namespace App\Controller;
use App\Entity\MemberCase;
use App\Entity\Referral;
use App\Entity\User;
use App\Form\ReferralFormType;
use App\Libs\NavList;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Http\Attribute\CurrentUser;
class ReferralController extends AbstractController
{
public function __construct(
private EntityManagerInterface $entityManager,
private array $navLinks = []
) {
$this->navLinks = NavList::LIST;
}
#[Route('/list-referrals/{id}', name: 'app_list_referrals')]
public function listReferrals(Request $request, #[CurrentUser()] User $user, string $id): Response
{
$case = $this->entityManager->getRepository(MemberCase::class)->find($id);
$openReferrals = $this->entityManager->getRepository(Referral::class)->getActiveReferrals($case);
$closedReferrals = $this->entityManager->getRepository(Referral::class)->getClosedReferrals($case);
return $this->render(
'internal/cases/referrals/list-referrals.html.twig',
array_merge(
$this->navLinks,
[
'breadcrumbs' => [
'Case',
'Referrals'
],
'notifications' => $user->retrieveUnreadNotifications(),
'case' => $case,
'openReferrals' => $openReferrals,
'closedReferrals' => $closedReferrals,
]
)
);
}
#[Route('/add-referral/{id}', name: 'app_case_add_referral')]
public function addReferral(Request $request, #[CurrentUser()] User $user, string $id): Response
{
$case = $this->entityManager->getRepository(MemberCase::class)->find($id);
$referral = new Referral();
$form = $this->createForm(ReferralFormType::class, $referral);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$referral = $form->getData();
$referral->setMemberCase($case);
$this->entityManager->persist($referral);
$this->entityManager->flush();
return $this->redirectToRoute('app_list_referrals', ['id' => $case->getId()]);
}
return $this->render(
'internal/cases/referrals/add-referral.html.twig',
array_merge(
$this->navLinks,
[
'breadcrumbs' => [
'Case',
'Add Referral'
],
'notifications' => $user->retrieveUnreadNotifications(),
'case' => $case,
'form' => $form,
]
)
);
}
#[Route('/case/{caseId}/edit-referral/{referralId}', name: 'app_case_edit_referral')]
public function editReferral(Request $request, #[CurrentUser()] User $user, string $caseId, string $referralId): Response
{
$referral = $this->entityManager->getRepository(Referral::class)->find($referralId);
$case = $this->entityManager->getRepository(MemberCase::class)->find($caseId);
$form = $this->createForm(ReferralFormType::class, $referral);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$referral = $form->getData();
$this->entityManager->flush();
return $this->redirectToRoute('app_list_referrals', ['id' => $case->getId()]);
}
return $this->render(
'internal/cases/referrals/edit-referral.html.twig',
array_merge(
$this->navLinks,
[
'breadcrumbs' => [
'Case',
'Edit Referral'
],
'notifications' => $user->retrieveUnreadNotifications(),
'case' => $case,
'form' => $form,
'referral' => $referral,
]
)
);
}
}

449
src/Entity/Member.php Normal file
View File

@ -0,0 +1,449 @@
<?php
namespace App\Entity;
use App\Enums\GenderType;
use App\Enums\RaceType;
use App\Enums\RelationshipType;
use App\Repository\MemberRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: MemberRepository::class)]
#[ORM\Table(name: '`member`')]
class Member
{
#[ORM\Id]
#[ORM\Column(type: UuidType::NAME, unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
private ?Uuid $id = null;
#[ORM\ManyToOne(inversedBy: 'members')]
#[ORM\JoinColumn(nullable: false)]
private ?MemberCase $caseId = null;
#[ORM\Column(length: 45)]
private ?string $lastName = null;
#[ORM\Column(length: 45)]
private ?string $firstName = null;
#[ORM\Column(length: 45, nullable: true)]
private ?RelationshipType $relationship = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $personalId = null;
#[ORM\Column(nullable: true, enumType: GenderType::class)]
private ?GenderType $gender = null;
#[ORM\Column(length: 45, nullable: true)]
private ?RaceType $race = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?\DateTimeInterface $dob = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $language = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $emergencyContact = null;
#[ORM\Column(length: 15, nullable: true)]
private ?string $phone = null;
#[ORM\Column(length: 15, nullable: true)]
private ?string $dayPhone = null;
#[ORM\Column(length: 15, nullable: true)]
private ?string $eveningPhone = null;
#[ORM\Column(length: 15, nullable: true)]
private ?string $cellPhone = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $email = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $school = null;
#[ORM\Column(length: 64, nullable: true)]
private ?string $address = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $city = null;
#[ORM\Column(length: 15, nullable: true)]
private ?string $state = null;
#[ORM\Column(length: 10, nullable: true)]
private ?string $zip = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $maritalStatus = null;
#[ORM\Column]
private ?bool $isChild = null;
#[ORM\Column]
private ?bool $isParent = null;
#[ORM\Column]
private ?bool $isAdultChild = null;
#[ORM\Column]
private ?bool $isLegalGuardian = null;
#[ORM\Column]
private ?bool $parentsLiveTogether = null;
#[ORM\Column]
private ?bool $dcsApproved = null;
public function getId(): ?Uuid
{
return $this->id;
}
public function getCaseId(): ?MemberCase
{
return $this->caseId;
}
public function setCaseId(?MemberCase $caseId): static
{
$this->caseId = $caseId;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(string $lastName): static
{
$this->lastName = $lastName;
return $this;
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(string $firstName): static
{
$this->firstName = $firstName;
return $this;
}
public function getRelationship(): ?RelationshipType
{
return $this->relationship;
}
public function setRelationship(?RelationshipType $relationship): static
{
$this->relationship = $relationship;
return $this;
}
public function getPersonalId(): ?string
{
return $this->personalId;
}
public function setPersonalId(?string $personalId): static
{
$this->personalId = $personalId;
return $this;
}
public function getGender(): ?GenderType
{
return $this->gender;
}
public function setGender(?GenderType $gender): static
{
$this->gender = $gender;
return $this;
}
public function getRace(): ?RaceType
{
return $this->race;
}
public function setRace(?RaceType $race): static
{
$this->race = $race;
return $this;
}
public function getDob(): ?\DateTimeInterface
{
return $this->dob;
}
public function setDob(\DateTimeInterface $dob): static
{
$this->dob = $dob;
return $this;
}
public function getLanguage(): ?string
{
return $this->language;
}
public function setLanguage(?string $language): static
{
$this->language = $language;
return $this;
}
public function getEmergencyContact(): ?string
{
return $this->emergencyContact;
}
public function setEmergencyContact(?string $emergencyContact): static
{
$this->emergencyContact = $emergencyContact;
return $this;
}
public function getFormattedPhone(): ?string
{
if ($this->phone) {
return '(' . substr($this->phone, 0, 3) . ') ' . substr($this->phone, 3, 3) . '-' . substr($this->phone, 6);
} elseif ($this->dayPhone) {
return '(' . substr($this->dayPhone, 0, 3) . ') ' . substr($this->dayPhone, 3, 3) . '-' . substr($this->dayPhone, 6);
} elseif ($this->eveningPhone) {
return '(' . substr($this->eveningPhone, 0, 3) . ') ' . substr($this->eveningPhone, 3, 3) . '-' . substr($this->eveningPhone, 6);
} elseif ($this->cellPhone) {
return '(' . substr($this->cellPhone, 0, 3) . ') ' . substr($this->cellPhone, 3, 3) . '-' . substr($this->cellPhone, 6);
}
return null;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): static
{
$this->phone = $phone;
return $this;
}
public function getDayPhone(): ?string
{
return $this->dayPhone;
}
public function setDayPhone(?string $dayPhone): static
{
$this->dayPhone = $dayPhone;
return $this;
}
public function getEveningPhone(): ?string
{
return $this->eveningPhone;
}
public function setEveningPhone(?string $eveningPhone): static
{
$this->eveningPhone = $eveningPhone;
return $this;
}
public function getCellPhone(): ?string
{
return $this->cellPhone;
}
public function setCellPhone(?string $cellPhone): static
{
$this->cellPhone = $cellPhone;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): static
{
$this->email = $email;
return $this;
}
public function getSchool(): ?string
{
return $this->school;
}
public function setSchool(?string $school): static
{
$this->school = $school;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): static
{
$this->address = $address;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): static
{
$this->city = $city;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(?string $state): static
{
$this->state = $state;
return $this;
}
public function getZip(): ?string
{
return $this->zip;
}
public function setZip(?string $zip): static
{
$this->zip = $zip;
return $this;
}
public function getMaritalStatus(): ?string
{
return $this->maritalStatus;
}
public function setMaritalStatus(?string $maritalStatus): static
{
$this->maritalStatus = $maritalStatus;
return $this;
}
public function isChild(): ?bool
{
return $this->isChild;
}
public function setChild(bool $isChild): static
{
$this->isChild = $isChild;
return $this;
}
public function isParent(): ?bool
{
return $this->isParent;
}
public function setParent(bool $isParent): static
{
$this->isParent = $isParent;
return $this;
}
public function isAdultChild(): ?bool
{
return $this->isAdultChild;
}
public function setAdultChild(bool $isAdultChild): static
{
$this->isAdultChild = $isAdultChild;
return $this;
}
public function isLegalGuardian(): ?bool
{
return $this->isLegalGuardian;
}
public function setLegalGuardian(bool $isLegalGuardian): static
{
$this->isLegalGuardian = $isLegalGuardian;
return $this;
}
public function isParentsLiveTogether(): ?bool
{
return $this->parentsLiveTogether;
}
public function setParentsLiveTogether(bool $parentsLiveTogether): static
{
$this->parentsLiveTogether = $parentsLiveTogether;
return $this;
}
public function isDcsApproved(): ?bool
{
return $this->dcsApproved;
}
public function setDcsApproved(bool $dcsApproved): static
{
$this->dcsApproved = $dcsApproved;
return $this;
}
}

397
src/Entity/MemberCase.php Normal file
View File

@ -0,0 +1,397 @@
<?php
namespace App\Entity;
use App\Enums\CaseLevel;
use App\Enums\County;
use App\Repository\MemberCaseRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: MemberCaseRepository::class)]
class MemberCase
{
#[ORM\Id]
#[ORM\Column(type: UuidType::NAME, unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
private ?Uuid $id = null;
#[ORM\Column(length: 15)]
private ?string $caseNumber = null;
#[ORM\Column(length: 45)]
private ?string $firstName = null;
#[ORM\Column(length: 45)]
private ?string $lastName = null;
#[ORM\Column(length: 45)]
private ?string $referralType = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?ReferralSource $referralSource = null;
#[ORM\ManyToOne]
private ?ReferralSource $referralSource2 = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $admitDate = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $closeDate = null;
#[ORM\Column(length: 15, nullable: true)]
private ?string $dcsCaseId = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $insurance = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $medicaid = null;
#[ORM\Column(length: 64, nullable: true)]
private ?string $caseEmail = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $address = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $address2 = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $city = null;
#[ORM\Column(length: 10, nullable: true)]
private ?string $state = null;
#[ORM\Column(nullable: true)]
private ?int $zip = null;
#[ORM\Column(enumType: County::class)]
private ?County $county = null;
#[ORM\Column(enumType: CaseLevel::class)]
private ?CaseLevel $level = null;
/**
* @var Collection<int, UserCase>
*/
#[ORM\OneToMany(targetEntity: UserCase::class, mappedBy: 'memberCase')]
private Collection $userCases;
/**
* @var Collection<int, Referral>
*/
#[ORM\OneToMany(targetEntity: Referral::class, mappedBy: 'memberCase', orphanRemoval: true)]
private Collection $referrals;
public function __construct()
{
$this->userCases = new ArrayCollection();
$this->referrals = new ArrayCollection();
}
public function getId(): ?Uuid
{
return $this->id;
}
public function getCaseNumber(): ?string
{
return $this->caseNumber;
}
public function setCaseNumber(string $caseNumber): static
{
$this->caseNumber = $caseNumber;
return $this;
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(string $firstName): static
{
$this->firstName = $firstName;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(string $lastName): static
{
$this->lastName = $lastName;
return $this;
}
public function getCaseName(): string
{
return "{$this->lastName}, {$this->firstName}";
}
public function getReferralType(): ?string
{
return $this->referralType;
}
public function setReferralType(string $referralType): static
{
$this->referralType = $referralType;
return $this;
}
public function getReferralSource(): ?ReferralSource
{
return $this->referralSource;
}
public function setReferralSource(?ReferralSource $referralSource): static
{
$this->referralSource = $referralSource;
return $this;
}
public function getReferralSource2(): ?ReferralSource
{
return $this->referralSource2;
}
public function setReferralSource2(?ReferralSource $referralSource2): static
{
$this->referralSource2 = $referralSource2;
return $this;
}
public function getAdmitDate(): ?\DateTimeInterface
{
return $this->admitDate;
}
public function setAdmitDate(?\DateTimeInterface $admitDate): static
{
$this->admitDate = $admitDate;
return $this;
}
public function getCloseDate(): ?\DateTimeInterface
{
return $this->closeDate;
}
public function setCloseDate(?\DateTimeInterface $closeDate): static
{
$this->closeDate = $closeDate;
return $this;
}
public function getDcsCaseId(): ?int
{
return $this->dcsCaseId;
}
public function setDcsCaseId(?int $dcsCaseId): static
{
$this->dcsCaseId = $dcsCaseId;
return $this;
}
public function getInsurance(): ?string
{
return $this->insurance;
}
public function setInsurance(?string $insurance): static
{
$this->insurance = $insurance;
return $this;
}
public function getMedicaid(): ?string
{
return $this->medicaid;
}
public function setMedicaid(?string $medicaid): static
{
$this->medicaid = $medicaid;
return $this;
}
public function getCaseEmail(): ?string
{
return $this->caseEmail;
}
public function setCaseEmail(?string $caseEmail): static
{
$this->caseEmail = $caseEmail;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): static
{
$this->address = $address;
return $this;
}
public function getCounty(): ?County
{
return $this->county;
}
public function setCounty(County $county): static
{
$this->county = $county;
return $this;
}
public function getLevel(): ?CaseLevel
{
return $this->level;
}
public function setLevel(CaseLevel $level): static
{
$this->level = $level;
return $this;
}
public function getAddress2(): ?string
{
return $this->address2;
}
public function setAddress2(?string $address2): static
{
$this->address2 = $address2;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): static
{
$this->city = $city;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(?string $state): static
{
$this->state = $state;
return $this;
}
public function getZip(): ?int
{
return $this->zip;
}
public function setZip(?int $zip): static
{
$this->zip = $zip;
return $this;
}
/**
* @return Collection<int, UserCase>
*/
public function getUserCases(): Collection
{
return $this->userCases;
}
public function addUserCase(UserCase $userCase): static
{
if (!$this->userCases->contains($userCase)) {
$this->userCases->add($userCase);
$userCase->setMemberCase($this);
}
return $this;
}
public function removeUserCase(UserCase $userCase): static
{
if ($this->userCases->removeElement($userCase)) {
// set the owning side to null (unless already changed)
if ($userCase->getMemberCase() === $this) {
$userCase->setMemberCase(null);
}
}
return $this;
}
/**
* @return Collection<int, Referral>
*/
public function getReferrals(): Collection
{
return $this->referrals;
}
public function addReferral(Referral $referral): static
{
if (!$this->referrals->contains($referral)) {
$this->referrals->add($referral);
$referral->setMemberCase($this);
}
return $this;
}
public function removeReferral(Referral $referral): static
{
if ($this->referrals->removeElement($referral)) {
// set the owning side to null (unless already changed)
if ($referral->getMemberCase() === $this) {
$referral->setMemberCase(null);
}
}
return $this;
}
}

132
src/Entity/Referral.php Normal file
View File

@ -0,0 +1,132 @@
<?php
namespace App\Entity;
use App\Enums\DischargeReason;
use App\Enums\ReferralServiceType;
use App\Repository\ReferralRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: ReferralRepository::class)]
class Referral
{
#[ORM\Id]
#[ORM\Column(type: UuidType::NAME, unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
private ?Uuid $id = null;
#[ORM\ManyToOne(inversedBy: 'referrals')]
#[ORM\JoinColumn(nullable: false)]
private ?MemberCase $memberCase = null;
#[ORM\Column(length: 20)]
private ?string $referralId = null;
#[ORM\Column(enumType: ReferralServiceType::class)]
private ?ReferralServiceType $serviceCode = null;
#[ORM\Column]
private ?int $hours = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?\DateTimeInterface $endDate = null;
#[ORM\Column(nullable: true, enumType: DischargeReason::class)]
private ?DischargeReason $dischargeReason = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $dischargeDate = null;
public function getId(): ?Uuid
{
return $this->id;
}
public function getMemberCase(): ?MemberCase
{
return $this->memberCase;
}
public function setMemberCase(?MemberCase $memberCase): static
{
$this->memberCase = $memberCase;
return $this;
}
public function getReferralId(): ?string
{
return $this->referralId;
}
public function setReferralId(string $referralId): static
{
$this->referralId = $referralId;
return $this;
}
public function getServiceCode(): ?ReferralServiceType
{
return $this->serviceCode;
}
public function setServiceCode(ReferralServiceType $serviceCode): static
{
$this->serviceCode = $serviceCode;
return $this;
}
public function getHours(): ?int
{
return $this->hours;
}
public function setHours(int $hours): static
{
$this->hours = $hours;
return $this;
}
public function getEndDate(): ?\DateTimeInterface
{
return $this->endDate;
}
public function setEndDate(\DateTimeInterface $endDate): static
{
$this->endDate = $endDate;
return $this;
}
public function getDischargeReason(): ?DischargeReason
{
return $this->dischargeReason;
}
public function setDischargeReason(?DischargeReason $dischargeReason): static
{
$this->dischargeReason = $dischargeReason;
return $this;
}
public function getDischargeDate(): ?\DateTimeInterface
{
return $this->dischargeDate;
}
public function setDischargeDate(?\DateTimeInterface $dischargeDate): static
{
$this->dischargeDate = $dischargeDate;
return $this;
}
}

52
src/Entity/UserCase.php Normal file
View File

@ -0,0 +1,52 @@
<?php
namespace App\Entity;
use App\Repository\UserCaseRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: UserCaseRepository::class)]
class UserCase
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'userCases')]
#[ORM\JoinColumn(nullable: false)]
private ?User $user = null;
#[ORM\ManyToOne(inversedBy: 'userCases')]
#[ORM\JoinColumn(nullable: false)]
private ?MemberCase $memberCase = null;
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): static
{
$this->user = $user;
return $this;
}
public function getMemberCase(): ?MemberCase
{
return $this->memberCase;
}
public function setMemberCase(?MemberCase $memberCase): static
{
$this->memberCase = $memberCase;
return $this;
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace App\Enums;
enum DischargeReason: string
{
case AGENCY_WITHDREW = 'Agency withdrew family';
case COMPLETED_PLANNED_SERVICES = 'Completed planned services';
case DCS_OR_PROBATION_WITHDREW = 'DCS or Probation withdrew services';
case CLIENT_MOVED = 'Client Moved';
case CLIENT_WITHDREW = 'Client/youth/family withdrew from service';
case FAMILY_REFUSED = 'Family refused services';
case OTHER = 'Other, Please Specify';
case CLIENT_REFUSED = 'Client refused to initiate services';
case CLIENT_REFERRED = 'Client referred to another service';
case ADMINISTRATIVE_TERMINATION = 'Administrative termination';
case REFERRAL_EXPIRED = 'Referral expired';
case SERVICE_ON_HOLD = 'Service on hold/intermittant';
case UNKNOWN = 'Unknown';
case TRANSFER_COUNTY = 'Transfer to another county';
case ASSIGNED_TO_DIFFERENT_IC = 'Assigned to different IC';
case SERVICES_NOT_NEEDED = 'Services not needed at this time, per FCM';
case CHANGE_IN_OBJECTIVE = 'Change in objective/referred person added';
case DCS_PROBATION_CASE_CLOSED = 'DCS/Probation case closed';
case TEMP_COVERAGE = 'Temporary coverage only for another IC';
case UPDATED_REFERRAL = 'Updated referral received';
}

11
src/Enums/GenderType.php Normal file
View File

@ -0,0 +1,11 @@
<?php
namespace App\Enums;
enum GenderType: string
{
case MALE = 'male';
case FEMALE = 'female';
case OTHER = 'other';
case TRANSGENDER = 'transgender';
}

20
src/Enums/RaceType.php Normal file
View File

@ -0,0 +1,20 @@
<?php
namespace App\Enums;
enum RaceType: string
{
case AFRICAN_AMERICAN = 'African American';
case AMERICAN_INDIANA = 'American Indian';
case ASIAN = 'Asian';
case ASIAN_PACIFIC = 'Asian/Pacific Islander';
case BIRACIAL = 'Biracial, Non-Hispanic';
case BLACK = 'Black, Non-Hispanic';
case CAUCASIAN = 'Caucasian';
case HISPANIC = 'Hispanic';
case MISSING_DATA = 'Missing Data';
case MULTIRACIAL = 'Multi-racial';
case NATIVE_AMERICAN = 'Native American';
case OTHER = 'Other';
case UNKNOWN = 'Unknown';
}

View File

@ -0,0 +1,10 @@
<?php
namespace App\Enums;
enum ReferralServiceType: string
{
case FE_FF = 'FE-FF';
case VS_THBB = 'VS-THBB';
case VS_THBBT = 'VS-THBBT';
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Enums;
enum RelationshipType: string
{
case ADULT_CHILD = 'Adult Child';
case AUNT = 'Aunt';
case SO_OF_PARENT = 'Boy/Girlfriend of Parent';
case CAREGIVER = 'Caregiver';
case CHILD = 'Child';
case FATHER = 'Father';
case FOSTER_FATHER = 'Foster Father';
case FOSTER_MOTHER = 'Foster Mother';
case FOSTER_SIBLING = 'Foster Sibling';
case GRANDFATHER = 'Grandfather';
case GRANDMOTHER = 'Grandmother';
case HALF_SIBLING = 'Half Sibling';
case HOMESTUDY_PREPARATION = 'Homestudy Preparation';
case MOTHER = 'Mother';
case OTHER_RELATIVE = 'Other Relative';
case PARENT_PARAMOUR = 'Parent Paramour';
case SIBLING = 'Sibling';
case STEP_SIBLING = 'Step Sibling';
case STEP_FATHER = 'Stepfather';
case STEP_MOTHER = 'Stepmother';
case UNCLE = 'Uncle';
}

View File

@ -0,0 +1,59 @@
<?php
namespace App\Form;
use App\Entity\User;
use App\Enums\CaseLevel;
use App\Enums\JobType;
use App\Enums\RateType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\EnumType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class EditUserFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name', TextType::class, [
'required' => true,
'label' => 'Name',
'attr' => [
'class' => 'form-control',
'placeholder' => 'Name',
],
])
->add('email', EmailType::class, [
'required' => true,
'label' => 'Email',
'attr' => [
'class' => 'form-control',
'placeholder' => 'Email',
],
])
->add('caseWorker', CheckboxType::class)
->add('caseManager', CheckboxType::class)
->add('therapist', CheckboxType::class)
->add('su', CheckboxType::class, ['label' => 'Admin'])
->add('rateType', EnumType::class, [
'class' => RateType::class
])
->add('rate', NumberType::class)
->add('level', EnumType::class, [
'class' => CaseLevel::class,
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => User::class,
]);
}
}

View File

@ -0,0 +1,72 @@
<?php
namespace App\Form;
use App\Entity\MemberCase;
use App\Entity\ReferralSource;
use App\Enums\CaseLevel;
use App\Enums\County;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EnumType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class MemberCaseFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('caseNumber', TextType::class, [
'required' => true
])
->add('firstName', TextType::class, [
'required' => true
])
->add('lastName', TextType::class, [
'required' => true
])
->add('referralType')
->add('admitDate', null, [
'widget' => 'single_text',
'required' => true,
])
->add('closeDate', null, [
'widget' => 'single_text',
])
->add('dcsCaseId', TextType::class, [
'required' => true
])
->add('insurance')
->add('medicaid')
->add('caseEmail')
->add('level', EnumType::class, [
'class' => CaseLevel::class,
])
->add('referralSource', EntityType::class, [
'class' => ReferralSource::class,
'choice_label' => 'name',
])
->add('referralSource2', EntityType::class, [
'class' => ReferralSource::class,
'choice_label' => 'name',
])
->add('address')
->add('address2')
->add('city')
->add('state')
->add('zip')
->add('county', EnumType::class, [
'class' => County::class,
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => MemberCase::class,
]);
}
}

View File

@ -0,0 +1,80 @@
<?php
namespace App\Form;
use App\Entity\Member;
use App\Enums\GenderType;
use App\Enums\RaceType;
use App\Enums\RelationshipType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\EnumType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class MemberFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('lastName', null, ['required' => true])
->add('firstName', null, ['required' => true])
->add('personalId', null, ['required' => true])
->add('dob', DateType::class, [
'widget' => 'single_text',
'required' => true
])
->add('emergencyContact')
->add('phone')
->add('dayPhone')
->add('eveningPhone')
->add('cellPhone')
->add('email', EmailType::class)
->add('school')
->add('address')
->add('city')
->add('state')
->add('zip')
->add('maritalStatus')
->add('relationship', EnumType::class, [
'class' => RelationshipType::class,
'required' => true
])
->add('gender', EnumType::class, [
'class' => GenderType::class,
'required' => true
])
->add('race', EnumType::class, [
'class' => RaceType::class
])
->add('language')
->add('isChild', CheckboxType::class, [
'mapped' => false
])
->add('isParent', CheckboxType::class, [
'mapped' => false
])
->add('isAdultChild', CheckboxType::class, [
'mapped' => false
])
->add('isLegalGuardian', CheckboxType::class, [
'mapped' => false
])
->add('parentsLiveTogether', CheckboxType::class, [
'mapped' => false
])
->add('dcsApproved', CheckboxType::class, [
'mapped' => false
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Member::class,
]);
}
}

View File

@ -0,0 +1,44 @@
<?php
namespace App\Form;
use App\Entity\MemberCase;
use App\Entity\Referral;
use App\Enums\DischargeReason;
use App\Enums\ReferralServiceType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EnumType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ReferralFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('referralId')
->add('serviceCode', EnumType::class, [
'class' => ReferralServiceType::class,
'label' => 'Service Type'
])
->add('hours')
->add('endDate', null, [
'widget' => 'single_text',
])
->add('dischargeReason', EnumType::class, [
'class' => DischargeReason::class
])
->add('dischargeDate', null, [
'widget' => 'single_text',
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Referral::class,
]);
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Form;
use App\Entity\User;
use App\Entity\UserCase;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class UserCaseFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('user', EntityType::class, [
'class' => User::class,
'choice_label' => 'name',
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => UserCase::class,
]);
}
}

83
src/Form/UserFormType.php Normal file
View File

@ -0,0 +1,83 @@
<?php
namespace App\Form;
use App\Entity\User;
use App\Enums\CaseLevel;
use App\Enums\JobType;
use App\Enums\RateType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\EnumType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
class UserFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name', TextType::class, [
'label' => 'Name',
'attr' => [
'placeholder' => 'Name',
],
])
->add('username', TextType::class, [
'label' => 'Username',
'attr' => [
'placeholder' => 'Username',
],
])
->add('email', EmailType::class, [
'label' => 'Email',
'attr' => [
'placeholder' => 'Email',
],
])
->add('password', PasswordType::class, [
// instead of being set onto the object directly,
// this is read and encoded in the controller
'mapped' => false,
'attr' => ['autocomplete' => 'new-password'],
'constraints' => [
new NotBlank([
'message' => 'Please enter a password',
]),
new Length([
'min' => 6,
'minMessage' => 'Your password should be at least {{ limit }} characters',
// max length allowed by Symfony for security reasons
'max' => 4096,
]),
],
])
->add('caseWorker', CheckboxType::class)
->add('caseManager', CheckboxType::class)
->add('therapist', CheckboxType::class)
->add('su', CheckboxType::class, [
'label' => 'Admin',
])
->add('level', EnumType::class, [
'class' => CaseLevel::class,
])
->add('rateType', EnumType::class, [
'class' => RateType::class,
])
->add('rate', NumberType::class)
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => User::class,
]);
}
}

View File

@ -0,0 +1,53 @@
<?php
namespace App\Repository;
use App\Entity\Company;
use App\Entity\MemberCase;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<MemberCase>
*/
class MemberCaseRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, MemberCase::class);
}
public function getCompanyCases(Company $company): array
{
return $this->createQueryBuilder('m')
->andWhere('m.company = :company')
->setParameter('company', $company)
->getQuery()
->getResult();
}
// /**
// * @return MemberCase[] Returns an array of MemberCase objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('m')
// ->andWhere('m.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('m.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?MemberCase
// {
// return $this->createQueryBuilder('m')
// ->andWhere('m.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View File

@ -0,0 +1,55 @@
<?php
namespace App\Repository;
use App\Entity\Member;
use App\Entity\MemberCase;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Member>
*/
class MemberRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Member::class);
}
public function getCaseMembersByName(MemberCase $case): array
{
return $this->createQueryBuilder('m')
->andWhere('m.caseId = :case')
->setParameter('case', $case->getId()->toBinary())
->orderBy('m.lastName, m.firstName', 'ASC')
->getQuery()
->getResult()
;
}
// /**
// * @return Member[] Returns an array of Member objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('m')
// ->andWhere('m.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('m.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Member
// {
// return $this->createQueryBuilder('m')
// ->andWhere('m.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View File

@ -0,0 +1,68 @@
<?php
namespace App\Repository;
use App\Entity\MemberCase;
use App\Entity\Referral;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Referral>
*/
class ReferralRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Referral::class);
}
public function getActiveReferrals(MemberCase $case): array
{
return $this->createQueryBuilder('r')
->andWhere('r.dischargeDate IS NULL')
->andWhere('r.memberCase = :case')
->setParameter('case', $case->getId()->toBinary())
->orderBy('r.hours', 'ASC')
->getQuery()
->getResult()
;
}
public function getClosedReferrals(MemberCase $case): array
{
return $this->createQueryBuilder('r')
->andWhere('r.dischargeDate IS NOT NULL')
->andWhere('r.memberCase = :case')
->setParameter('case', $case->getId()->toBinary())
->orderBy('r.dischargeDate', 'DESC')
->getQuery()
->getResult()
;
}
// /**
// * @return Referral[] Returns an array of Referral objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('r')
// ->andWhere('r.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('r.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Referral
// {
// return $this->createQueryBuilder('r')
// ->andWhere('r.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View File

@ -0,0 +1,43 @@
<?php
namespace App\Repository;
use App\Entity\UserCase;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<UserCase>
*/
class UserCaseRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, UserCase::class);
}
// /**
// * @return UserCase[] Returns an array of UserCase objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('u')
// ->andWhere('u.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('u.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?UserCase
// {
// return $this->createQueryBuilder('u')
// ->andWhere('u.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View File

@ -40,6 +40,7 @@
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">DCS Case ID</th>
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Type/Source</th>
<th class='text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7'>County</th>
<th class='text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7'>Referral Count</th>
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Case Worker</th>
<th class="text-secondary opacity-7"></th>
</tr>
@ -69,6 +70,9 @@
<td>
<p class='text-xs font-weight-bold mb-0'>{{ c.county.value }}</p>
</td>
<td>
<p class='text-center text-xs font-weight-bold mb-0'>{{ c.referrals|length }}</p>
</td>
<td class='align-middle text-center text-xs'>
<p class='text-xs font-weight-bold mb-0'>
{% if c.userCases|length > 0 %}
@ -77,17 +81,17 @@
</p>
</td>
<td class='align-right'>
<a href='/index.php/edit-case/{{ c.id }}' class='' data-toggle='tooltip' data-original-title='Edit Case'>
<a href='/index.php/edit-case/{{ c.id }}' class='' title='Edit Case' data-toggle='tooltip' data-original-title='Edit Case'>
<i class="material-symbols-rounded opacity-5">edit</i>
</a>
<a href='/index.php/assign-case/{{ c.id }}' class='' data-toggle='tooltip' data-original-title='Assign Worker'>
<i class='material-symbols-rounded opacity-5'>person_add</i>
<a href='/index.php/assign-case/{{ c.id }}' class='' title='Assign Case Worker' data-toggle='tooltip' data-original-title='Assign Worker'>
<i class='material-symbols-rounded opacity-5'>badge</i>
</a>
<a href='/index.php/add-referral/{{ c.id }}' class='' data-toggle='tooltip' data-original-title='Add Referral'>
<a href='/index.php/list-referrals/{{ c.id }}' class='' title='List Referrals' data-toggle='tooltip' data-original-title='Add Referral'>
<i class='material-symbols-rounded opacity-5'>create_new_folder</i>
</a>
<a href='/index.php/list-members/{{ c.id }}' class='' data-toggle='tooltip' data-original-title='Add Member'>
<i class='material-symbols-rounded opacity-5'>person_add</i>
<a href='/index.php/list-members/{{ c.id }}' class='' title='List Members' data-toggle='tooltip' data-original-title='Add Member'>
<i class='material-symbols-rounded opacity-5'>group_add</i>
</a>
</td>
</tr>

View File

@ -0,0 +1,184 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ block('nav', 'internal/libs/nav.html.twig') }}
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
<section>
<div class="card card-plain">
<div class="card-header">
<h4 class="font-weight-bolder">Add Case Member</h4>
<p class="mb-0">{{ case.caseName }}</p>
</div>
<div class="card-body">
<div class="container">
{{ form_errors(form) }}
{{ form_start(form) }}
<div class="row">
<div class='col'>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_lastName' class='form-label'>Last Name</label>
<input type='text' name='{{ field_name(form.lastName) }}' id='member_form_lastName' class='form-control' required='required'/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_firstName' class='form-label'>First Name</label>
<input type='text' name='{{ field_name(form.firstName) }}' id='member_form_firstName' class='form-control' required='required'/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_personalId' class='form-label'>ID</label>
<input type='text' name='{{ field_name(form.personalId) }}' id='member_form_personalId' class='form-control' required="required"/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_dob' class='form-label'></label>
<input type='date' name='{{ field_name(form.dob) }}' id='member_form_dob' class='form-control' required="required"/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_emergencyContact' class='form-label'>Emergency Contact</label>
<input type='text' name='{{ field_name(form.emergencyContact) }}' id='member_form_emergencyContact' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_phone' class='form-label'>Phone</label>
<input type='text' name='{{ field_name(form.phone) }}' id='member_form_phone' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_dayPhone' class='form-label'>Day Phone</label>
<input type='text' name='{{ field_name(form.dayPhone) }}' id='member_form_dayPhone' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_eveningPhone' class='form-label'>Evening Phone</label>
<input type='text' name='{{ field_name(form.eveningPhone) }}' id='member_form_eveningPhone' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_cellPhone' class='form-label'>Cell Phone</label>
<input type='text' name='{{ field_name(form.cellPhone) }}' id='member_form_cellPhone' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_email' class='form-label'>Email</label>
<input type='email' name='{{ field_name(form.email) }}' id='member_form_email' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_school' class='form-label'>School</label>
<input type='text' name='{{ field_name(form.school) }}' id='member_form_school' class='form-control'/>
</div>
</div>
<div class='col'>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_address' class='form-label'>Address</label>
<input type='text' name='{{ field_name(form.address) }}' id='member_form_address' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_city' class='form-label'>City</label>
<input type='text' name='{{ field_name(form.city) }}' id='member_form_city' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_state' class='form-label'>State</label>
<input type='text' name='{{ field_name(form.state) }}' id='member_form_state' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_zip' class='form-label'>Zip</label>
<input type='text' name='{{ field_name(form.zip) }}' id='member_form_zip' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_maritalStatus' class='form-label'>Marital Status</label>
<input type='text' name='{{ field_name(form.maritalStatus) }}' id='member_form_maritalStatus' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_relationship' class='form-label'>Relationship</label>
<select name="{{ field_name(form.relationship) }}" id='member_form_relationship' class='form-control' required="required">
<option value=''></option>
{% for rel in enum('App\\Enums\\RelationshipType').cases() %}
<option value='{{ rel.value }}'>{{ rel.name }}</option>
{% endfor %}
</select>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_genderType' class='form-label'>Gender Type</label>
<select name="{{ field_name(form.gender) }}" id='member_form_gender' class='form-control' required="required">
<option value=''></option>
{% for gen in enum('App\\Enums\\GenderType').cases() %}
<option value='{{ gen.value }}'>{{ gen.name }}</option>
{% endfor %}
</select>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_race' class='form-label'>Race</label>
<select name="{{ field_name(form.race) }}" id='member_form_race' class='form-control'>
<option value=''></option>
{% for r in enum('App\\Enums\\RaceType').cases() %}
<option value='{{ r.value }}'>{{ r.name }}</option>
{% endfor %}
</select>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='member_form_language' class='form-label'>Language</label>
<input type='text' name='{{ field_name(form.language) }}' id='member_form_language' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<input type='checkbox' name='{{ field_name(form.isChild) }}' id='member_form_isChild'/>&nbsp;&nbsp;
<label for='member_form_isChild'>Child?</label>
</div>
<div class='input-group input-group-outline mb-3'>
<input type='checkbox' name='{{ field_name(form.isParent) }}' id='member_form_isParent'/>&nbsp;&nbsp;
<label for='member_form_isParent'>Parent?</label>
</div>
<div class='input-group input-group-outline mb-3'>
<input type='checkbox' name='{{ field_name(form.isAdultChild) }}' id='member_form_isAdultChild'/>&nbsp;&nbsp;
<label for='member_form_isAdultChild'>Adult Child?</label>
</div>
<div class='input-group input-group-outline mb-3'>
<input type='checkbox' name='{{ field_name(form.isLegalGuardian) }}' id='member_form_isLegalGuardian'/>&nbsp;&nbsp;
<label for='member_form_isLegalGuardian'>Legal Guardian?</label>
</div>
<div class='input-group input-group-outline mb-3'>
<input type='checkbox' name='{{ field_name(form.parentsLiveTogether) }}' id='member_form_parentsLiveTogether'/>&nbsp;&nbsp;
<label for='member_form_parentsLiveTogether'>Parents Living Together?</label>
</div>
<div class='input-group input-group-outline mb-3'>
<input type='checkbox' name='{{ field_name(form.dcsApproved) }}' id='member_form_dcsApproved'/>
<label for='member_form_dcsApproved'>DCS Approved?</label>
</div>
</div>
</div>
<div class='row'>
<div class="text-center">
<button type="submit" class="btn btn-lg bg-gradient-dark btn-lg w-100 mt-4 mb-0">Save Member</button>
</div>
</div>
{{ form_end(form) }}
</div>
</div>
</div>
</section>
</main>
{% endblock %}

View File

@ -0,0 +1,185 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ block('nav', 'internal/libs/nav.html.twig') }}
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
<section>
<div class="card card-plain">
<div class="card-header">
<h4 class="font-weight-bolder">Edit Case Member</h4>
<p class="mb-0">
{{ member.firstName }}
{{ member.lastName }}
</p>
</div>
<div class="card-body">
<div class="container">
{{ form_errors(form) }}
{{ form_start(form) }}
<input type='hidden' name='member_form_case_id' value='{{ caseId }}'/>
<div class="row">
<div class='col'>
<div class='input-group input-group-outline mb-3 is-filled'>
<label for='member_form_lastName' class='form-label'>Last Name</label>
<input type='text' name='{{ field_name(form.lastName) }}' id='member_form_lastName' value='{{ member.lastName }}' class='form-control' required='required'/>
</div>
<div class='input-group input-group-outline mb-3 is-filled'>
<label for='member_form_firstName' class='form-label'>First Name</label>
<input type='text' name='{{ field_name(form.firstName) }}' id='member_form_firstName' value='{{ member.firstName }}' class='form-control' required='required'/>
</div>
<div class='input-group input-group-outline mb-3 is-filled'>
<label for='member_form_personalId' class='form-label'>ID</label>
<input type='text' name='{{ field_name(form.personalId) }}' id='member_form_personalId' value='{{ member.personalId }}' class='form-control' required="required"/>
</div>
<div class='input-group input-group-outline mb-3{% if member.dob %} is-filled{% endif %}'>
<label for='member_form_dob' class='form-label'></label>
<input type='date' name='{{ field_name(form.dob) }}' id='member_form_dob' {% if member.dob %} value='{{ member.dob|date('Y-m-d') }}{% endif %}' class='form-control' required="required"/>
</div>
<div class='input-group input-group-outline mb-3{% if member.emergencyContact %} is-filled{% endif %}'>
<label for='member_form_emergencyContact' class='form-label'>Emergency Contact</label>
<input type='text' name='{{ field_name(form.emergencyContact) }}' id='member_form_emergencyContact' {% if member.emergencyContact %} value='{{ member.emergencyContact }}' {% endif %} class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3{% if member.phone %} is-filled{% endif %}'>
<label for='member_form_phone' class='form-label'>Phone</label>
<input type='text' name='{{ field_name(form.phone) }}' id='member_form_phone' {% if member.phone %} value='{{ member.phone }}' {% endif %} class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3{% if member.dayPhone %} is-filled{% endif %}'>
<label for='member_form_dayPhone' class='form-label'>Day Phone</label>
<input type='text' name='{{ field_name(form.dayPhone) }}' id='member_form_dayPhone' {% if member.dayPhone %} value='{{ member.dayPhone }}' {% endif %} class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3{% if member.eveningPhone %} is-filled{% endif %}'>
<label for='member_form_eveningPhone' class='form-label'>Evening Phone</label>
<input type='text' name='{{ field_name(form.eveningPhone) }}' id='member_form_eveningPhone' {% if member.eveningPhone %} value='{{ member.eveningPhone }}' {% endif %} class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3{% if member.cellPhone %} is-filled{% endif %}'>
<label for='member_form_cellPhone' class='form-label'>Cell Phone</label>
<input type='text' name='{{ field_name(form.cellPhone) }}' id='member_form_cellPhone' {% if member.cellPhone %} value='{{ member.cellPhone }}' {% endif %} class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3{% if member.email %} is-filled{% endif %}'>
<label for='member_form_email' class='form-label'>Email</label>
<input type='email' name='{{ field_name(form.email) }}' id='member_form_email' {% if member.email %} value='{{ member.email }}' {% endif %} class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3{% if member.school %} is-filled{% endif %}'>
<label for='member_form_school' class='form-label'>School</label>
<input type='text' name='{{ field_name(form.school) }}' id='member_form_school' {% if member.school %} value='{{ member.school }}' {% endif %} class='form-control'/>
</div>
</div>
<div class='col'>
<div class='input-group input-group-outline mb-3{% if member.address %} is-filled{% endif %}'>
<label for='member_form_address' class='form-label'>Address</label>
<input type='text' name='{{ field_name(form.address) }}' id='member_form_address' {% if member.address %} value='{{ member.address }}' {% endif %} class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3{% if member.city %} is-filled{% endif %}'>
<label for='member_form_city' class='form-label'>City</label>
<input type='text' name='{{ field_name(form.city) }}' id='member_form_city' {% if member.city %} value='{{ member.city }}' {% endif %} class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3{% if member.state %} is-filled{% endif %}'>
<label for='member_form_state' class='form-label'>State</label>
<input type='text' name='{{ field_name(form.state) }}' id='member_form_state' {% if member.state %} value='{{ member.state }}' {% endif %} class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3{% if member.zip %} is-filled{% endif %}'>
<label for='member_form_zip' class='form-label'>Zip</label>
<input type='text' name='{{ field_name(form.zip) }}' id='member_form_zip' {% if member.zip %} value='{{ member.zip }}' {% endif %} class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3{% if member.maritalStatus %} is-filled{% endif %}'>
<label for='member_form_maritalStatus' class='form-label'>Marital Status</label>
<input type='text' name='{{ field_name(form.maritalStatus) }}' id='member_form_maritalStatus' {% if member.maritalStatus %} value='{{ member.maritalStatus }}' {% endif %} class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3{% if member.relationship %} is-filled{% endif %}'>
<select name="{{ field_name(form.relationship) }}" id='member_form_relationship' class='form-control' required="required">
<option value=''>-- Select Ralationship --</option>
{% for rel in enum('App\\Enums\\RelationshipType').cases() %}
<option value='{{ rel.value }}' {% if rel.name == member.relationship.name %} selected='selected' {% endif %}>{{ rel.name }}</option>
{% endfor %}
</select>
</div>
<div class='input-group input-group-outline mb-3'>
<select name="{{ field_name(form.gender) }}" id='member_form_gender' class='form-control' required="required">
<option value=''>-- Select Gender --</option>
{% for gen in enum('App\\Enums\\GenderType').cases() %}
<option value='{{ gen.value }}' {% if gen.name == member.gender.name %} selected='selected' {% endif %}>{{ gen.name }}</option>
{% endfor %}
</select>
</div>
<div class='input-group input-group-outline mb-3'>
<select name="{{ field_name(form.race) }}" id='member_form_race' class='form-control'>
<option value=''>-- Select Race --</option>
{% for r in enum('App\\Enums\\RaceType').cases() %}
<option value='{{ r.value }}' {% if r.name == member.race.name %} selected='selected' {% endif %}>{{ r.name }}</option>
{% endfor %}
</select>
</div>
<div class='input-group input-group-outline mb-3{% if member.language %} is-filled {% endif %}'>
<label for='member_form_language' class='form-label'>Language</label>
<input type='text' name='{{ field_name(form.language) }}' id='member_form_language' {% if member.language %} value='{{ member.language }}' {% endif %} class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<input type='checkbox' name='{{ field_name(form.isChild) }}' id='member_form_isChild' {% if member.isChild %} checked='checked' {% endif %}/>&nbsp;&nbsp;
<label for='member_form_isChild'>Child?</label>
</div>
<div class='input-group input-group-outline mb-3'>
<input type='checkbox' name='{{ field_name(form.isParent) }}' id='member_form_isParent' {% if member.isParent %} checked='checked' {% endif %}/>&nbsp;&nbsp;
<label for='member_form_isParent'>Parent?</label>
</div>
<div class='input-group input-group-outline mb-3'>
<input type='checkbox' name='{{ field_name(form.isAdultChild) }}' id='member_form_isAdultChild' {% if member.isAdultChild %} checked='checked' {% endif %}/>&nbsp;&nbsp;
<label for='member_form_isAdultChild'>Adult Child?</label>
</div>
<div class='input-group input-group-outline mb-3'>
<input type='checkbox' name='{{ field_name(form.isLegalGuardian) }}' id='member_form_isLegalGuardian' {% if member.isLegalGuardian %} checked='checked' {% endif %}/>&nbsp;&nbsp;
<label for='member_form_isLegalGuardian'>Legal Guardian?</label>
</div>
<div class='input-group input-group-outline mb-3'>
<input type='checkbox' name='{{ field_name(form.parentsLiveTogether) }}' id='member_form_parentsLiveTogether' {% if member.parentsLiveTogether %} checked='checked' {% endif %}/>&nbsp;&nbsp;
<label for='member_form_parentsLiveTogether'>Parents Living Together?</label>
</div>
<div class='input-group input-group-outline mb-3'>
<input type='checkbox' name='{{ field_name(form.dcsApproved) }}' id='member_form_dcsApproved' {% if member.dcsApproved %} checked='checked' {% endif %}/>&nbsp;&nbsp;
<label for='member_form_dcsApproved'>DCS Approved?</label>
</div>
</div>
</div>
<div class='row'>
<div class="text-center">
<button type="submit" class="btn btn-lg bg-gradient-dark btn-lg w-100 mt-4 mb-0">Save Member</button>
</div>
</div>
{{ form_end(form) }}
</div>
</div>
</div>
</section>
</main>
{% endblock %}

View File

@ -0,0 +1,92 @@
{% extends 'base.html.twig' %}
{% block title %}Case Member List
{% endblock %}
{% block body %}
{{ block('nav', 'internal/libs/nav.html.twig') }}
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
<div class="container-fluid py-2">
<div class="row">
<div class="col-12">
<div class="card my-4">
<div class="card-header p-0 position-relative mt-n4 mx-3 z-index-2">
<div class="d-flex justify-content-between bg-gradient-dark shadow-dark border-radius-lg pt-4 pb-3 ps-3 p-2">
<div>
<h6 class="text-white text-capitalize ps-3">Member List</h6>
</div>
<div>
<button type="button" class="btn btn-block btn-light mb-3" onclick="window.open('/index.php/add-member/{{ case.id }}', '_self')">Add Member</button>
</div>
</div>
</div>
<div class="card-body px-0 pb-2">
<div class="table-responsive p-0">
<table class="table align-items-center mb-0">
<thead>
<tr>
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Name</th>
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7 ps-2">DOB</th>
<th class='text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7'>Relationship</th>
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Phone</th>
<th class="text-secondary opacity-7"></th>
</tr>
</thead>
<tbody>
{% for member in members %}
{% set age = '' %}
<tr>
<td>
<div class='d-flex px-2 py-1'>
<div class='d-flex flex-column justify-content-center'>
<h6 class='mb-0 text-small'>
<i class="material-symbols-rounded opacity-5">
{% if not member.isChild %}
{% if member.dcsApproved %}thumb_up{% else %}thumb_down
{% endif %}
{% endif %}
</i>
{{ member.firstName }}
{{ member.lastName }}
({{ date().diff(date(member.dob)).y }})
</h6>
<p class='text-xs text-secondary mb-0'>
<a href='mailto:{{ member.email }}'>{{ member.email }}</a>
</p>
</div>
</div>
</td>
<td title=''>
<p class='text-xs font-weight-bold mb-0'>
{{ member.dob|date("F j, Y") }}
</p>
</td>
<td>
<p class='text-xs font-weight-bold mb-0'>{{ member.relationship.value }}</p>
</td>
<td class='align-middle text-center text-xs'>
{% if member.phone %}
<a href='tel:{{ member.phone }}'>{{ member.getFormattedPhone() }}</a>
{% endif %}
</td>
<td class='align-middle'>
<a href='/index.php/case/{{ case.id }}/edit-member/{{ member.id }}' class='text-secondary font-weight-bold text-xs' data-toggle='tooltip' data-original-title='Edit Source'>
<i class="material-symbols-rounded opacity-5">edit</i>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
{% endblock %}

View File

@ -0,0 +1,73 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ block('nav', 'internal/libs/nav.html.twig') }}
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
<section>
<div class="card card-plain">
<div class="card-header">
<h4 class="font-weight-bolder">Add Referral</h4>
<p class="mb-0">{{ case.caseName }}</p>
</div>
<div class="card-body">
<div class="container">
{{ form_errors(form) }}
{{ form_start(form) }}
<div class='input-group input-group-outline mb-3'>
<label for='referral_form_referralId' class='form-label'>Referral ID</label>
<input type='text' name='{{ field_name(form.referralId) }}' id='referral_form_referralId' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<select name='{{ field_name(form.serviceCode) }}' id='referral_form_serviceCode' class='form-control'>
<option value=''>-- Select Service Code --</option>
{% for sc in enum('App\\Enums\\ReferralServiceType').cases() %}
<option value='{{ sc.value }}'>{{ sc.name }}</option>
{% endfor %}
</select>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='referral_form_hours' class='form-label'>Hours</label>
<input type='number' name='{{ field_name(form.hours) }}' id='referral_form_hours' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='referral_form_endDate' class='form-label'></label>
<input type='date' name='{{ field_name(form.endDate) }}' id='referral_form_endDate' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<select name='{{ field_name(form.dischargeReason) }}' id='referral_form_dischargeReason' class='form-control'>
<option value=''>-- Select Discharge Reason --</option>
{% for dr in enum('App\\Enums\\DischargeReason').cases() %}
<option value='{{ dr.value }}'>{{ dr.name }}</option>
{% endfor %}
</select>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='referral_form_dischargeDate' class='form-label'></label>
<input type='date' name='{{ field_name(form.dischargeDate) }}' id='referral_form_dischargeDate' class='form-control'/>
</div>
<div class='row'>
<div class="text-center">
<button type="submit" class="btn btn-lg bg-gradient-dark btn-lg w-100 mt-4 mb-0">Save Referral</button>
</div>
</div>
{{ form_end(form) }}
</div>
</div>
</div>
</section>
</main>
{% endblock %}

View File

@ -0,0 +1,73 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ block('nav', 'internal/libs/nav.html.twig') }}
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
<section>
<div class="card card-plain">
<div class="card-header">
<h4 class="font-weight-bolder">Add Referral</h4>
<p class="mb-0">{{ case.caseName }}</p>
</div>
<div class="card-body">
<div class="container">
{{ form_errors(form) }}
{{ form_start(form) }}
<div class='input-group input-group-outline mb-3 is-filled'>
<label for='referral_form_referralId' class='form-label'>Referral ID</label>
<input type='text' name='{{ field_name(form.referralId) }}' id='referral_form_referralId' value='{{ referral.referralId }}' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<select name='{{ field_name(form.serviceCode) }}' id='referral_form_serviceCode' class='form-control'>
<option value=''>-- Select Service Code --</option>
{% for sc in enum('App\\Enums\\ReferralServiceType').cases() %}
<option value='{{ sc.value }}' {% if referral.serviceCode.value == sc.value %} selected='selected' {% endif %}>{{ sc.name }}</option>
{% endfor %}
</select>
</div>
<div class='input-group input-group-outline mb-3 is-filled'>
<label for='referral_form_hours' class='form-label'>Hours</label>
<input type='number' name='{{ field_name(form.hours) }}' id='referral_form_hours' value='{{ referral.hours }}' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3 is-filled'>
<label for='referral_form_endDate' class='form-label'></label>
<input type='date' name='{{ field_name(form.endDate) }}' id='referral_form_endDate' value='{{ referral.endDate|date("Y-m-d") }}' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3'>
<select name='{{ field_name(form.dischargeReason) }}' id='referral_form_dischargeReason' class='form-control'>
<option value=''>-- Select Discharge Reason --</option>
{% for dr in enum('App\\Enums\\DischargeReason').cases() %}
<option value='{{ dr.value }}'>{{ dr.name }}</option>
{% endfor %}
</select>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='referral_form_dischargeDate' class='form-label'></label>
<input type='date' name='{{ field_name(form.dischargeDate) }}' id='referral_form_dischargeDate' class='form-control'/>
</div>
<div class='row'>
<div class="text-center">
<button type="submit" class="btn btn-lg bg-gradient-dark btn-lg w-100 mt-4 mb-0">Save Referral</button>
</div>
</div>
{{ form_end(form) }}
</div>
</div>
</div>
</section>
</main>
{% endblock %}

View File

@ -0,0 +1,123 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ block('nav', 'internal/libs/nav.html.twig') }}
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
<div class="container-fluid py-2">
<div class="row">
<div class="col-12">
<div class="card my-4">
<div class="card-header p-0 position-relative mt-n4 mx-3 z-index-2">
<div class="d-flex justify-content-between bg-gradient-dark shadow-dark border-radius-lg pt-4 pb-3 ps-3 p-2">
<div>
<h6 class="text-white text-capitalize ps-3">Referral List</h6>
</div>
<div>
<button type="button" class="btn btn-block btn-light mb-3" onclick="window.open('/index.php/add-referral/{{ case.id }}', '_self')">Add Referral</button>
</div>
</div>
</div>
<div class="card-body px-0 pb-2">
<div>
Filter:
</div>
<div class="table-responsive p-0">
<table class="table align-items-center mb-0">
<thead>
<tr>
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Referral ID</th>
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7 ps-2">Service</th>
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Hours Rem</th>
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">End Date</th>
<th class="text-secondary opacity-7"></th>
</tr>
</thead>
<tbody>
{% for r in openReferrals %}
<tr>
<td>
<h6 class='mb-0 text-small'>{{ r.referralId }}</h6>
</td>
<td>
<p class='text-xs font-weight-bold mb-0'>{{ r.serviceCode.value }}</p>
</td>
<td>
<p class='text-xs font-weight-bold mb-0'>{{ r.hours }}</p>
</td>
<td>
<p class='text-xs font-weight-bold mb-0'>{{ r.endDate|date("F j, Y") }}</p>
</td>
<td class='align-right'>
<a href='/index.php/case/{{ case.id }}/edit-referral/{{ r.id }}' class='' title='Edit Referral' data-toggle='tooltip'>
<i class="material-symbols-rounded opacity-5">edit</i>
</a>
<a href='/index.php/list-notes/{{ r.id }}' class='' title='List Notes' data-toggle='tooltip'>
<i class='material-symbols-rounded opacity-5'>edit_note</i>
</a>
<a href='#' class='' title='Close Referral' data-toggle='tooltip'>
<i class='material-symbols-rounded opacity-5'>close</i>
</a>
</td>
</tr>
</td>
</tbody>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card my-4">
<div class="card-header p-0 position-relative mt-n4 mx-3 z-index-2">
<div class="d-flex justify-content-between bg-gradient-dark shadow-dark border-radius-lg pt-4 pb-3 ps-3 p-2">
<div>
<h6 class="text-white text-capitalize ps-3">Closed Referrals</h6>
</div>
</div>
</div>
<div class="card-body px-0 pb-2">
<div class="table-responsive p-0">
<table class="table align-items-center mb-0">
<thead>
<tr>
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Referral ID</th>
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7 ps-2">Service</th>
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Discharge Reason</th>
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Discharge Date</th>
<th class="text-secondary opacity-7"></th>
</tr>
</thead>
<tbody>
{% for r in closedReferrals %}
<tr>
<td>
<h6 class='mb-0 text-small'>{{ r.referralId }}</h6>
</td>
<td>
<p class='text-xs font-weight-bold mb-0'>{{ r.serviceCode.value }}</p>
</td>
<td>
<p class='text-xs font-weight-bold mb-0'>{{ r.dischargeReason.value }}</p>
</td>
<td>
<p class='text-xs font-weight-bold mb-0'>{{ r.dischargeDate|date("F j, Y") }}</p>
</td>
<td class='align-right'></td>
</tr>
</td>
</tbody>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</main>
{% endblock %}