{"idea":"# Neighborhood clinic\nA small internal-medicine clinic runs its day on one shared system: bookings, reception, the patient interview,\nthe doctor's notes, prescriptions, billing, medicine stock and waiting-time estimates. The reception tablet, the\ndoctor's PC, the stock screen, the patient's phone and the waiting-room display each have their own screen.\nLanguage: English.\n\n## Data\n- Patients: name, age, chronic conditions, allergies, phone. Start with 8 believable patients.\n- Bookings: patient, time, purpose, status (booked / arrived / cancelled). Start with 6 bookings for today.\n- Reception: number, patient, time, symptom in a few words, urgency (high / medium / low), status (waiting / interviewed / with doctor / to pay / done), minutes waited.\n- Interviews: reception number, summary, points to watch, note for the doctor.\n- Exam records: reception number, doctor's note, assessment, draft prescription, next visit.\n- Prescriptions: reception number, medicine, dose, days, interaction warning.\n- Stock: medicine, left, minimum, on order. Start with 12 medicines.\n- Bills: reception number, amount, breakdown, paid.\n- Waiting-room notice: the number being called, the expected wait and one line of guidance.\n- Today's summary: check-ins, patients seen, average wait, anything worth attention, in one sentence.\n- Clock: the current time, starting at 9:00.\n\n## Screens\n- Reception (tablet): the notice; patient name and symptom inputs with a \"Check in\" button; today's bookings with\n  \"Arrived\" and \"Cancel\" on each; reception list, most urgent first, with urgency, status, minutes waited and\n  \"To billing\"; bills waiting with \"Paid\"; a \"Next 10 minutes\" button.\n- Consulting room (PC): who is with the doctor; the waiting list, most urgent first, with \"Call in\"; interviews;\n  the doctor's note input with \"Record exam\"; exam records with \"Prescribe\"; prescriptions.\n- Stock (PC): medicines with left, minimum, on order and \"Order\"; today's summary.\n- Patient (phone): \"Your turn\" with the notice; reception number and a longer description of symptoms with\n  \"Send interview\".\n- Waiting room (display): the notice in large type, and the waiting numbers with minutes waited.\n\n## Behaviour\n- Check in: create the reception entry (next number, the clock time, waiting); judge urgency from the symptom and\n  the patient's conditions and age; mark today's booking for that patient as arrived; estimate the wait from who is\n  waiting and how urgent they are; rewrite the notice.\n- Arrived: mark the booking arrived and check that patient in the same way. Cancel: mark it cancelled.\n- Send interview: summarise the description, write points to watch and a note for the doctor, mark the entry\n  interviewed and revise its urgency if the answers warrant it.\n- Call in: put the chosen entry with the doctor, move anyone already with the doctor to \"to pay\", update the notice.\n- Record exam: from the doctor's note and the interview, write the assessment, a draft prescription and the next visit.\n- Prescribe: turn the draft into prescriptions, check allergies, conditions and interactions and write warnings;\n  reduce stock and put anything below its minimum on order.\n- To billing: estimate the amount and breakdown from the exam and prescriptions. Paid: mark the bill paid and the\n  entry done, and rewrite today's summary.\n- Next 10 minutes: move the clock on 10 minutes, add 10 to everyone's minutes waited, sometimes add a believable\n  walk-in patient, rewrite the notice and the summary.\n- Order: put the medicine on order.\n\n## Checks\n- Checking in \"Ken Sato\" with \"chest tightness\" gives high urgency and puts him at the top of the list.\n- Sending an interview adds one interview and marks that entry interviewed.\n- Calling in, recording the exam and prescribing adds prescriptions and reduces the stock used.\n- Billing and paying marks the entry done and rewrites today's summary.\n","name":"Neighborhood Clinic","setup":{"ms":65080,"cost":0.40514799999999995,"turns":18,"calls":[{"name":"write_brief","args":"{\"name\":\"Neighborhood Clinic\",\"lang\":\"en\",\"brief\":\"One shared system for a small internal-medicine clinic. Collections: patients, bookings, reception, interview"},{"name":"apply","args":"{\"values\":{\"clock\":\"9:00\",\"with doctor\":\"Nobody\"},\"changes\":[{\"op\":\"add\",\"collection\":\"patients\",\"item\":{\"name\":\"Ken Sato\",\"age\":58,\"conditions\":\"hypertension\","},{"name":"apply","args":"{\"changes\":[{\"op\":\"remove\",\"collection\":\"interviews\",\"id\":\"i30\"},{\"op\":\"remove\",\"collection\":\"exams\",\"id\":\"i31\"},{\"op\":\"remove\",\"collection\":\"prescriptions\",\"id"},{"name":"define_screen","args":"{\"name\":\"Reception\",\"device\":\"reception tablet\",\"frame\":\"panel\",\"parts\":[{\"kind\":\"heading\",\"label\":\"Reception\"},{\"kind\":\"text\",\"text\":\"Clock {value clock}\"},{\"k"},{"name":"define_screen","args":"{\"name\":\"Consulting room\",\"device\":\"doctor's PC\",\"frame\":\"desktop\",\"parts\":[{\"kind\":\"heading\",\"label\":\"Consulting room\"},{\"kind\":\"text\",\"text\":\"With the doctor:"},{"name":"define_screen","args":"{\"name\":\"Stock\",\"device\":\"stock PC\",\"frame\":\"desktop\",\"parts\":[{\"kind\":\"heading\",\"label\":\"Medicine stock\"},{\"kind\":\"list\",\"collection\":\"stock\",\"row\":[{\"kind\":\"t"},{"name":"define_screen","args":"{\"name\":\"Patient\",\"device\":\"patient's phone\",\"frame\":\"phone\",\"parts\":[{\"kind\":\"heading\",\"label\":\"Your turn\"},{\"kind\":\"list\",\"collection\":\"notice\",\"columns\":[\"ca"},{"name":"define_screen","args":"{\"name\":\"Waiting room\",\"device\":\"waiting room display\",\"frame\":\"iot\",\"parts\":[{\"kind\":\"list\",\"collection\":\"notice\",\"columns\":[\"calling\",\"expected wait\",\"guidanc"},{"name":"add_check","args":"{\"name\":\"Chest tightness check-in\",\"steps\":[{\"intent\":\"Check in\",\"inputs\":{\"patient name\":\"Ken Sato\",\"symptom\":\"chest tightness\"}}],\"expect\":[\"Ken Sato has high"},{"name":"add_check","args":"{\"name\":\"Visit to payment\",\"steps\":[{\"intent\":\"Call in\",\"item\":\"Rina Mori\"},{\"intent\":\"Record exam\",\"inputs\":{\"doctor note\":\"BP low, dehydrated\"}},{\"intent\":\"Pr"},{"name":"set_reality","args":"{\"summary\":\"Records and screens are ordinary code; urgency, summaries and drug checks need a model plus a drug database, with clinician review.\",\"items\":[{\"part"},{"name":"define_screen","args":"{\"name\":\"Reception\",\"device\":\"reception tablet\",\"frame\":\"panel\",\"parts\":[{\"kind\":\"heading\",\"text\":\"Reception\"},{\"kind\":\"text\",\"text\":\"Clock {value clock}\"},{\"ki"},{"name":"define_screen","args":"{\"name\":\"Consulting room\",\"device\":\"doctor's PC\",\"frame\":\"desktop\",\"parts\":[{\"kind\":\"heading\",\"text\":\"Consulting room\"},{\"kind\":\"text\",\"text\":\"With the doctor: "},{"name":"define_screen","args":"{\"name\":\"Stock\",\"device\":\"stock PC\",\"frame\":\"desktop\",\"parts\":[{\"kind\":\"heading\",\"text\":\"Medicine stock\"},{\"kind\":\"list\",\"collection\":\"stock\",\"row\":[{\"kind\":\"te"},{"name":"define_screen","args":"{\"name\":\"Patient\",\"device\":\"patient's phone\",\"frame\":\"phone\",\"parts\":[{\"kind\":\"heading\",\"text\":\"Your turn\"},{\"kind\":\"list\",\"collection\":\"notice\",\"columns\":[\"cal"},{"name":"add_check","args":"{\"name\":\"Interview\",\"steps\":[{\"intent\":\"Send interview\",\"inputs\":{\"reception number\":\"1\",\"description\":\"Dizzy for two days when standing, poor appetite\"}}],\"exp"}]},"reality":{"summary":"Records and screens are ordinary code; urgency, summaries and drug checks need a model plus a drug database, with clinician review.","items":[{"part":"urgency triage","existing":"LLM classifier","effect":"Occasional under-triage; must be reviewed by staff"},{"part":"interaction check","existing":"Drug database service","effect":"Reliable if database used; model alone is risky"}],"intents":[{"intent":"Check in the patient with the given name and symptom","parts":[{"what":"create entry, mark booking","builtWith":"code","detail":"Database writes"},{"what":"judge urgency","builtWith":"model","detail":"LLM with red-flag rules"},{"what":"wait estimate and notice","builtWith":"code","detail":"Queue formula plus template"}],"errorRate":0.1,"delayMs":2000,"mistakes":"Under-rates vague symptoms; name mismatches"},{"intent":"Send interview for the reception number with the description","parts":[{"what":"summarise and flag","builtWith":"model","detail":"LLM summarisation"},{"what":"status update","builtWith":"code","detail":"DB write"}],"errorRate":0.12,"delayMs":3500,"mistakes":"Misses details or over-states certainty"},{"intent":"Prescribe from this exam record's draft","parts":[{"what":"interaction and allergy check","builtWith":"service","detail":"Drug database API"},{"what":"stock update","builtWith":"code","detail":"Inventory decrement"}],"errorRate":0.08,"delayMs":3000,"mistakes":"Missed rare interactions; wrong quantity"},{"intent":"Record exam for the patient with the doctor from the doctor's note","parts":[{"what":"assessment and draft","builtWith":"model","detail":"LLM clinical drafting, doctor confirms"}],"errorRate":0.15,"delayMs":4000,"mistakes":"Plausible but wrong assessment"},{"intent":"Move the clock on 10 minutes","parts":[{"what":"clock, waits, summary","builtWith":"code","detail":"Arithmetic"},{"what":"walk-in","builtWith":"not_yet","detail":"Real walk-ins come from people, not simulated"}],"errorRate":0.02,"delayMs":800,"mistakes":"None significant"}],"audioLatencyMs":0,"leak":0,"decisionDelayMs":2500,"errorRate":0.1,"minIntervalSec":1,"cpuNote":"Light; model calls dominate latency."},"steps":[{"kind":"event","device":"reception tablet","screen":"Reception","intent":"Check in the patient with the given name and symptom","item":null,"inputs":{"patient name":"Ken Sato","symptom":"chest tightness since this morning, a bit short of breath"},"say":"Reception checks in a walk-in patient.","reply":"Ken Sato is checked in as No. 2 with high urgency because of chest tightness and shortness of breath, and the notice and summary now flag him for prompt assessment.","ms":8446,"cost":0.0673915,"calls":[{"name":"apply","args":"{\"changes\":[{\"op\":\"add\",\"collection\":\"patients\",\"item\":{\"name\":\"Ken Sato\"}},{\"op\":\"add\",\"collection\":\"reception\",\"item\":{\"number\":2,\"patient\":\"Ken Sato\",\"time\":"}],"reality":false,"state":{"clock":"9:00","with doctor":"Nobody","patients":[{"name":"Ken Sato","age":58,"conditions":"hypertension","allergies":"none","phone":"090-1111-0001","id":"i1"},{"name":"Mary Tanaka","age":72,"conditions":"diabetes, hypertension","allergies":"penicillin","phone":"090-1111-0002","id":"i2"},{"name":"Joe Suzuki","age":34,"conditions":"none","allergies":"none","phone":"090-1111-0003","id":"i3"},{"name":"Emi Kato","age":27,"conditions":"asthma","allergies":"aspirin","phone":"090-1111-0004","id":"i4"},{"name":"Hiro Ito","age":65,"conditions":"heart failure","allergies":"none","phone":"090-1111-0005","id":"i5"},{"name":"Anna Brown","age":45,"conditions":"migraine","allergies":"none","phone":"090-1111-0006","id":"i6"},{"name":"Taro Yamada","age":8,"conditions":"none","allergies":"egg","phone":"090-1111-0007","id":"i7"},{"name":"Rina Mori","age":80,"conditions":"kidney disease","allergies":"NSAIDs","phone":"090-1111-0008","id":"i8"},{"name":"Ken Sato","id":"i34"}],"bookings":[{"patient":"Mary Tanaka","time":"9:30","purpose":"diabetes check-up","status":"booked","id":"i9"},{"patient":"Joe Suzuki","time":"9:40","purpose":"sore throat and cough","status":"booked","id":"i10"},{"patient":"Emi Kato","time":"10:00","purpose":"asthma inhaler refill","status":"booked","id":"i11"},{"patient":"Hiro Ito","time":"10:20","purpose":"swollen ankles","status":"booked","id":"i12"},{"patient":"Anna Brown","time":"10:40","purpose":"headache","status":"booked","id":"i13"},{"patient":"Taro Yamada","time":"11:00","purpose":"fever","status":"booked","id":"i14"}],"stock":[{"medicine":"Amlodipine 5mg","left":120,"minimum":50,"on order":0,"id":"i15"},{"medicine":"Metformin 500mg","left":90,"minimum":60,"on order":0,"id":"i16"},{"medicine":"Acetaminophen 500mg","left":200,"minimum":80,"on order":0,"id":"i17"},{"medicine":"Loxoprofen 60mg","left":70,"minimum":40,"on order":0,"id":"i18"},{"medicine":"Amoxicillin 250mg","left":60,"minimum":50,"on order":0,"id":"i19"},{"medicine":"Salbutamol inhaler","left":15,"minimum":10,"on order":0,"id":"i20"},{"medicine":"Furosemide 20mg","left":45,"minimum":30,"on order":0,"id":"i21"},{"medicine":"Omeprazole 20mg","left":80,"minimum":40,"on order":0,"id":"i22"},{"medicine":"Sumatriptan 50mg","left":20,"minimum":15,"on order":0,"id":"i23"},{"medicine":"Cough syrup","left":25,"minimum":20,"on order":0,"id":"i24"},{"medicine":"Nitroglycerin tablets","left":12,"minimum":10,"on order":0,"id":"i25"},{"medicine":"Oral rehydration salts","left":40,"minimum":20,"on order":0,"id":"i26"}],"notice":[{"calling":"None yet","expected wait":"About 5 minutes","guidance":"Ken Sato (No. 2) has been marked for priority. If chest pain worsens or breathing becomes harder, tell staff immediately.","id":"i27"}],"summary":[{"text":"2 check-ins today (Rina Mori, Ken Sato); 0 seen; average wait 10 min so far. Attention: Ken Sato reports chest tightness and shortness of breath, marked high urgency for prompt assessment.","id":"i28"}],"reception":[{"number":1,"patient":"Rina Mori","time":"8:50","symptom":"dizziness","urgency":"medium","status":"waiting","minutes waited":10,"id":"i29"},{"number":2,"patient":"Ken Sato","time":"9:00","symptom":"chest tightness since this morning, a bit short of breath","urgency":"high","status":"waiting","minutes waited":0,"id":"i35"}],"interviews":[],"exams":[],"prescriptions":[],"bills":[],"__sounds":[],"__bands":[]}},{"kind":"event","device":"reception tablet","screen":"Reception","intent":"Mark this booking arrived and check the patient in","item":{"collection":"bookings","id":"i10"},"inputs":{},"say":"A booked patient arrives.","reply":"Joe Suzuki has arrived and is checked in as No. 3 (low urgency for sore throat and cough), and the notice now shows an expected wait of about 30 minutes.","ms":8735,"cost":0.0732645,"calls":[{"name":"query","args":"{\"collection\":\"patients\",\"where\":{\"name\":\"Joe Suzuki\"}}"},{"name":"apply","args":"{\"changes\":[{\"op\":\"update\",\"collection\":\"bookings\",\"id\":\"i10\",\"set\":{\"status\":\"arrived\"}},{\"op\":\"add\",\"collection\":\"reception\",\"item\":{\"number\":3,\"patient\":\"Joe"}],"reality":false,"state":{"clock":"9:00","with doctor":"Nobody","patients":[{"name":"Ken Sato","age":58,"conditions":"hypertension","allergies":"none","phone":"090-1111-0001","id":"i1"},{"name":"Mary Tanaka","age":72,"conditions":"diabetes, hypertension","allergies":"penicillin","phone":"090-1111-0002","id":"i2"},{"name":"Joe Suzuki","age":34,"conditions":"none","allergies":"none","phone":"090-1111-0003","id":"i3"},{"name":"Emi Kato","age":27,"conditions":"asthma","allergies":"aspirin","phone":"090-1111-0004","id":"i4"},{"name":"Hiro Ito","age":65,"conditions":"heart failure","allergies":"none","phone":"090-1111-0005","id":"i5"},{"name":"Anna Brown","age":45,"conditions":"migraine","allergies":"none","phone":"090-1111-0006","id":"i6"},{"name":"Taro Yamada","age":8,"conditions":"none","allergies":"egg","phone":"090-1111-0007","id":"i7"},{"name":"Rina Mori","age":80,"conditions":"kidney disease","allergies":"NSAIDs","phone":"090-1111-0008","id":"i8"},{"name":"Ken Sato","id":"i34"}],"bookings":[{"patient":"Mary Tanaka","time":"9:30","purpose":"diabetes check-up","status":"booked","id":"i9"},{"patient":"Joe Suzuki","time":"9:40","purpose":"sore throat and cough","status":"arrived","id":"i10"},{"patient":"Emi Kato","time":"10:00","purpose":"asthma inhaler refill","status":"booked","id":"i11"},{"patient":"Hiro Ito","time":"10:20","purpose":"swollen ankles","status":"booked","id":"i12"},{"patient":"Anna Brown","time":"10:40","purpose":"headache","status":"booked","id":"i13"},{"patient":"Taro Yamada","time":"11:00","purpose":"fever","status":"booked","id":"i14"}],"stock":[{"medicine":"Amlodipine 5mg","left":120,"minimum":50,"on order":0,"id":"i15"},{"medicine":"Metformin 500mg","left":90,"minimum":60,"on order":0,"id":"i16"},{"medicine":"Acetaminophen 500mg","left":200,"minimum":80,"on order":0,"id":"i17"},{"medicine":"Loxoprofen 60mg","left":70,"minimum":40,"on order":0,"id":"i18"},{"medicine":"Amoxicillin 250mg","left":60,"minimum":50,"on order":0,"id":"i19"},{"medicine":"Salbutamol inhaler","left":15,"minimum":10,"on order":0,"id":"i20"},{"medicine":"Furosemide 20mg","left":45,"minimum":30,"on order":0,"id":"i21"},{"medicine":"Omeprazole 20mg","left":80,"minimum":40,"on order":0,"id":"i22"},{"medicine":"Sumatriptan 50mg","left":20,"minimum":15,"on order":0,"id":"i23"},{"medicine":"Cough syrup","left":25,"minimum":20,"on order":0,"id":"i24"},{"medicine":"Nitroglycerin tablets","left":12,"minimum":10,"on order":0,"id":"i25"},{"medicine":"Oral rehydration salts","left":40,"minimum":20,"on order":0,"id":"i26"}],"notice":[{"calling":"None yet","expected wait":"About 30 minutes for No. 3","guidance":"Ken Sato (No. 2) is marked for priority and will be called first. If chest pain worsens or breathing becomes harder, tell staff immediately.","id":"i27"}],"summary":[{"text":"3 check-ins today (Rina Mori, Ken Sato, Joe Suzuki); 0 seen; average wait 10 min so far. Attention: Ken Sato reports chest tightness and shortness of breath, marked high urgency for prompt assessment.","id":"i28"}],"reception":[{"number":1,"patient":"Rina Mori","time":"8:50","symptom":"dizziness","urgency":"medium","status":"waiting","minutes waited":10,"id":"i29"},{"number":2,"patient":"Ken Sato","time":"9:00","symptom":"chest tightness since this morning, a bit short of breath","urgency":"high","status":"waiting","minutes waited":0,"id":"i35"},{"number":3,"patient":"Joe Suzuki","time":"9:00","symptom":"sore throat and cough","urgency":"low","status":"waiting","minutes waited":0,"id":"i36"}],"interviews":[],"exams":[],"prescriptions":[],"bills":[],"__sounds":[],"__bands":[]}},{"kind":"event","device":"patient's phone","screen":"Patient","intent":"Send interview for the reception number with the description","item":null,"inputs":{"reception number":"2","description":"It started around 7am while walking to the station. Pressure in the middle of my chest, comes and goes, sometimes goes to my left arm. I take amlodipine for blood pressure."},"say":"While waiting, the patient answers the interview on their phone.","reply":"Ken Sato (No. 2) has been interviewed and stays high priority: his chest pressure, which sometimes spreads to his left arm, is flagged for the doctor to assess first.","ms":8885,"cost":0.06790249999999999,"calls":[{"name":"apply","args":"{\"changes\":[{\"op\":\"add\",\"collection\":\"interviews\",\"item\":{\"reception\":2,\"patient\":\"Ken Sato\",\"summary\":\"Chest pressure since about 7am, comes and goes, sometime"}],"reality":false,"state":{"clock":"9:00","with doctor":"Nobody","patients":[{"name":"Ken Sato","age":58,"conditions":"hypertension","allergies":"none","phone":"090-1111-0001","id":"i1"},{"name":"Mary Tanaka","age":72,"conditions":"diabetes, hypertension","allergies":"penicillin","phone":"090-1111-0002","id":"i2"},{"name":"Joe Suzuki","age":34,"conditions":"none","allergies":"none","phone":"090-1111-0003","id":"i3"},{"name":"Emi Kato","age":27,"conditions":"asthma","allergies":"aspirin","phone":"090-1111-0004","id":"i4"},{"name":"Hiro Ito","age":65,"conditions":"heart failure","allergies":"none","phone":"090-1111-0005","id":"i5"},{"name":"Anna Brown","age":45,"conditions":"migraine","allergies":"none","phone":"090-1111-0006","id":"i6"},{"name":"Taro Yamada","age":8,"conditions":"none","allergies":"egg","phone":"090-1111-0007","id":"i7"},{"name":"Rina Mori","age":80,"conditions":"kidney disease","allergies":"NSAIDs","phone":"090-1111-0008","id":"i8"},{"name":"Ken Sato","id":"i34"}],"bookings":[{"patient":"Mary Tanaka","time":"9:30","purpose":"diabetes check-up","status":"booked","id":"i9"},{"patient":"Joe Suzuki","time":"9:40","purpose":"sore throat and cough","status":"arrived","id":"i10"},{"patient":"Emi Kato","time":"10:00","purpose":"asthma inhaler refill","status":"booked","id":"i11"},{"patient":"Hiro Ito","time":"10:20","purpose":"swollen ankles","status":"booked","id":"i12"},{"patient":"Anna Brown","time":"10:40","purpose":"headache","status":"booked","id":"i13"},{"patient":"Taro Yamada","time":"11:00","purpose":"fever","status":"booked","id":"i14"}],"stock":[{"medicine":"Amlodipine 5mg","left":120,"minimum":50,"on order":0,"id":"i15"},{"medicine":"Metformin 500mg","left":90,"minimum":60,"on order":0,"id":"i16"},{"medicine":"Acetaminophen 500mg","left":200,"minimum":80,"on order":0,"id":"i17"},{"medicine":"Loxoprofen 60mg","left":70,"minimum":40,"on order":0,"id":"i18"},{"medicine":"Amoxicillin 250mg","left":60,"minimum":50,"on order":0,"id":"i19"},{"medicine":"Salbutamol inhaler","left":15,"minimum":10,"on order":0,"id":"i20"},{"medicine":"Furosemide 20mg","left":45,"minimum":30,"on order":0,"id":"i21"},{"medicine":"Omeprazole 20mg","left":80,"minimum":40,"on order":0,"id":"i22"},{"medicine":"Sumatriptan 50mg","left":20,"minimum":15,"on order":0,"id":"i23"},{"medicine":"Cough syrup","left":25,"minimum":20,"on order":0,"id":"i24"},{"medicine":"Nitroglycerin tablets","left":12,"minimum":10,"on order":0,"id":"i25"},{"medicine":"Oral rehydration salts","left":40,"minimum":20,"on order":0,"id":"i26"}],"notice":[{"calling":"None yet","expected wait":"About 30 minutes for No. 3","guidance":"Ken Sato (No. 2) has been interviewed and is marked high priority; he will be called first. If chest pain worsens or breathing becomes harder, tell staff immediately.","id":"i27"}],"summary":[{"text":"3 check-ins today (Rina Mori, Ken Sato, Joe Suzuki); 0 seen; average wait 10 min so far. Attention: Ken Sato (No. 2) interviewed. Chest pressure radiating to left arm and shortness of breath; high urgency, needs prompt doctor assessment.","id":"i28"}],"reception":[{"number":1,"patient":"Rina Mori","time":"8:50","symptom":"dizziness","urgency":"medium","status":"waiting","minutes waited":10,"id":"i29"},{"number":2,"patient":"Ken Sato","time":"9:00","symptom":"chest tightness since this morning, a bit short of breath","urgency":"high","status":"interviewed","minutes waited":0,"id":"i35"},{"number":3,"patient":"Joe Suzuki","time":"9:00","symptom":"sore throat and cough","urgency":"low","status":"waiting","minutes waited":0,"id":"i36"}],"interviews":[{"reception":2,"patient":"Ken Sato","summary":"Chest pressure since about 7am, comes and goes, sometimes radiates to the left arm. Mild shortness of breath. Takes amlodipine for blood pressure.","points to watch":"Recurrent exertional-type chest pressure with left arm radiation; shortness of breath; blood pressure control on amlodipine.","note for doctor":"Possible cardiac chest pain. Assess promptly with ECG and vital signs before any other step. Urgency stays high.","id":"i37"}],"exams":[],"prescriptions":[],"bills":[],"__sounds":[],"__bands":[]}},{"kind":"event","device":"doctor's PC","screen":"Consulting room","intent":"Call in this waiting entry to the doctor","item":{"collection":"reception","id":"i35"},"inputs":{},"say":"The doctor calls in the most urgent patient.","reply":"Ken Sato (No. 2) is now with the doctor, and the notice and \"with doctor\" board are updated.","ms":7213,"cost":0.056236499999999995,"calls":[{"name":"apply","args":"{\"changes\":[{\"op\":\"update\",\"collection\":\"reception\",\"id\":\"i35\",\"set\":{\"status\":\"with doctor\"}},{\"op\":\"update\",\"collection\":\"notice\",\"id\":\"i27\",\"set\":{\"calling\":"}],"reality":false,"state":{"clock":"9:00","with doctor":"Ken Sato (No. 2)","patients":[{"name":"Ken Sato","age":58,"conditions":"hypertension","allergies":"none","phone":"090-1111-0001","id":"i1"},{"name":"Mary Tanaka","age":72,"conditions":"diabetes, hypertension","allergies":"penicillin","phone":"090-1111-0002","id":"i2"},{"name":"Joe Suzuki","age":34,"conditions":"none","allergies":"none","phone":"090-1111-0003","id":"i3"},{"name":"Emi Kato","age":27,"conditions":"asthma","allergies":"aspirin","phone":"090-1111-0004","id":"i4"},{"name":"Hiro Ito","age":65,"conditions":"heart failure","allergies":"none","phone":"090-1111-0005","id":"i5"},{"name":"Anna Brown","age":45,"conditions":"migraine","allergies":"none","phone":"090-1111-0006","id":"i6"},{"name":"Taro Yamada","age":8,"conditions":"none","allergies":"egg","phone":"090-1111-0007","id":"i7"},{"name":"Rina Mori","age":80,"conditions":"kidney disease","allergies":"NSAIDs","phone":"090-1111-0008","id":"i8"},{"name":"Ken Sato","id":"i34"}],"bookings":[{"patient":"Mary Tanaka","time":"9:30","purpose":"diabetes check-up","status":"booked","id":"i9"},{"patient":"Joe Suzuki","time":"9:40","purpose":"sore throat and cough","status":"arrived","id":"i10"},{"patient":"Emi Kato","time":"10:00","purpose":"asthma inhaler refill","status":"booked","id":"i11"},{"patient":"Hiro Ito","time":"10:20","purpose":"swollen ankles","status":"booked","id":"i12"},{"patient":"Anna Brown","time":"10:40","purpose":"headache","status":"booked","id":"i13"},{"patient":"Taro Yamada","time":"11:00","purpose":"fever","status":"booked","id":"i14"}],"stock":[{"medicine":"Amlodipine 5mg","left":120,"minimum":50,"on order":0,"id":"i15"},{"medicine":"Metformin 500mg","left":90,"minimum":60,"on order":0,"id":"i16"},{"medicine":"Acetaminophen 500mg","left":200,"minimum":80,"on order":0,"id":"i17"},{"medicine":"Loxoprofen 60mg","left":70,"minimum":40,"on order":0,"id":"i18"},{"medicine":"Amoxicillin 250mg","left":60,"minimum":50,"on order":0,"id":"i19"},{"medicine":"Salbutamol inhaler","left":15,"minimum":10,"on order":0,"id":"i20"},{"medicine":"Furosemide 20mg","left":45,"minimum":30,"on order":0,"id":"i21"},{"medicine":"Omeprazole 20mg","left":80,"minimum":40,"on order":0,"id":"i22"},{"medicine":"Sumatriptan 50mg","left":20,"minimum":15,"on order":0,"id":"i23"},{"medicine":"Cough syrup","left":25,"minimum":20,"on order":0,"id":"i24"},{"medicine":"Nitroglycerin tablets","left":12,"minimum":10,"on order":0,"id":"i25"},{"medicine":"Oral rehydration salts","left":40,"minimum":20,"on order":0,"id":"i26"}],"notice":[{"calling":"No. 2 Ken Sato, now with the doctor","expected wait":"About 30 minutes for No. 3","guidance":"Ken Sato (No. 2) is now with the doctor. Joe Suzuki (No. 3), please keep waiting; if you feel worse, tell staff immediately.","id":"i27"}],"summary":[{"text":"3 check-ins today (Rina Mori, Ken Sato, Joe Suzuki); 0 seen; average wait 10 min so far. Attention: Ken Sato (No. 2) interviewed. Chest pressure radiating to left arm and shortness of breath; high urgency, needs prompt doctor assessment.","id":"i28"}],"reception":[{"number":1,"patient":"Rina Mori","time":"8:50","symptom":"dizziness","urgency":"medium","status":"waiting","minutes waited":10,"id":"i29"},{"number":2,"patient":"Ken Sato","time":"9:00","symptom":"chest tightness since this morning, a bit short of breath","urgency":"high","status":"with doctor","minutes waited":0,"id":"i35"},{"number":3,"patient":"Joe Suzuki","time":"9:00","symptom":"sore throat and cough","urgency":"low","status":"waiting","minutes waited":0,"id":"i36"}],"interviews":[{"reception":2,"patient":"Ken Sato","summary":"Chest pressure since about 7am, comes and goes, sometimes radiates to the left arm. Mild shortness of breath. Takes amlodipine for blood pressure.","points to watch":"Recurrent exertional-type chest pressure with left arm radiation; shortness of breath; blood pressure control on amlodipine.","note for doctor":"Possible cardiac chest pain. Assess promptly with ECG and vital signs before any other step. Urgency stays high.","id":"i37"}],"exams":[],"prescriptions":[],"bills":[],"__sounds":[],"__bands":[]}},{"kind":"event","device":"doctor's PC","screen":"Consulting room","intent":"Record exam for the patient with the doctor from the doctor's note","item":null,"inputs":{"doctor note":"BP 158/94, pulse 88 regular. ECG: no ST elevation. Pain eases at rest. Likely stable angina; rule out ACS. Start nitroglycerin as needed and low-dose aspirin, refer to cardiology this week."},"say":"The doctor writes a short note; the system drafts the assessment and prescription.","reply":"Exam recorded for Ken Sato (No. 2): likely stable angina, ECG without ST elevation, draft prescription of nitroglycerin as needed and low-dose aspirin, with cardiology referral this week.","ms":9420,"cost":0.06610649999999998,"calls":[{"name":"apply","args":"{\"changes\":[{\"op\":\"add\",\"collection\":\"exams\",\"item\":{\"reception\":2,\"patient\":\"Ken Sato\",\"entry\":\"i35\",\"assessment\":\"Likely stable angina; ACS to be ruled out. B"}],"reality":false,"state":{"clock":"9:00","with doctor":"Ken Sato (No. 2)","patients":[{"name":"Ken Sato","age":58,"conditions":"hypertension","allergies":"none","phone":"090-1111-0001","id":"i1"},{"name":"Mary Tanaka","age":72,"conditions":"diabetes, hypertension","allergies":"penicillin","phone":"090-1111-0002","id":"i2"},{"name":"Joe Suzuki","age":34,"conditions":"none","allergies":"none","phone":"090-1111-0003","id":"i3"},{"name":"Emi Kato","age":27,"conditions":"asthma","allergies":"aspirin","phone":"090-1111-0004","id":"i4"},{"name":"Hiro Ito","age":65,"conditions":"heart failure","allergies":"none","phone":"090-1111-0005","id":"i5"},{"name":"Anna Brown","age":45,"conditions":"migraine","allergies":"none","phone":"090-1111-0006","id":"i6"},{"name":"Taro Yamada","age":8,"conditions":"none","allergies":"egg","phone":"090-1111-0007","id":"i7"},{"name":"Rina Mori","age":80,"conditions":"kidney disease","allergies":"NSAIDs","phone":"090-1111-0008","id":"i8"},{"name":"Ken Sato","id":"i34"}],"bookings":[{"patient":"Mary Tanaka","time":"9:30","purpose":"diabetes check-up","status":"booked","id":"i9"},{"patient":"Joe Suzuki","time":"9:40","purpose":"sore throat and cough","status":"arrived","id":"i10"},{"patient":"Emi Kato","time":"10:00","purpose":"asthma inhaler refill","status":"booked","id":"i11"},{"patient":"Hiro Ito","time":"10:20","purpose":"swollen ankles","status":"booked","id":"i12"},{"patient":"Anna Brown","time":"10:40","purpose":"headache","status":"booked","id":"i13"},{"patient":"Taro Yamada","time":"11:00","purpose":"fever","status":"booked","id":"i14"}],"stock":[{"medicine":"Amlodipine 5mg","left":120,"minimum":50,"on order":0,"id":"i15"},{"medicine":"Metformin 500mg","left":90,"minimum":60,"on order":0,"id":"i16"},{"medicine":"Acetaminophen 500mg","left":200,"minimum":80,"on order":0,"id":"i17"},{"medicine":"Loxoprofen 60mg","left":70,"minimum":40,"on order":0,"id":"i18"},{"medicine":"Amoxicillin 250mg","left":60,"minimum":50,"on order":0,"id":"i19"},{"medicine":"Salbutamol inhaler","left":15,"minimum":10,"on order":0,"id":"i20"},{"medicine":"Furosemide 20mg","left":45,"minimum":30,"on order":0,"id":"i21"},{"medicine":"Omeprazole 20mg","left":80,"minimum":40,"on order":0,"id":"i22"},{"medicine":"Sumatriptan 50mg","left":20,"minimum":15,"on order":0,"id":"i23"},{"medicine":"Cough syrup","left":25,"minimum":20,"on order":0,"id":"i24"},{"medicine":"Nitroglycerin tablets","left":12,"minimum":10,"on order":0,"id":"i25"},{"medicine":"Oral rehydration salts","left":40,"minimum":20,"on order":0,"id":"i26"}],"notice":[{"calling":"No. 2 Ken Sato, now with the doctor","expected wait":"About 30 minutes for No. 3","guidance":"Ken Sato (No. 2) is now with the doctor. Joe Suzuki (No. 3), please keep waiting; if you feel worse, tell staff immediately.","id":"i27"}],"summary":[{"text":"3 check-ins today (Rina Mori, Ken Sato, Joe Suzuki); 0 billed; 1 exam recorded (Ken Sato, No. 2, likely stable angina, ECG no ST elevation); average wait 10 min so far. Attention: Ken Sato's referral to cardiology this week; prescription for nitroglycerin and aspirin needs confirmation.","id":"i28"}],"reception":[{"number":1,"patient":"Rina Mori","time":"8:50","symptom":"dizziness","urgency":"medium","status":"waiting","minutes waited":10,"id":"i29"},{"number":2,"patient":"Ken Sato","time":"9:00","symptom":"chest tightness since this morning, a bit short of breath","urgency":"high","status":"with doctor","minutes waited":0,"id":"i35"},{"number":3,"patient":"Joe Suzuki","time":"9:00","symptom":"sore throat and cough","urgency":"low","status":"waiting","minutes waited":0,"id":"i36"}],"interviews":[{"reception":2,"patient":"Ken Sato","summary":"Chest pressure since about 7am, comes and goes, sometimes radiates to the left arm. Mild shortness of breath. Takes amlodipine for blood pressure.","points to watch":"Recurrent exertional-type chest pressure with left arm radiation; shortness of breath; blood pressure control on amlodipine.","note for doctor":"Possible cardiac chest pain. Assess promptly with ECG and vital signs before any other step. Urgency stays high.","id":"i37"}],"exams":[{"reception":2,"patient":"Ken Sato","entry":"i35","assessment":"Likely stable angina; ACS to be ruled out. BP 158/94, pulse 88 regular. ECG shows no ST elevation. Pain eases at rest.","draft prescription":"Nitroglycerin sublingual as needed for chest pain; low-dose aspirin daily (check bleeding risk before final sign-off).","next visit":"Cardiology referral this week; return immediately if pain worsens, lasts over 15 minutes, or breathing worsens.","note":"BP 158/94, pulse 88 regular. ECG: no ST elevation. Pain eases at rest. Likely stable angina; rule out ACS. Start nitroglycerin as needed and low-dose aspirin, refer to cardiology this week.","id":"i38"}],"prescriptions":[],"bills":[],"__sounds":[],"__bands":[]}},{"kind":"event","device":"doctor's PC","screen":"Consulting room","intent":"Prescribe from this exam record's draft","item":{"collection":"exams","id":"i38"},"inputs":{},"say":"Prescribing checks allergies and interactions and takes the medicine out of stock.","reply":"Prescriptions for Ken Sato are drafted: nitroglycerin is recorded and stock is reduced to 10, while aspirin is pending a bleeding-risk check and has no stock entry yet.","ms":11543,"cost":0.109387,"calls":[{"name":"query","args":"{\"collection\":\"stock\"}"},{"name":"query","args":"{\"collection\":\"patients\",\"ids\":[\"i34\"]}"},{"name":"apply","args":"{\"changes\":[{\"op\":\"add\",\"collection\":\"prescriptions\",\"item\":{\"exam\":\"i38\",\"reception\":2,\"patient\":\"Ken Sato\",\"medicine\":\"Nitroglycerin sublingual tablets\",\"dose"}],"reality":false,"state":{"clock":"9:00","with doctor":"Ken Sato (No. 2)","patients":[{"name":"Ken Sato","age":58,"conditions":"hypertension","allergies":"none","phone":"090-1111-0001","id":"i1"},{"name":"Mary Tanaka","age":72,"conditions":"diabetes, hypertension","allergies":"penicillin","phone":"090-1111-0002","id":"i2"},{"name":"Joe Suzuki","age":34,"conditions":"none","allergies":"none","phone":"090-1111-0003","id":"i3"},{"name":"Emi Kato","age":27,"conditions":"asthma","allergies":"aspirin","phone":"090-1111-0004","id":"i4"},{"name":"Hiro Ito","age":65,"conditions":"heart failure","allergies":"none","phone":"090-1111-0005","id":"i5"},{"name":"Anna Brown","age":45,"conditions":"migraine","allergies":"none","phone":"090-1111-0006","id":"i6"},{"name":"Taro Yamada","age":8,"conditions":"none","allergies":"egg","phone":"090-1111-0007","id":"i7"},{"name":"Rina Mori","age":80,"conditions":"kidney disease","allergies":"NSAIDs","phone":"090-1111-0008","id":"i8"},{"name":"Ken Sato","id":"i34"}],"bookings":[{"patient":"Mary Tanaka","time":"9:30","purpose":"diabetes check-up","status":"booked","id":"i9"},{"patient":"Joe Suzuki","time":"9:40","purpose":"sore throat and cough","status":"arrived","id":"i10"},{"patient":"Emi Kato","time":"10:00","purpose":"asthma inhaler refill","status":"booked","id":"i11"},{"patient":"Hiro Ito","time":"10:20","purpose":"swollen ankles","status":"booked","id":"i12"},{"patient":"Anna Brown","time":"10:40","purpose":"headache","status":"booked","id":"i13"},{"patient":"Taro Yamada","time":"11:00","purpose":"fever","status":"booked","id":"i14"}],"stock":[{"medicine":"Amlodipine 5mg","left":120,"minimum":50,"on order":0,"id":"i15"},{"medicine":"Metformin 500mg","left":90,"minimum":60,"on order":0,"id":"i16"},{"medicine":"Acetaminophen 500mg","left":200,"minimum":80,"on order":0,"id":"i17"},{"medicine":"Loxoprofen 60mg","left":70,"minimum":40,"on order":0,"id":"i18"},{"medicine":"Amoxicillin 250mg","left":60,"minimum":50,"on order":0,"id":"i19"},{"medicine":"Salbutamol inhaler","left":15,"minimum":10,"on order":0,"id":"i20"},{"medicine":"Furosemide 20mg","left":45,"minimum":30,"on order":0,"id":"i21"},{"medicine":"Omeprazole 20mg","left":80,"minimum":40,"on order":0,"id":"i22"},{"medicine":"Sumatriptan 50mg","left":20,"minimum":15,"on order":0,"id":"i23"},{"medicine":"Cough syrup","left":25,"minimum":20,"on order":0,"id":"i24"},{"medicine":"Nitroglycerin tablets","left":10,"minimum":10,"on order":0,"id":"i25"},{"medicine":"Oral rehydration salts","left":40,"minimum":20,"on order":0,"id":"i26"}],"notice":[{"calling":"No. 2 Ken Sato, now with the doctor","expected wait":"About 30 minutes for No. 3","guidance":"Ken Sato (No. 2) is now with the doctor. Joe Suzuki (No. 3), please keep waiting; if you feel worse, tell staff immediately.","id":"i27"}],"summary":[{"text":"3 check-ins today (Rina Mori, Ken Sato, Joe Suzuki); 0 billed; 1 exam recorded (Ken Sato, No. 2, likely stable angina, ECG no ST elevation); prescriptions drafted for Ken Sato (nitroglycerin reduced stock to 10; aspirin pending bleeding check and not in stock list); average wait 10 min so far. Attention: Ken Sato's cardiology referral this week.","id":"i28"}],"reception":[{"number":1,"patient":"Rina Mori","time":"8:50","symptom":"dizziness","urgency":"medium","status":"waiting","minutes waited":10,"id":"i29"},{"number":2,"patient":"Ken Sato","time":"9:00","symptom":"chest tightness since this morning, a bit short of breath","urgency":"high","status":"with doctor","minutes waited":0,"id":"i35"},{"number":3,"patient":"Joe Suzuki","time":"9:00","symptom":"sore throat and cough","urgency":"low","status":"waiting","minutes waited":0,"id":"i36"}],"interviews":[{"reception":2,"patient":"Ken Sato","summary":"Chest pressure since about 7am, comes and goes, sometimes radiates to the left arm. Mild shortness of breath. Takes amlodipine for blood pressure.","points to watch":"Recurrent exertional-type chest pressure with left arm radiation; shortness of breath; blood pressure control on amlodipine.","note for doctor":"Possible cardiac chest pain. Assess promptly with ECG and vital signs before any other step. Urgency stays high.","id":"i37"}],"exams":[{"reception":2,"patient":"Ken Sato","entry":"i35","assessment":"Likely stable angina; ACS to be ruled out. BP 158/94, pulse 88 regular. ECG shows no ST elevation. Pain eases at rest.","draft prescription":"Nitroglycerin sublingual as needed for chest pain; low-dose aspirin daily (check bleeding risk before final sign-off).","next visit":"Cardiology referral this week; return immediately if pain worsens, lasts over 15 minutes, or breathing worsens.","note":"BP 158/94, pulse 88 regular. ECG: no ST elevation. Pain eases at rest. Likely stable angina; rule out ACS. Start nitroglycerin as needed and low-dose aspirin, refer to cardiology this week.","id":"i38"}],"prescriptions":[{"exam":"i38","reception":2,"patient":"Ken Sato","medicine":"Nitroglycerin sublingual tablets","dose":"0.3 mg under the tongue as needed for chest pain, up to 3 doses 5 minutes apart","days":30,"allergy check":"No allergies recorded","conditions check":"Hypertension (amlodipine); no kidney or liver disease recorded","interactions":"Additive blood pressure lowering with amlodipine; check for dizziness on standing","warning":"Sit down before use; call emergency services if pain lasts over 15 minutes after the 3rd dose","id":"i39"},{"exam":"i38","reception":2,"patient":"Ken Sato","medicine":"Aspirin low-dose 81 mg","dose":"1 tablet daily after food","days":30,"allergy check":"No allergies recorded","conditions check":"Bleeding risk not yet confirmed","interactions":"None with current amlodipine or nitroglycerin","warning":"Pending: bleeding risk check before final sign-off; not in stock list","id":"i40"}],"bills":[],"__sounds":[],"__bands":[]}},{"kind":"event","device":"reception tablet","screen":"Reception","intent":"Send this reception entry to billing and create the bill","item":{"collection":"reception","id":"i35"},"inputs":{},"say":"Reception sends him to billing; the system estimates the bill.","reply":"Ken Sato (No. 2) is now set to pay, with a $120 bill created (consultation, ECG, nitroglycerin, and aspirin, which is still pending a bleeding check).","ms":8558,"cost":0.0839955,"calls":[{"name":"apply","args":"{\"changes\":[{\"op\":\"update\",\"collection\":\"reception\",\"id\":\"i35\",\"set\":{\"status\":\"to pay\"}},{\"op\":\"add\",\"collection\":\"bills\",\"item\":{\"reception\":2,\"patient\":\"Ken "}],"reality":false,"state":{"clock":"9:00","with doctor":"Ken Sato (No. 2)","patients":[{"name":"Ken Sato","age":58,"conditions":"hypertension","allergies":"none","phone":"090-1111-0001","id":"i1"},{"name":"Mary Tanaka","age":72,"conditions":"diabetes, hypertension","allergies":"penicillin","phone":"090-1111-0002","id":"i2"},{"name":"Joe Suzuki","age":34,"conditions":"none","allergies":"none","phone":"090-1111-0003","id":"i3"},{"name":"Emi Kato","age":27,"conditions":"asthma","allergies":"aspirin","phone":"090-1111-0004","id":"i4"},{"name":"Hiro Ito","age":65,"conditions":"heart failure","allergies":"none","phone":"090-1111-0005","id":"i5"},{"name":"Anna Brown","age":45,"conditions":"migraine","allergies":"none","phone":"090-1111-0006","id":"i6"},{"name":"Taro Yamada","age":8,"conditions":"none","allergies":"egg","phone":"090-1111-0007","id":"i7"},{"name":"Rina Mori","age":80,"conditions":"kidney disease","allergies":"NSAIDs","phone":"090-1111-0008","id":"i8"},{"name":"Ken Sato","id":"i34"}],"bookings":[{"patient":"Mary Tanaka","time":"9:30","purpose":"diabetes check-up","status":"booked","id":"i9"},{"patient":"Joe Suzuki","time":"9:40","purpose":"sore throat and cough","status":"arrived","id":"i10"},{"patient":"Emi Kato","time":"10:00","purpose":"asthma inhaler refill","status":"booked","id":"i11"},{"patient":"Hiro Ito","time":"10:20","purpose":"swollen ankles","status":"booked","id":"i12"},{"patient":"Anna Brown","time":"10:40","purpose":"headache","status":"booked","id":"i13"},{"patient":"Taro Yamada","time":"11:00","purpose":"fever","status":"booked","id":"i14"}],"stock":[{"medicine":"Amlodipine 5mg","left":120,"minimum":50,"on order":0,"id":"i15"},{"medicine":"Metformin 500mg","left":90,"minimum":60,"on order":0,"id":"i16"},{"medicine":"Acetaminophen 500mg","left":200,"minimum":80,"on order":0,"id":"i17"},{"medicine":"Loxoprofen 60mg","left":70,"minimum":40,"on order":0,"id":"i18"},{"medicine":"Amoxicillin 250mg","left":60,"minimum":50,"on order":0,"id":"i19"},{"medicine":"Salbutamol inhaler","left":15,"minimum":10,"on order":0,"id":"i20"},{"medicine":"Furosemide 20mg","left":45,"minimum":30,"on order":0,"id":"i21"},{"medicine":"Omeprazole 20mg","left":80,"minimum":40,"on order":0,"id":"i22"},{"medicine":"Sumatriptan 50mg","left":20,"minimum":15,"on order":0,"id":"i23"},{"medicine":"Cough syrup","left":25,"minimum":20,"on order":0,"id":"i24"},{"medicine":"Nitroglycerin tablets","left":10,"minimum":10,"on order":0,"id":"i25"},{"medicine":"Oral rehydration salts","left":40,"minimum":20,"on order":0,"id":"i26"}],"notice":[{"calling":"No. 2 Ken Sato, now with the doctor","expected wait":"About 30 minutes for No. 3","guidance":"Ken Sato (No. 2) is now with the doctor. Joe Suzuki (No. 3), please keep waiting; if you feel worse, tell staff immediately.","id":"i27"}],"summary":[{"text":"3 check-ins today (Rina Mori, Ken Sato, Joe Suzuki); 1 billed (Ken Sato, $120, unpaid); 1 exam recorded (Ken Sato, No. 2, likely stable angina, ECG no ST elevation); prescriptions drafted for Ken Sato (nitroglycerin reduced stock to 10; aspirin pending bleeding check and not in stock list); average wait 10 min so far. Attention: Ken Sato's cardiology referral this week.","id":"i28"}],"reception":[{"number":1,"patient":"Rina Mori","time":"8:50","symptom":"dizziness","urgency":"medium","status":"waiting","minutes waited":10,"id":"i29"},{"number":2,"patient":"Ken Sato","time":"9:00","symptom":"chest tightness since this morning, a bit short of breath","urgency":"high","status":"to pay","minutes waited":0,"id":"i35"},{"number":3,"patient":"Joe Suzuki","time":"9:00","symptom":"sore throat and cough","urgency":"low","status":"waiting","minutes waited":0,"id":"i36"}],"interviews":[{"reception":2,"patient":"Ken Sato","summary":"Chest pressure since about 7am, comes and goes, sometimes radiates to the left arm. Mild shortness of breath. Takes amlodipine for blood pressure.","points to watch":"Recurrent exertional-type chest pressure with left arm radiation; shortness of breath; blood pressure control on amlodipine.","note for doctor":"Possible cardiac chest pain. Assess promptly with ECG and vital signs before any other step. Urgency stays high.","id":"i37"}],"exams":[{"reception":2,"patient":"Ken Sato","entry":"i35","assessment":"Likely stable angina; ACS to be ruled out. BP 158/94, pulse 88 regular. ECG shows no ST elevation. Pain eases at rest.","draft prescription":"Nitroglycerin sublingual as needed for chest pain; low-dose aspirin daily (check bleeding risk before final sign-off).","next visit":"Cardiology referral this week; return immediately if pain worsens, lasts over 15 minutes, or breathing worsens.","note":"BP 158/94, pulse 88 regular. ECG: no ST elevation. Pain eases at rest. Likely stable angina; rule out ACS. Start nitroglycerin as needed and low-dose aspirin, refer to cardiology this week.","id":"i38"}],"prescriptions":[{"exam":"i38","reception":2,"patient":"Ken Sato","medicine":"Nitroglycerin sublingual tablets","dose":"0.3 mg under the tongue as needed for chest pain, up to 3 doses 5 minutes apart","days":30,"allergy check":"No allergies recorded","conditions check":"Hypertension (amlodipine); no kidney or liver disease recorded","interactions":"Additive blood pressure lowering with amlodipine; check for dizziness on standing","warning":"Sit down before use; call emergency services if pain lasts over 15 minutes after the 3rd dose","id":"i39"},{"exam":"i38","reception":2,"patient":"Ken Sato","medicine":"Aspirin low-dose 81 mg","dose":"1 tablet daily after food","days":30,"allergy check":"No allergies recorded","conditions check":"Bleeding risk not yet confirmed","interactions":"None with current amlodipine or nitroglycerin","warning":"Pending: bleeding risk check before final sign-off; not in stock list","id":"i40"}],"bills":[{"reception":2,"patient":"Ken Sato","exam":"i38","amount":"$120","breakdown":"Consultation $60; ECG $45; Nitroglycerin sublingual 0.3 mg x 30 days $12; Aspirin 81 mg x 30 days $3 (pending bleeding check)","paid":false,"id":"i41"}],"__sounds":[],"__bands":[]}},{"kind":"event","device":"reception tablet","screen":"Reception","intent":"Mark this bill paid and the entry done","item":{"collection":"bills","id":"i41"},"inputs":{},"say":"Payment closes the visit and rewrites today's summary.","reply":"Ken Sato's bill ($120) is marked paid and his entry (No. 2) is done.","ms":8895,"cost":0.076646,"calls":[{"name":"apply","args":"{\"changes\":[{\"op\":\"update\",\"collection\":\"bills\",\"id\":\"i41\",\"set\":{\"paid\":true}},{\"op\":\"update\",\"collection\":\"reception\",\"id\":\"i35\",\"set\":{\"status\":\"done\"}},{\"op"}],"reality":false,"state":{"clock":"9:00","with doctor":"Ken Sato (No. 2)","patients":[{"name":"Ken Sato","age":58,"conditions":"hypertension","allergies":"none","phone":"090-1111-0001","id":"i1"},{"name":"Mary Tanaka","age":72,"conditions":"diabetes, hypertension","allergies":"penicillin","phone":"090-1111-0002","id":"i2"},{"name":"Joe Suzuki","age":34,"conditions":"none","allergies":"none","phone":"090-1111-0003","id":"i3"},{"name":"Emi Kato","age":27,"conditions":"asthma","allergies":"aspirin","phone":"090-1111-0004","id":"i4"},{"name":"Hiro Ito","age":65,"conditions":"heart failure","allergies":"none","phone":"090-1111-0005","id":"i5"},{"name":"Anna Brown","age":45,"conditions":"migraine","allergies":"none","phone":"090-1111-0006","id":"i6"},{"name":"Taro Yamada","age":8,"conditions":"none","allergies":"egg","phone":"090-1111-0007","id":"i7"},{"name":"Rina Mori","age":80,"conditions":"kidney disease","allergies":"NSAIDs","phone":"090-1111-0008","id":"i8"},{"name":"Ken Sato","id":"i34"}],"bookings":[{"patient":"Mary Tanaka","time":"9:30","purpose":"diabetes check-up","status":"booked","id":"i9"},{"patient":"Joe Suzuki","time":"9:40","purpose":"sore throat and cough","status":"arrived","id":"i10"},{"patient":"Emi Kato","time":"10:00","purpose":"asthma inhaler refill","status":"booked","id":"i11"},{"patient":"Hiro Ito","time":"10:20","purpose":"swollen ankles","status":"booked","id":"i12"},{"patient":"Anna Brown","time":"10:40","purpose":"headache","status":"booked","id":"i13"},{"patient":"Taro Yamada","time":"11:00","purpose":"fever","status":"booked","id":"i14"}],"stock":[{"medicine":"Amlodipine 5mg","left":120,"minimum":50,"on order":0,"id":"i15"},{"medicine":"Metformin 500mg","left":90,"minimum":60,"on order":0,"id":"i16"},{"medicine":"Acetaminophen 500mg","left":200,"minimum":80,"on order":0,"id":"i17"},{"medicine":"Loxoprofen 60mg","left":70,"minimum":40,"on order":0,"id":"i18"},{"medicine":"Amoxicillin 250mg","left":60,"minimum":50,"on order":0,"id":"i19"},{"medicine":"Salbutamol inhaler","left":15,"minimum":10,"on order":0,"id":"i20"},{"medicine":"Furosemide 20mg","left":45,"minimum":30,"on order":0,"id":"i21"},{"medicine":"Omeprazole 20mg","left":80,"minimum":40,"on order":0,"id":"i22"},{"medicine":"Sumatriptan 50mg","left":20,"minimum":15,"on order":0,"id":"i23"},{"medicine":"Cough syrup","left":25,"minimum":20,"on order":0,"id":"i24"},{"medicine":"Nitroglycerin tablets","left":10,"minimum":10,"on order":0,"id":"i25"},{"medicine":"Oral rehydration salts","left":40,"minimum":20,"on order":0,"id":"i26"}],"notice":[{"calling":"No. 2 Ken Sato, now with the doctor","expected wait":"About 30 minutes for No. 3","guidance":"Ken Sato (No. 2) is now with the doctor. Joe Suzuki (No. 3), please keep waiting; if you feel worse, tell staff immediately.","id":"i27"}],"summary":[{"text":"3 check-ins today (Rina Mori, Ken Sato, Joe Suzuki); 1 seen and done (Ken Sato, No. 2, paid $120); 1 exam recorded (Ken Sato, likely stable angina, ECG no ST elevation); prescriptions for Ken Sato (nitroglycerin reduced stock to 10; aspirin pending bleeding check, not in stock list); average wait 10 min so far. Attention: Ken Sato's cardiology referral this week.","id":"i28"}],"reception":[{"number":1,"patient":"Rina Mori","time":"8:50","symptom":"dizziness","urgency":"medium","status":"waiting","minutes waited":10,"id":"i29"},{"number":2,"patient":"Ken Sato","time":"9:00","symptom":"chest tightness since this morning, a bit short of breath","urgency":"high","status":"done","minutes waited":0,"id":"i35"},{"number":3,"patient":"Joe Suzuki","time":"9:00","symptom":"sore throat and cough","urgency":"low","status":"waiting","minutes waited":0,"id":"i36"}],"interviews":[{"reception":2,"patient":"Ken Sato","summary":"Chest pressure since about 7am, comes and goes, sometimes radiates to the left arm. Mild shortness of breath. Takes amlodipine for blood pressure.","points to watch":"Recurrent exertional-type chest pressure with left arm radiation; shortness of breath; blood pressure control on amlodipine.","note for doctor":"Possible cardiac chest pain. Assess promptly with ECG and vital signs before any other step. Urgency stays high.","id":"i37"}],"exams":[{"reception":2,"patient":"Ken Sato","entry":"i35","assessment":"Likely stable angina; ACS to be ruled out. BP 158/94, pulse 88 regular. ECG shows no ST elevation. Pain eases at rest.","draft prescription":"Nitroglycerin sublingual as needed for chest pain; low-dose aspirin daily (check bleeding risk before final sign-off).","next visit":"Cardiology referral this week; return immediately if pain worsens, lasts over 15 minutes, or breathing worsens.","note":"BP 158/94, pulse 88 regular. ECG: no ST elevation. Pain eases at rest. Likely stable angina; rule out ACS. Start nitroglycerin as needed and low-dose aspirin, refer to cardiology this week.","id":"i38"}],"prescriptions":[{"exam":"i38","reception":2,"patient":"Ken Sato","medicine":"Nitroglycerin sublingual tablets","dose":"0.3 mg under the tongue as needed for chest pain, up to 3 doses 5 minutes apart","days":30,"allergy check":"No allergies recorded","conditions check":"Hypertension (amlodipine); no kidney or liver disease recorded","interactions":"Additive blood pressure lowering with amlodipine; check for dizziness on standing","warning":"Sit down before use; call emergency services if pain lasts over 15 minutes after the 3rd dose","id":"i39"},{"exam":"i38","reception":2,"patient":"Ken Sato","medicine":"Aspirin low-dose 81 mg","dose":"1 tablet daily after food","days":30,"allergy check":"No allergies recorded","conditions check":"Bleeding risk not yet confirmed","interactions":"None with current amlodipine or nitroglycerin","warning":"Pending: bleeding risk check before final sign-off; not in stock list","id":"i40"}],"bills":[{"reception":2,"patient":"Ken Sato","exam":"i38","amount":"$120","breakdown":"Consultation $60; ECG $45; Nitroglycerin sublingual 0.3 mg x 30 days $12; Aspirin 81 mg x 30 days $3 (pending bleeding check)","paid":true,"id":"i41"}],"__sounds":[],"__bands":[]}},{"kind":"request","text":"On the reception list and the doctor's waiting list, show in a few words why each patient got their urgency. Fill it in for the people already waiting.","reply":"The reception list and the doctor's waiting list now show a short \"Why:\" line next to each urgency badge. I filled it in for the three current entries:\n\n- **Rina Mori:** \"Age 80 with kidney disease, dizziness\"\n- **Ken Sato:** \"Chest tightness with breathlessness\"\n- **Joe Suzuki:** \"Mild cold symptoms, no chronic conditions\"\n\nI also updated the brief so check-ins, interviews that change urgency, and walk-ins added by \"Next 10 minutes\" write their own reason. I haven't tried a new check-in to confirm that.","ms":26096,"state":{"clock":"9:00","with doctor":"Ken Sato (No. 2)","patients":[{"name":"Ken Sato","age":58,"conditions":"hypertension","allergies":"none","phone":"090-1111-0001","id":"i1"},{"name":"Mary Tanaka","age":72,"conditions":"diabetes, hypertension","allergies":"penicillin","phone":"090-1111-0002","id":"i2"},{"name":"Joe Suzuki","age":34,"conditions":"none","allergies":"none","phone":"090-1111-0003","id":"i3"},{"name":"Emi Kato","age":27,"conditions":"asthma","allergies":"aspirin","phone":"090-1111-0004","id":"i4"},{"name":"Hiro Ito","age":65,"conditions":"heart failure","allergies":"none","phone":"090-1111-0005","id":"i5"},{"name":"Anna Brown","age":45,"conditions":"migraine","allergies":"none","phone":"090-1111-0006","id":"i6"},{"name":"Taro Yamada","age":8,"conditions":"none","allergies":"egg","phone":"090-1111-0007","id":"i7"},{"name":"Rina Mori","age":80,"conditions":"kidney disease","allergies":"NSAIDs","phone":"090-1111-0008","id":"i8"},{"name":"Ken Sato","id":"i34"}],"bookings":[{"patient":"Mary Tanaka","time":"9:30","purpose":"diabetes check-up","status":"booked","id":"i9"},{"patient":"Joe Suzuki","time":"9:40","purpose":"sore throat and cough","status":"arrived","id":"i10"},{"patient":"Emi Kato","time":"10:00","purpose":"asthma inhaler refill","status":"booked","id":"i11"},{"patient":"Hiro Ito","time":"10:20","purpose":"swollen ankles","status":"booked","id":"i12"},{"patient":"Anna Brown","time":"10:40","purpose":"headache","status":"booked","id":"i13"},{"patient":"Taro Yamada","time":"11:00","purpose":"fever","status":"booked","id":"i14"}],"stock":[{"medicine":"Amlodipine 5mg","left":120,"minimum":50,"on order":0,"id":"i15"},{"medicine":"Metformin 500mg","left":90,"minimum":60,"on order":0,"id":"i16"},{"medicine":"Acetaminophen 500mg","left":200,"minimum":80,"on order":0,"id":"i17"},{"medicine":"Loxoprofen 60mg","left":70,"minimum":40,"on order":0,"id":"i18"},{"medicine":"Amoxicillin 250mg","left":60,"minimum":50,"on order":0,"id":"i19"},{"medicine":"Salbutamol inhaler","left":15,"minimum":10,"on order":0,"id":"i20"},{"medicine":"Furosemide 20mg","left":45,"minimum":30,"on order":0,"id":"i21"},{"medicine":"Omeprazole 20mg","left":80,"minimum":40,"on order":0,"id":"i22"},{"medicine":"Sumatriptan 50mg","left":20,"minimum":15,"on order":0,"id":"i23"},{"medicine":"Cough syrup","left":25,"minimum":20,"on order":0,"id":"i24"},{"medicine":"Nitroglycerin tablets","left":10,"minimum":10,"on order":0,"id":"i25"},{"medicine":"Oral rehydration salts","left":40,"minimum":20,"on order":0,"id":"i26"}],"notice":[{"calling":"No. 2 Ken Sato, now with the doctor","expected wait":"About 30 minutes for No. 3","guidance":"Ken Sato (No. 2) is now with the doctor. Joe Suzuki (No. 3), please keep waiting; if you feel worse, tell staff immediately.","id":"i27"}],"summary":[{"text":"3 check-ins today (Rina Mori, Ken Sato, Joe Suzuki); 1 seen and done (Ken Sato, No. 2, paid $120); 1 exam recorded (Ken Sato, likely stable angina, ECG no ST elevation); prescriptions for Ken Sato (nitroglycerin reduced stock to 10; aspirin pending bleeding check, not in stock list); average wait 10 min so far. Attention: Ken Sato's cardiology referral this week.","id":"i28"}],"reception":[{"number":1,"patient":"Rina Mori","time":"8:50","symptom":"dizziness","urgency":"medium","status":"waiting","minutes waited":10,"id":"i29","urgency reason":"Age 80 with kidney disease, dizziness"},{"number":2,"patient":"Ken Sato","time":"9:00","symptom":"chest tightness since this morning, a bit short of breath","urgency":"high","status":"done","minutes waited":0,"id":"i35","urgency reason":"Chest tightness with breathlessness"},{"number":3,"patient":"Joe Suzuki","time":"9:00","symptom":"sore throat and cough","urgency":"low","status":"waiting","minutes waited":0,"id":"i36","urgency reason":"Mild cold symptoms, no chronic conditions"}],"interviews":[{"reception":2,"patient":"Ken Sato","summary":"Chest pressure since about 7am, comes and goes, sometimes radiates to the left arm. Mild shortness of breath. Takes amlodipine for blood pressure.","points to watch":"Recurrent exertional-type chest pressure with left arm radiation; shortness of breath; blood pressure control on amlodipine.","note for doctor":"Possible cardiac chest pain. Assess promptly with ECG and vital signs before any other step. Urgency stays high.","id":"i37"}],"exams":[{"reception":2,"patient":"Ken Sato","entry":"i35","assessment":"Likely stable angina; ACS to be ruled out. BP 158/94, pulse 88 regular. ECG shows no ST elevation. Pain eases at rest.","draft prescription":"Nitroglycerin sublingual as needed for chest pain; low-dose aspirin daily (check bleeding risk before final sign-off).","next visit":"Cardiology referral this week; return immediately if pain worsens, lasts over 15 minutes, or breathing worsens.","note":"BP 158/94, pulse 88 regular. ECG: no ST elevation. Pain eases at rest. Likely stable angina; rule out ACS. Start nitroglycerin as needed and low-dose aspirin, refer to cardiology this week.","id":"i38"}],"prescriptions":[{"exam":"i38","reception":2,"patient":"Ken Sato","medicine":"Nitroglycerin sublingual tablets","dose":"0.3 mg under the tongue as needed for chest pain, up to 3 doses 5 minutes apart","days":30,"allergy check":"No allergies recorded","conditions check":"Hypertension (amlodipine); no kidney or liver disease recorded","interactions":"Additive blood pressure lowering with amlodipine; check for dizziness on standing","warning":"Sit down before use; call emergency services if pain lasts over 15 minutes after the 3rd dose","id":"i39"},{"exam":"i38","reception":2,"patient":"Ken Sato","medicine":"Aspirin low-dose 81 mg","dose":"1 tablet daily after food","days":30,"allergy check":"No allergies recorded","conditions check":"Bleeding risk not yet confirmed","interactions":"None with current amlodipine or nitroglycerin","warning":"Pending: bleeding risk check before final sign-off; not in stock list","id":"i40"}],"bills":[{"reception":2,"patient":"Ken Sato","exam":"i38","amount":"$120","breakdown":"Consultation $60; ECG $45; Nitroglycerin sublingual 0.3 mg x 30 days $12; Aspirin 81 mg x 30 days $3 (pending bleeding check)","paid":true,"id":"i41"}],"__sounds":[],"__bands":[]},"ir":{"name":"Neighborhood Clinic","desc":"","lang":"en","reality":{"summary":"Records and screens are ordinary code; urgency, summaries and drug checks need a model plus a drug database, with clinician review.","items":[{"part":"urgency triage","existing":"LLM classifier","effect":"Occasional under-triage; must be reviewed by staff"},{"part":"interaction check","existing":"Drug database service","effect":"Reliable if database used; model alone is risky"}],"intents":[{"intent":"Check in the patient with the given name and symptom","parts":[{"what":"create entry, mark booking","builtWith":"code","detail":"Database writes"},{"what":"judge urgency","builtWith":"model","detail":"LLM with red-flag rules"},{"what":"wait estimate and notice","builtWith":"code","detail":"Queue formula plus template"}],"errorRate":0.1,"delayMs":2000,"mistakes":"Under-rates vague symptoms; name mismatches"},{"intent":"Send interview for the reception number with the description","parts":[{"what":"summarise and flag","builtWith":"model","detail":"LLM summarisation"},{"what":"status update","builtWith":"code","detail":"DB write"}],"errorRate":0.12,"delayMs":3500,"mistakes":"Misses details or over-states certainty"},{"intent":"Prescribe from this exam record's draft","parts":[{"what":"interaction and allergy check","builtWith":"service","detail":"Drug database API"},{"what":"stock update","builtWith":"code","detail":"Inventory decrement"}],"errorRate":0.08,"delayMs":3000,"mistakes":"Missed rare interactions; wrong quantity"},{"intent":"Record exam for the patient with the doctor from the doctor's note","parts":[{"what":"assessment and draft","builtWith":"model","detail":"LLM clinical drafting, doctor confirms"}],"errorRate":0.15,"delayMs":4000,"mistakes":"Plausible but wrong assessment"},{"intent":"Move the clock on 10 minutes","parts":[{"what":"clock, waits, summary","builtWith":"code","detail":"Arithmetic"},{"what":"walk-in","builtWith":"not_yet","detail":"Real walk-ins come from people, not simulated"}],"errorRate":0.02,"delayMs":800,"mistakes":"None significant"}],"audioLatencyMs":0,"leak":0,"decisionDelayMs":2500,"errorRate":0.1,"minIntervalSec":1,"cpuNote":"Light; model calls dominate latency."},"checks":[{"name":"Chest tightness check-in","text":"Chest tightness check-in"},{"name":"Visit to payment","text":"Visit to payment"},{"name":"Interview","text":"Interview"}],"events":{},"state":{"fields":[]},"screens":[{"name":"Waiting room","form":"iot","formLabel":"waiting room display","view":[{"kind":"list","collection":"notice","columns":["calling","expected wait","guidance"],"source":"notice"},{"kind":"list","collection":"reception","where":{"status":"waiting"},"row":[{"kind":"heading","text":"No. {number}"},{"kind":"text","text":"{minutes waited} min waited"}],"source":"reception","whereField":"status","whereValue":"waiting"}]},{"name":"Reception","form":"panel","formLabel":"reception tablet","view":[{"kind":"heading","text":"Reception"},{"kind":"text","text":"Clock {value clock}"},{"kind":"list","collection":"notice","columns":["calling","expected wait","guidance"],"source":"notice"},{"kind":"input","name":"patient name","label":"Patient name","inputType":"text"},{"kind":"input","name":"symptom","label":"Symptom","inputType":"text"},{"kind":"button","text":"Check in","intent":"Check in the patient with the given name and symptom","action":"Check in the patient with the given name and symptom"},{"kind":"heading","text":"Today's bookings"},{"kind":"list","collection":"bookings","row":[{"kind":"text","text":"{patient} {time} {purpose} ({status})"},{"kind":"button","text":"Arrived","intent":"Mark this booking arrived and check the patient in","action":"Mark this booking arrived and check the patient in"},{"kind":"button","text":"Cancel","intent":"Cancel this booking","action":"Cancel this booking"}],"source":"bookings"},{"kind":"heading","text":"Reception list"},{"kind":"list","collection":"reception","order":{"property":"urgency","values":["high","medium","low"]},"row":[{"kind":"text","text":"#{number} {patient} - {symptom}"},{"kind":"badge","text":"{urgency}"},{"kind":"text","text":"Why: {urgency reason}"},{"kind":"badge","text":"{status}"},{"kind":"text","text":"{minutes waited} min"},{"kind":"button","text":"To billing","intent":"Send this reception entry to billing and create the bill","action":"Send this reception entry to billing and create the bill"}],"source":"reception","sortField":"urgency","sortValues":["high","medium","low"],"sortDesc":false},{"kind":"heading","text":"Bills waiting"},{"kind":"list","collection":"bills","where":{"paid":false},"row":[{"kind":"text","text":"#{reception number} ${amount} {breakdown}"},{"kind":"button","text":"Paid","intent":"Mark this bill paid and the entry done","action":"Mark this bill paid and the entry done"}],"source":"bills","whereField":"paid","whereValue":"false"},{"kind":"button","text":"Next 10 minutes","intent":"Move the clock on 10 minutes","action":"Move the clock on 10 minutes"}]},{"name":"Consulting room","form":"desktop","formLabel":"doctor's PC","view":[{"kind":"heading","text":"Consulting room"},{"kind":"text","text":"With the doctor: {value with doctor}"},{"kind":"heading","text":"Waiting (most urgent first)"},{"kind":"list","collection":"reception","where":{"status":"waiting"},"order":{"property":"urgency","values":["high","medium","low"]},"row":[{"kind":"text","text":"#{number} {patient} - {symptom}"},{"kind":"badge","text":"{urgency}"},{"kind":"text","text":"Why: {urgency reason}"},{"kind":"text","text":"{minutes waited} min"},{"kind":"button","text":"Call in","intent":"Call in this waiting entry to the doctor","action":"Call in this waiting entry to the doctor"}],"source":"reception","whereField":"status","whereValue":"waiting","sortField":"urgency","sortValues":["high","medium","low"],"sortDesc":false},{"kind":"list","collection":"reception","where":{"status":"interviewed"},"order":{"property":"urgency","values":["high","medium","low"]},"row":[{"kind":"text","text":"#{number} {patient} (interviewed) - {symptom}"},{"kind":"badge","text":"{urgency}"},{"kind":"text","text":"Why: {urgency reason}"},{"kind":"button","text":"Call in","intent":"Call in this waiting entry to the doctor","action":"Call in this waiting entry to the doctor"}],"source":"reception","whereField":"status","whereValue":"interviewed","sortField":"urgency","sortValues":["high","medium","low"],"sortDesc":false},{"kind":"heading","text":"Interviews"},{"kind":"table","collection":"interviews","columns":["reception number","summary","points to watch","note for the doctor"],"source":"interviews"},{"kind":"input","name":"doctor note","label":"Doctor's note","inputType":"longtext"},{"kind":"button","text":"Record exam","intent":"Record exam for the patient with the doctor from the doctor's note","action":"Record exam for the patient with the doctor from the doctor's note"},{"kind":"heading","text":"Exam records"},{"kind":"list","collection":"exams","row":[{"kind":"text","text":"#{reception number} {assessment} | Draft: {draft prescription} | Next: {next visit}"},{"kind":"button","text":"Prescribe","intent":"Prescribe from this exam record's draft","action":"Prescribe from this exam record's draft"}],"source":"exams"},{"kind":"heading","text":"Prescriptions"},{"kind":"table","collection":"prescriptions","columns":["reception number","medicine","dose","days","interaction warning"],"source":"prescriptions"}]},{"name":"Stock","form":"desktop","formLabel":"stock PC","view":[{"kind":"heading","text":"Medicine stock"},{"kind":"list","collection":"stock","row":[{"kind":"text","text":"{medicine}: left {left}, min {minimum}, on order {on order}"},{"kind":"button","text":"Order","intent":"Order this medicine","action":"Order this medicine"}],"source":"stock"},{"kind":"heading","text":"Today's summary"},{"kind":"list","collection":"summary","columns":["text"],"source":"summary"}]},{"name":"Patient","form":"phone","formLabel":"patient's phone","view":[{"kind":"heading","text":"Your turn"},{"kind":"list","collection":"notice","columns":["calling","expected wait","guidance"],"source":"notice"},{"kind":"input","name":"reception number","label":"Reception number","inputType":"number"},{"kind":"input","name":"description","label":"Describe your symptoms","inputType":"longtext"},{"kind":"button","text":"Send interview","intent":"Send interview for the reception number with the description","action":"Send interview for the reception number with the description"}]}]}},{"kind":"reality","on":true},{"kind":"event","device":"reception tablet","screen":"Reception","intent":"Check in the patient with the given name and symptom","item":null,"inputs":{"patient name":"Hiro Ito","symptom":"ankles more swollen, out of breath on the stairs"},"say":"Same button, existing-tech mode: it answers as a shippable version would.","reply":"Hiro Ito is checked in as No. 4 with high urgency (heart failure with worsening breathlessness), his 10:20 booking is marked arrived, and the notice now shows about 15 minutes for No. 4.","ms":13822,"cost":0.1161375,"calls":[{"name":"query","args":"{\"collection\":\"patients\",\"where\":{\"name\":\"Hiro Ito\"}}"},{"name":"query","args":"{\"collection\":\"bookings\",\"where\":{\"patient\":\"Hiro Ito\"}}"},{"name":"apply","args":"{\"changes\":[{\"op\":\"add\",\"collection\":\"reception\",\"item\":{\"number\":4,\"patient\":\"Hiro Ito\",\"time\":\"9:00\",\"symptom\":\"ankles more swollen, out of breath on the stai"}],"reality":true,"state":{"clock":"9:00","with doctor":"Ken Sato (No. 2)","patients":[{"name":"Ken Sato","age":58,"conditions":"hypertension","allergies":"none","phone":"090-1111-0001","id":"i1"},{"name":"Mary Tanaka","age":72,"conditions":"diabetes, hypertension","allergies":"penicillin","phone":"090-1111-0002","id":"i2"},{"name":"Joe Suzuki","age":34,"conditions":"none","allergies":"none","phone":"090-1111-0003","id":"i3"},{"name":"Emi Kato","age":27,"conditions":"asthma","allergies":"aspirin","phone":"090-1111-0004","id":"i4"},{"name":"Hiro Ito","age":65,"conditions":"heart failure","allergies":"none","phone":"090-1111-0005","id":"i5"},{"name":"Anna Brown","age":45,"conditions":"migraine","allergies":"none","phone":"090-1111-0006","id":"i6"},{"name":"Taro Yamada","age":8,"conditions":"none","allergies":"egg","phone":"090-1111-0007","id":"i7"},{"name":"Rina Mori","age":80,"conditions":"kidney disease","allergies":"NSAIDs","phone":"090-1111-0008","id":"i8"},{"name":"Ken Sato","id":"i34"}],"bookings":[{"patient":"Mary Tanaka","time":"9:30","purpose":"diabetes check-up","status":"booked","id":"i9"},{"patient":"Joe Suzuki","time":"9:40","purpose":"sore throat and cough","status":"arrived","id":"i10"},{"patient":"Emi Kato","time":"10:00","purpose":"asthma inhaler refill","status":"booked","id":"i11"},{"patient":"Hiro Ito","time":"10:20","purpose":"swollen ankles","status":"arrived","id":"i12"},{"patient":"Anna Brown","time":"10:40","purpose":"headache","status":"booked","id":"i13"},{"patient":"Taro Yamada","time":"11:00","purpose":"fever","status":"booked","id":"i14"}],"stock":[{"medicine":"Amlodipine 5mg","left":120,"minimum":50,"on order":0,"id":"i15"},{"medicine":"Metformin 500mg","left":90,"minimum":60,"on order":0,"id":"i16"},{"medicine":"Acetaminophen 500mg","left":200,"minimum":80,"on order":0,"id":"i17"},{"medicine":"Loxoprofen 60mg","left":70,"minimum":40,"on order":0,"id":"i18"},{"medicine":"Amoxicillin 250mg","left":60,"minimum":50,"on order":0,"id":"i19"},{"medicine":"Salbutamol inhaler","left":15,"minimum":10,"on order":0,"id":"i20"},{"medicine":"Furosemide 20mg","left":45,"minimum":30,"on order":0,"id":"i21"},{"medicine":"Omeprazole 20mg","left":80,"minimum":40,"on order":0,"id":"i22"},{"medicine":"Sumatriptan 50mg","left":20,"minimum":15,"on order":0,"id":"i23"},{"medicine":"Cough syrup","left":25,"minimum":20,"on order":0,"id":"i24"},{"medicine":"Nitroglycerin tablets","left":10,"minimum":10,"on order":0,"id":"i25"},{"medicine":"Oral rehydration salts","left":40,"minimum":20,"on order":0,"id":"i26"}],"notice":[{"calling":"No. 2 Ken Sato, now with the doctor","expected wait":"About 15 minutes for No. 4","guidance":"Hiro Ito (No. 4) has been moved ahead because of breathing difficulty. Joe Suzuki (No. 3), please keep waiting; if you feel worse, tell staff immediately.","id":"i27"}],"summary":[{"text":"4 check-ins today (Rina Mori, Ken Sato, Joe Suzuki, Hiro Ito); 1 seen and done (Ken Sato, No. 2, paid $120); 1 exam recorded (Ken Sato, likely stable angina, ECG no ST elevation); prescriptions for Ken Sato (nitroglycerin reduced stock to 10; aspirin pending bleeding check, not in stock list); average wait 10 min so far. Attention: Hiro Ito (No. 4, heart failure, high urgency) is short of breath and needs prompt review; Ken Sato's cardiology referral this week.","id":"i28"}],"reception":[{"number":1,"patient":"Rina Mori","time":"8:50","symptom":"dizziness","urgency":"medium","status":"waiting","minutes waited":10,"id":"i29","urgency reason":"Age 80 with kidney disease, dizziness"},{"number":2,"patient":"Ken Sato","time":"9:00","symptom":"chest tightness since this morning, a bit short of breath","urgency":"high","status":"done","minutes waited":0,"id":"i35","urgency reason":"Chest tightness with breathlessness"},{"number":3,"patient":"Joe Suzuki","time":"9:00","symptom":"sore throat and cough","urgency":"low","status":"waiting","minutes waited":0,"id":"i36","urgency reason":"Mild cold symptoms, no chronic conditions"},{"number":4,"patient":"Hiro Ito","time":"9:00","symptom":"ankles more swollen, out of breath on the stairs","urgency":"high","status":"waiting","minutes waited":0,"urgency reason":"Heart failure with worsening breathlessness","id":"i42"}],"interviews":[{"reception":2,"patient":"Ken Sato","summary":"Chest pressure since about 7am, comes and goes, sometimes radiates to the left arm. Mild shortness of breath. Takes amlodipine for blood pressure.","points to watch":"Recurrent exertional-type chest pressure with left arm radiation; shortness of breath; blood pressure control on amlodipine.","note for doctor":"Possible cardiac chest pain. Assess promptly with ECG and vital signs before any other step. Urgency stays high.","id":"i37"}],"exams":[{"reception":2,"patient":"Ken Sato","entry":"i35","assessment":"Likely stable angina; ACS to be ruled out. BP 158/94, pulse 88 regular. ECG shows no ST elevation. Pain eases at rest.","draft prescription":"Nitroglycerin sublingual as needed for chest pain; low-dose aspirin daily (check bleeding risk before final sign-off).","next visit":"Cardiology referral this week; return immediately if pain worsens, lasts over 15 minutes, or breathing worsens.","note":"BP 158/94, pulse 88 regular. ECG: no ST elevation. Pain eases at rest. Likely stable angina; rule out ACS. Start nitroglycerin as needed and low-dose aspirin, refer to cardiology this week.","id":"i38"}],"prescriptions":[{"exam":"i38","reception":2,"patient":"Ken Sato","medicine":"Nitroglycerin sublingual tablets","dose":"0.3 mg under the tongue as needed for chest pain, up to 3 doses 5 minutes apart","days":30,"allergy check":"No allergies recorded","conditions check":"Hypertension (amlodipine); no kidney or liver disease recorded","interactions":"Additive blood pressure lowering with amlodipine; check for dizziness on standing","warning":"Sit down before use; call emergency services if pain lasts over 15 minutes after the 3rd dose","id":"i39"},{"exam":"i38","reception":2,"patient":"Ken Sato","medicine":"Aspirin low-dose 81 mg","dose":"1 tablet daily after food","days":30,"allergy check":"No allergies recorded","conditions check":"Bleeding risk not yet confirmed","interactions":"None with current amlodipine or nitroglycerin","warning":"Pending: bleeding risk check before final sign-off; not in stock list","id":"i40"}],"bills":[{"reception":2,"patient":"Ken Sato","exam":"i38","amount":"$120","breakdown":"Consultation $60; ECG $45; Nitroglycerin sublingual 0.3 mg x 30 days $12; Aspirin 81 mg x 30 days $3 (pending bleeding check)","paid":true,"id":"i41"}],"__sounds":[],"__bands":[]}},{"kind":"reality","on":false}],"start":{"name":"Neighborhood Clinic","idea":"","brief":"One shared system for a small internal-medicine clinic. Collections: patients, bookings, reception, interviews, exams, prescriptions, stock, bills, notice (single item), summary (single item); value clock (starts 9:00).\nIntent rules:\n- Check in (inputs patient name, symptom): add reception entry with next number, clock time, status waiting, minutes waited 0. Judge urgency from symptom, patient's chronic conditions and age (chest tightness/pain, breathing trouble, fainting = high; fever, pain in older/chronic patients = medium; mild cold, refill = low). Mark that patient's booked booking arrived. Estimate wait from waiting people and urgency; rewrite notice (number called, expected wait, one line of guidance). Unknown names: add a new patient minimally.\n- Arrived: mark booking arrived and check in the same way using the booking purpose as symptom. Cancel: mark cancelled.\n- Send interview (reception number, description): add interview with summary, points to watch, note for doctor; set entry status interviewed; raise/lower urgency if warranted.\n- Call in (chosen entry): set it to with doctor; anyone already with doctor becomes to pay; update notice and the \"with doctor\" value.\n- Record exam (doctor's note): add exam record for the entry with assessment, draft prescription, next visit, using note and interview.\n- Prescribe (exam record): create prescription rows (medicine, dose, days), check allergies, conditions, interactions, write warning (or \"none\"); reduce stock by plausible amounts; if left < minimum set on order.\n- To billing: set entry to to pay if not; add bill with estimated amount (consultation about 1,500 yen-style or $ amounts, use USD) and breakdown from exam and prescriptions, paid false.\n- Paid: bill paid, entry done, rewrite summary (check-ins, seen, average wait, attention point in one sentence).\n- Next 10 minutes: clock +10, every non-done entry minutes waited +10, sometimes add a believable walk-in, rewrite notice and summary.\n- Order: set stock on order (add reorder quantity) for the medicine.\nAlways keep the notice and summary current.","lang":"en","values":{"clock":"9:00","with doctor":"Nobody"},"collections":{"patients":[{"name":"Ken Sato","age":58,"conditions":"hypertension","allergies":"none","phone":"090-1111-0001","id":"i1"},{"name":"Mary Tanaka","age":72,"conditions":"diabetes, hypertension","allergies":"penicillin","phone":"090-1111-0002","id":"i2"},{"name":"Joe Suzuki","age":34,"conditions":"none","allergies":"none","phone":"090-1111-0003","id":"i3"},{"name":"Emi Kato","age":27,"conditions":"asthma","allergies":"aspirin","phone":"090-1111-0004","id":"i4"},{"name":"Hiro Ito","age":65,"conditions":"heart failure","allergies":"none","phone":"090-1111-0005","id":"i5"},{"name":"Anna Brown","age":45,"conditions":"migraine","allergies":"none","phone":"090-1111-0006","id":"i6"},{"name":"Taro Yamada","age":8,"conditions":"none","allergies":"egg","phone":"090-1111-0007","id":"i7"},{"name":"Rina Mori","age":80,"conditions":"kidney disease","allergies":"NSAIDs","phone":"090-1111-0008","id":"i8"}],"bookings":[{"patient":"Mary Tanaka","time":"9:30","purpose":"diabetes check-up","status":"booked","id":"i9"},{"patient":"Joe Suzuki","time":"9:40","purpose":"sore throat and cough","status":"booked","id":"i10"},{"patient":"Emi Kato","time":"10:00","purpose":"asthma inhaler refill","status":"booked","id":"i11"},{"patient":"Hiro Ito","time":"10:20","purpose":"swollen ankles","status":"booked","id":"i12"},{"patient":"Anna Brown","time":"10:40","purpose":"headache","status":"booked","id":"i13"},{"patient":"Taro Yamada","time":"11:00","purpose":"fever","status":"booked","id":"i14"}],"stock":[{"medicine":"Amlodipine 5mg","left":120,"minimum":50,"on order":0,"id":"i15"},{"medicine":"Metformin 500mg","left":90,"minimum":60,"on order":0,"id":"i16"},{"medicine":"Acetaminophen 500mg","left":200,"minimum":80,"on order":0,"id":"i17"},{"medicine":"Loxoprofen 60mg","left":70,"minimum":40,"on order":0,"id":"i18"},{"medicine":"Amoxicillin 250mg","left":60,"minimum":50,"on order":0,"id":"i19"},{"medicine":"Salbutamol inhaler","left":15,"minimum":10,"on order":0,"id":"i20"},{"medicine":"Furosemide 20mg","left":45,"minimum":30,"on order":0,"id":"i21"},{"medicine":"Omeprazole 20mg","left":80,"minimum":40,"on order":0,"id":"i22"},{"medicine":"Sumatriptan 50mg","left":20,"minimum":15,"on order":0,"id":"i23"},{"medicine":"Cough syrup","left":25,"minimum":20,"on order":0,"id":"i24"},{"medicine":"Nitroglycerin tablets","left":12,"minimum":10,"on order":0,"id":"i25"},{"medicine":"Oral rehydration salts","left":40,"minimum":20,"on order":0,"id":"i26"}],"notice":[{"calling":"None yet","expected wait":"About 10 minutes","guidance":"Welcome. Please check in at reception.","id":"i27"}],"summary":[{"text":"No check-ins yet today.","id":"i28"}],"reception":[{"number":1,"patient":"Rina Mori","time":"8:50","symptom":"dizziness","urgency":"medium","status":"waiting","minutes waited":10,"id":"i29"}],"interviews":[],"exams":[],"prescriptions":[],"bills":[]},"screens":[{"name":"Waiting room","device":"waiting room display","frame":"iot","parts":[{"kind":"list","collection":"notice","columns":["calling","expected wait","guidance"]},{"kind":"list","collection":"reception","where":{"status":"waiting"},"row":[{"kind":"heading","text":"No. {number}"},{"kind":"text","text":"{minutes waited} min waited"}]}]},{"name":"Reception","device":"reception tablet","frame":"panel","parts":[{"kind":"heading","text":"Reception"},{"kind":"text","text":"Clock {value clock}"},{"kind":"list","collection":"notice","columns":["calling","expected wait","guidance"]},{"kind":"input","name":"patient name","label":"Patient name","inputType":"text"},{"kind":"input","name":"symptom","label":"Symptom","inputType":"text"},{"kind":"button","text":"Check in","intent":"Check in the patient with the given name and symptom"},{"kind":"heading","text":"Today's bookings"},{"kind":"list","collection":"bookings","row":[{"kind":"text","text":"{patient} {time} {purpose} ({status})"},{"kind":"button","text":"Arrived","intent":"Mark this booking arrived and check the patient in"},{"kind":"button","text":"Cancel","intent":"Cancel this booking"}]},{"kind":"heading","text":"Reception list"},{"kind":"list","collection":"reception","order":{"property":"urgency","values":["high","medium","low"]},"row":[{"kind":"text","text":"#{number} {patient} - {symptom}"},{"kind":"badge","text":"{urgency}"},{"kind":"badge","text":"{status}"},{"kind":"text","text":"{minutes waited} min"},{"kind":"button","text":"To billing","intent":"Send this reception entry to billing and create the bill"}]},{"kind":"heading","text":"Bills waiting"},{"kind":"list","collection":"bills","where":{"paid":false},"row":[{"kind":"text","text":"#{reception number} ${amount} {breakdown}"},{"kind":"button","text":"Paid","intent":"Mark this bill paid and the entry done"}]},{"kind":"button","text":"Next 10 minutes","intent":"Move the clock on 10 minutes"}]},{"name":"Consulting room","device":"doctor's PC","frame":"desktop","parts":[{"kind":"heading","text":"Consulting room"},{"kind":"text","text":"With the doctor: {value with doctor}"},{"kind":"heading","text":"Waiting (most urgent first)"},{"kind":"list","collection":"reception","where":{"status":"waiting"},"order":{"property":"urgency","values":["high","medium","low"]},"row":[{"kind":"text","text":"#{number} {patient} - {symptom}"},{"kind":"badge","text":"{urgency}"},{"kind":"text","text":"{minutes waited} min"},{"kind":"button","text":"Call in","intent":"Call in this waiting entry to the doctor"}]},{"kind":"list","collection":"reception","where":{"status":"interviewed"},"order":{"property":"urgency","values":["high","medium","low"]},"row":[{"kind":"text","text":"#{number} {patient} (interviewed) - {symptom}"},{"kind":"badge","text":"{urgency}"},{"kind":"button","text":"Call in","intent":"Call in this waiting entry to the doctor"}]},{"kind":"heading","text":"Interviews"},{"kind":"table","collection":"interviews","columns":["reception number","summary","points to watch","note for the doctor"]},{"kind":"input","name":"doctor note","label":"Doctor's note","inputType":"longtext"},{"kind":"button","text":"Record exam","intent":"Record exam for the patient with the doctor from the doctor's note"},{"kind":"heading","text":"Exam records"},{"kind":"list","collection":"exams","row":[{"kind":"text","text":"#{reception number} {assessment} | Draft: {draft prescription} | Next: {next visit}"},{"kind":"button","text":"Prescribe","intent":"Prescribe from this exam record's draft"}]},{"kind":"heading","text":"Prescriptions"},{"kind":"table","collection":"prescriptions","columns":["reception number","medicine","dose","days","interaction warning"]}]},{"name":"Stock","device":"stock PC","frame":"desktop","parts":[{"kind":"heading","text":"Medicine stock"},{"kind":"list","collection":"stock","row":[{"kind":"text","text":"{medicine}: left {left}, min {minimum}, on order {on order}"},{"kind":"button","text":"Order","intent":"Order this medicine"}]},{"kind":"heading","text":"Today's summary"},{"kind":"list","collection":"summary","columns":["text"]}]},{"name":"Patient","device":"patient's phone","frame":"phone","parts":[{"kind":"heading","text":"Your turn"},{"kind":"list","collection":"notice","columns":["calling","expected wait","guidance"]},{"kind":"input","name":"reception number","label":"Reception number","inputType":"number"},{"kind":"input","name":"description","label":"Describe your symptoms","inputType":"longtext"},{"kind":"button","text":"Send interview","intent":"Send interview for the reception number with the description"}]}],"timers":[],"checks":[{"name":"Chest tightness check-in","steps":[{"intent":"Check in","inputs":{"patient name":"Ken Sato","symptom":"chest tightness"}}],"expect":["Ken Sato has high urgency","He is first in the reception list","Notice rewritten"]},{"name":"Visit to payment","steps":[{"intent":"Call in","item":"Rina Mori"},{"intent":"Record exam","inputs":{"doctor note":"BP low, dehydrated"}},{"intent":"Prescribe","item":"exam record"},{"intent":"To billing","item":"Rina Mori"},{"intent":"Paid","item":"her bill"}],"expect":["Prescriptions added with allergy check (NSAIDs avoided)","Stock reduced","Bill paid, entry done, summary rewritten"]},{"name":"Interview","steps":[{"intent":"Send interview","inputs":{"reception number":"1","description":"Dizzy for two days when standing, poor appetite"}}],"expect":["One interview added","Entry 1 is interviewed"]}],"reality":{"summary":"Records and screens are ordinary code; urgency, summaries and drug checks need a model plus a drug database, with clinician review.","items":[{"part":"urgency triage","existing":"LLM classifier","effect":"Occasional under-triage; must be reviewed by staff"},{"part":"interaction check","existing":"Drug database service","effect":"Reliable if database used; model alone is risky"}],"intents":[{"intent":"Check in the patient with the given name and symptom","parts":[{"what":"create entry, mark booking","builtWith":"code","detail":"Database writes"},{"what":"judge urgency","builtWith":"model","detail":"LLM with red-flag rules"},{"what":"wait estimate and notice","builtWith":"code","detail":"Queue formula plus template"}],"errorRate":0.1,"delayMs":2000,"mistakes":"Under-rates vague symptoms; name mismatches"},{"intent":"Send interview for the reception number with the description","parts":[{"what":"summarise and flag","builtWith":"model","detail":"LLM summarisation"},{"what":"status update","builtWith":"code","detail":"DB write"}],"errorRate":0.12,"delayMs":3500,"mistakes":"Misses details or over-states certainty"},{"intent":"Prescribe from this exam record's draft","parts":[{"what":"interaction and allergy check","builtWith":"service","detail":"Drug database API"},{"what":"stock update","builtWith":"code","detail":"Inventory decrement"}],"errorRate":0.08,"delayMs":3000,"mistakes":"Missed rare interactions; wrong quantity"},{"intent":"Record exam for the patient with the doctor from the doctor's note","parts":[{"what":"assessment and draft","builtWith":"model","detail":"LLM clinical drafting, doctor confirms"}],"errorRate":0.15,"delayMs":4000,"mistakes":"Plausible but wrong assessment"},{"intent":"Move the clock on 10 minutes","parts":[{"what":"clock, waits, summary","builtWith":"code","detail":"Arithmetic"},{"what":"walk-in","builtWith":"not_yet","detail":"Real walk-ins come from people, not simulated"}],"errorRate":0.02,"delayMs":800,"mistakes":"None significant"}],"audioLatencyMs":0,"leak":0,"decisionDelayMs":2500,"errorRate":0.1,"minIntervalSec":1,"cpuNote":"Light; model calls dominate latency."},"output":{"sounds":[],"bands":[]},"nextId":34}}