import { useState, useCallback, useEffect } from “react”;
const FLASHCARDS = [
{ q: “According to the protocol, what defines an ‘Inpatient’ (IP) admission?”, a: “A patient who is admitted to hospital and requires the use of a bed overnight.” },
{ q: “How is a ‘Day Case’ (DC) admission defined in terms of hospital stay?”, a: “An elective admission for care or treatment that does not require an overnight stay.” },
{ q: “Which national standard must Inpatient and Day Case classifications meet for coding purposes?”, a: “The Hospital Inpatient Enquiry (HIPE) standard using ICD-10-AM coding.” },
{ q: “What is the definition of ‘Ambulatory Care’ according to the National Acute Medicine Programme?”, a: “Clinical care provided on a ‘day basis’ that is not within the traditional hospital bed base or outpatient service.” },
{ q: “Should a patient seen in a ‘See and Treat’ clinic be placed on a day case waiting list?”, a: “No, these clinics should be managed in line with the Outpatient Waiting List Management Protocol.” },
{ q: “What defines a ‘Planned Procedure’ (PP) on a waiting list?”, a: “A patient who had an initial episode of care and requires recall for further timed or surveillance treatment.” },
{ q: “What are the three clinical statuses a patient can have while on a waiting list?”, a: “Active, TCI (To Come In), or Suspended.” },
{ q: “Which category of patients is specifically excluded from being submitted to the NTPF extract?”, a: “Private patients on public hospital waiting lists or consultant private lists.” },
{ q: “Are patients awaiting National Screening Services like ‘BowelScreen’ submitted to the NTPF?”, a: “No, they are excluded from the weekly extract file.” },
{ q: “How quickly must a direct referral be entered onto the hospital’s administration system?”, a: “Within 24 hours of receipt.” },
{ q: “What is the timeframe for a clinician to clinically prioritise a direct referral after receipt?”, a: “Within five working days.” },
{ q: “What does the abbreviation ‘CPC’ stand for in the context of waiting list management?”, a: “Clinical Prioritisation Category.” },
{ q: “What are the three levels of urgency assigned in the Clinical Prioritisation Process?”, a: “Urgent, Semi Urgent, and Non Urgent (Routine).” },
{ q: “What is the Maximum Clinically Recommended Time (CRT) for an ‘Urgent’ prioritisation category?”, a: “Less than 28 days.” },
{ q: “What is the Maximum Clinically Recommended Time (CRT) for a ‘Semi Urgent’ prioritisation category?”, a: “Less than 13 weeks.” },
{ q: “What is the Maximum Clinically Recommended Time (CRT) for a ‘Non Urgent’ prioritisation category?”, a: “Less than 9 months.” },
{ q: “For a standard referral from an Outpatient Department, what date is used as the ‘Start Wait Time’?”, a: “The date the ‘decision to admit’ was made by the clinician.” },
{ q: “How is the ‘Start Wait Time’ determined for a paper-based Direct Referral?”, a: “The date the referral is received, date-stamped, and entered on the electronic waiting list.” },
{ q: “What marks the ‘Start Wait Time’ for an electronic Direct Referral (eReferral)?”, a: “The date the eReferral was created and sent on the eReferral system by the referrer.” },
{ q: “What are the three categories of Planned Procedures listed in the protocol?”, a: “Planned (Multiple Treatment Dates), Timed (Specific Date/Timeline), and Surveillance.” },
{ q: “How should ‘second eye cataract surgery’ or ‘second hip surgery’ be managed on the waiting list?”, a: “They should be added as two separate episodes of care on the active list, not the Planned Procedure list.” },
{ q: “What is the maximum future timeframe for scheduling a patient for a ‘To Come In’ (TCI) date?”, a: “Patients must not be scheduled more than six weeks into the future.” },
{ q: “What is considered a ‘reasonable offer’ of a TCI date in terms of notice?”, a: “A minimum of two weeks’ notice.” },
{ q: “What is the consequence for a patient who declines two ‘reasonable offers’ of a TCI date?”, a: “They should be removed from the waiting list following the safe removal process.” },
{ q: “What does ‘HCAN’ stand for in the context of cancellations?”, a: “Hospital Cancelled Appointment.” },
{ q: “What does ‘CNA’ stand for regarding patient-initiated cancellations?”, a: “Can Not Attend.” },
{ q: “What happens to a patient’s ‘wait time clock’ if they cancel a TCI date for personal reasons (CNA)?”, a: “The wait time clock will restart at the national level.” },
{ q: “If a patient cancels a TCI date due to clinical reasons, does their wait time clock restart?”, a: “No, provided the appropriate clinical cancellation reason code is used.” },
{ q: “How is a ‘Did Not Attend’ (DNA) event defined?”, a: “When a patient has been issued a TCI date and fails to attend without prior notification.” },
{ q: “What is the standard procedure for a non-urgent patient who records one ‘DNA’ for a reasonable TCI offer?”, a: “They are removed from the waiting list.” },
{ q: “What is the maximum suspension period allowed for clinical or non-clinical reasons?”, a: “No less than two weeks and no longer than three months.” },
{ q: “What is the maximum suspension period allowed for patients participating in commissioning initiatives?”, a: “No less than two weeks and no longer than six months.” },
{ q: “How does a ‘non-clinical suspension’ affect a patient’s overall wait time?”, a: “The period of suspension time is deducted from the overall waiting list time.” },
{ q: “Define ‘Insourcing’ in the context of commissioning initiatives.”, a: “The provision of additional capacity within a public hospital.” },
{ q: “Define ‘Outsourcing’ in the context of commissioning initiatives.”, a: “The provision of procured capacity with a private hospital or service provider.” },
{ q: “When does the suspension period begin for a patient participating in an outsourcing initiative?”, a: “The date the patient accepts the offer to access hospital care in another hospital.” },
{ q: “What are the three types of Waiting List Validation mentioned in the protocol?”, a: “Administrative Patient Validation, Data Validation, and Clinical Validation.” },
{ q: “What is the primary purpose of ‘Administrative Patient Validation’?”, a: “To contact patients to confirm if they are still ready, willing, and available to proceed with care.” },
{ q: “What system allows patients to respond to validation letters online?”, a: “The Patient Online Automated Response (POLAR) system.” },
{ q: “Who is responsible for carrying out the ‘Clinical Validation’ process?”, a: “A clinician or a delegated clinical team member.” },
{ q: “Within what timeframe must removal correspondence be sent to the patient and GP after a removal decision?”, a: “Within two working days of removal.” },
{ q: “What is the ‘Reinstatement’ window if a patient or GP requests to be put back on the list after a removal?”, a: “Within four weeks of the notification of the decision to remove.” },
{ q: “What are the two clinical prioritisation categories specifically for GI Endoscopy?”, a: “Priority 1 (P1 or Urgent) and Priority 2 (P2 or Routine).” },
{ q: “What is the Maximum Clinically Recommended Time (CRT) for a GI Endoscopy ‘Priority 1’ (P1) patient?”, a: “Up to one month (specifically less than 28 days for urgent colonoscopies).” },
{ q: “What is the Maximum Clinically Recommended Time (CRT) for a GI Endoscopy ‘Priority 2’ (P2) patient?”, a: “Less than 13 weeks (91 days).” },
{ q: “How should BowelScreen patients be recorded on a hospital’s patient administration system?”, a: “As a Day Case procedure with the referral source listed as ‘BowelScreen’.” },
{ q: “Within what timeframe should a GI Endoscopy planned procedure be scheduled relative to its indicative date?”, a: “Within two weeks of the indicative date.” },
{ q: “How much notice is considered a ‘reasonable offer’ for a GI Endoscopy appointment?”, a: “A minimum of two weeks’ notice.” },
{ q: “In the event of a short-notice TCI slot, should a patient’s wait time clock be reset if they decline?”, a: “No, unless the offer was ‘reasonable’ (at least two weeks’ notice).” },
{ q: “What must be included in the ‘Removal Process’ documentation to ensure a clear audit trail?”, a: “Formal correspondence to the GP, Consultant, Source of Referral, and Patient.” },
{ q: “What action is taken if a patient fails to respond to a validation reminder letter?”, a: “They may be removed from the waiting list.” },
{ q: “If a patient is reinstated following a DNA, from what date is their wait time usually calculated?”, a: “The date of their DNA (unless otherwise stated by the clinician).” },
{ q: “What is the mandatory timeframe for updating a GI Endoscopy booking form on the system after receipt?”, a: “Within 24 hours of receipt.” },
{ q: “Which specific clinical staff are permitted to assign a CPC to a GI Endoscopy referral?”, a: “Consultants, Senior Registrars, or GI Endoscopy Triage Nurses.” },
{ q: “According to the protocol, what is a ‘Short Notice Appointment’?”, a: “A TCI date offered with less than two weeks’ notice.” },
{ q: “What is the ‘Maximum Clinically Recommended Time’ (CRT) designed to achieve?”, a: “To minimise risk and achieve the best clinical outcome for the patient.” },
{ q: “How often should Data Validation exercises typically be carried out by a hospital?”, a: “On a weekly basis to identify discrepancies or anomalies.” },
{ q: “What is a ‘Valid Offer’ in the context of Insourcing and Outsourcing?”, a: “When a patient or guardian has accepted the offer of treatment and agreed to participate in the initiative.” },
{ q: “Can a patient undergo multiple suspensions for the same procedure?”, a: “No, patients should generally be suspended on one occasion only, unless an extension is specifically agreed.” },
{ q: “How long can a GI Endoscopy surveillance procedure be delayed beyond its planned indicative date?”, a: “Up to 13 weeks.” },
];
function shuffleArray(arr) {
const a = […arr];
for (let i = a.length – 1; i > 0; i–) {
const j = Math.floor(Math.random() * (i + 1));
[a[i], a[j]] = [a[j], a[i]];
}
return a;
}
export default function FlashcardApp() {
const [cards, setCards] = useState(FLASHCARDS);
const [index, setIndex] = useState(0);
const [flipped, setFlipped] = useState(false);
const [known, setKnown] = useState(new Set());
const [unknown, setUnknown] = useState(new Set());
const [mode, setMode] = useState(“all”); // all, unknown, known
const [animDir, setAnimDir] = useState(null);
const filteredCards = cards.filter((_, i) => {
if (mode === “unknown”) return unknown.has(i);
if (mode === “known”) return known.has(i);
return true;
});
const currentCard = filteredCards[index] || null;
const originalIndex = currentCard ? cards.indexOf(currentCard) : -1;
const safeIndex = Math.min(index, Math.max(0, filteredCards.length – 1));
useEffect(() => {
if (index !== safeIndex) setIndex(safeIndex);
}, [safeIndex, index]);
const goNext = useCallback(() => {
if (index < filteredCards.length - 1) {
setAnimDir("next");
setTimeout(() => {
setFlipped(false);
setIndex(i => i + 1);
setAnimDir(null);
}, 200);
}
}, [index, filteredCards.length]);
const goPrev = useCallback(() => {
if (index > 0) {
setAnimDir(“prev”);
setTimeout(() => {
setFlipped(false);
setIndex(i => i – 1);
setAnimDir(null);
}, 200);
}
}, [index]);
const handleShuffle = () => {
const shuffled = shuffleArray(FLASHCARDS);
setCards(shuffled);
setIndex(0);
setFlipped(false);
setKnown(new Set());
setUnknown(new Set());
setMode(“all”);
};
const handleReset = () => {
setCards(FLASHCARDS);
setIndex(0);
setFlipped(false);
setKnown(new Set());
setUnknown(new Set());
setMode(“all”);
};
const markKnown = () => {
if (originalIndex === -1) return;
setKnown(prev => { const s = new Set(prev); s.add(originalIndex); return s; });
setUnknown(prev => { const s = new Set(prev); s.delete(originalIndex); return s; });
if (!flipped) setFlipped(true);
};
const markUnknown = () => {
if (originalIndex === -1) return;
setUnknown(prev => { const s = new Set(prev); s.add(originalIndex); return s; });
setKnown(prev => { const s = new Set(prev); s.delete(originalIndex); return s; });
if (!flipped) setFlipped(true);
};
useEffect(() => {
const handler = (e) => {
if (e.key === “ArrowRight”) goNext();
if (e.key === “ArrowLeft”) goPrev();
if (e.key === ” ” || e.key === “Enter”) { e.preventDefault(); setFlipped(f => !f); }
};
window.addEventListener(“keydown”, handler);
return () => window.removeEventListener(“keydown”, handler);
}, [goNext, goPrev]);
const progress = ((known.size + unknown.size) / cards.length) * 100;
const knownPct = (known.size / cards.length) * 100;
return (
{/* Subtle grid texture */}
{/* Header */}
{/* Progress bar */}
{/* Filter tabs */}
{/* Nav arrows */}
>
)}
{/* Keyboard hints */}
);
}
Waiting List Protocol
Study Flashcards
{known.size} known / {unknown.size} to review / {cards.length – known.size – unknown.size} unseen
{Math.round(progress)}% reviewed
0 ? (knownPct / progress) * 100 : 0}%, #f59e0b ${progress > 0 ? (knownPct / progress) * 100 : 0}%, #f59e0b 100%)`,
borderRadius: 3,
transition: “width 0.4s ease”,
}} />
{[
{ key: “all”, label: `All (${cards.length})` },
{ key: “unknown”, label: `To Review (${unknown.size})` },
{ key: “known”, label: `Known (${known.size})` },
].map(t => (
))}
{/* Card */}
{filteredCards.length === 0 ? (
No cards in this filter. Try “All” to see everything.
) : (
setFlipped(f => !f)}
style={{
width: “100%”,
minHeight: 320,
perspective: “1200px”,
cursor: “pointer”,
marginBottom: 20,
opacity: animDir ? 0.4 : 1,
transform: animDir === “next” ? “translateX(-30px)” : animDir === “prev” ? “translateX(30px)” : “none”,
transition: “opacity 0.2s, transform 0.2s”,
}}
>
)}
{/* Navigation & actions */}
{filteredCards.length > 0 && (
<>
{/* Know / Don’t Know buttons */}
{/* Front */}
{/* Back */}
Question
{currentCard.q}
Click to reveal answer
Answer
{currentCard.a}
Click to see question
{index + 1} / {filteredCards.length}
{/* Utility buttons */}
Space flip
|
←
→ navigate