&LISTREC Terminal=$list: @oemit %#=%N pushes a few buttons on the terminal.;
@pemit %#=%r%rYou push a few buttons on the medical terminal. It displays:%r%r[squish(iter(sort([iter([lattr(#2250/record_*)],[after(##,_)])]),switch(match(##,*-*),0,##)))]%r%r

&NEW Terminal=$rec new *:&record_%0 me=[v(default)];
@set #2250/record_%0=!no_command;
@pemit %#=You push a few buttons on the terminal. It displays:%r%rNew record created under the name [ucstr(%0)].%rEverything set to default.;
@oemit %#=The terminal chirps a few times as %N pushes some buttons on it.

&DEFAULT Terminal=John Doe|Civilian|0|Male|Single|0' 0"|0 lbs|Doctor Who|Null|Null|None|None|Null|Null|O|None|BP 0/0 pulse 0|Null|Null|Null|Null|Null|Null|Null|0|Null|None|Incomplete

&LIST Terminal=name|rank|age|sex|marital status|height|weight|examining physician|medical history|surgical history|medications|allergies|social history|family history|blood type|transfusions|vital signs|latest notes|chest|heart|breast|abdomen|rectal|genito-urinary-chemprofile|pulse|extremities|orders|psychological evaluation

&SET Terminal=$set */*=*:@switch [member(get(#2250/list),lcstr(%1),|)]=0,{
@pemit %#=%r%rThe terminal beeps loudly at you and displays on the screen:%rYou cannot set that!%r%r;
@oemit %#=The terminal beeps loudly at %N.
},{
@switch [hasattr(#2250,lcstr(record_%0))]=1,{
&record_%0 #2250=[replace(get(#2250/record_%0),member(get(#2250/list),lcstr(%1),|),%2,|)];
@pemit %#=%r%rYou touch a few buttons on the terminal.%r%rIt displays on the screen:%rRecord changed.%r%r
},{
@pemit %#=%r%rA loud beep sounds. The terminal displays:%r%rThat record does not exist!%r%r;
@oemit %#=A loud beep startles you. You turn around to see an angered look on %N's face.
}
}

&RETRIEVE2 Terminal=$rec *-2:@switch [hasattr(#2250,record_%0)]=1,{
@oemit %#=%N pushes a few buttons on the terminal.;
@pemit %#=%r%rYou push a few buttons on the terminal. It displays:%r%r%r%zgName: %zn[extract(v(RECORD_%0),1,1,|)]%t%t%zgRank: %zn[extract(v(RECORD_%0),2,1,|)]%r%r%zgChest: %zn[extract(v(RECORD_%0),19,1,|)]%r%zgHeart: %zn[extract(v(RECORD_%0),20,1,|)]%r%zgBreast: %zn[extract(v(RECORD_%0),21,1,|)]%r%zgAbdomen: %zn[extract(v(RECORD_%0),22,1,|)]%r%zgRectal: %zn[extract(v(RECORD_%0),23,1,|)]%r%zgGenito-Urinary-Chemprofile: %zn[extract(v(RECORD_%0),24,1,|)]%r%zgPulse: %zn[extract(v(RECORD_%0),25,1,|)]%r%zgExtremities: %zn[extract(v(RECORD_%0),26,1,|)]%r%zgOrders: %zn[extract(v(RECORD_%0),27,1,|)]%r%zgPsychological Evaluation: %zn[extract(v(RECORD_%0),28,1,|)]%r%r
},{
@pemit %#=That record does not exist!;
@oemit %#=A loud beep sounds from the terminal and you see a confused look on %N's face.
}

&RETRIEVE Terminal=$rec *-1:@switch [hasattr(#2250,record_%0)]=1,{
@oemit %#=%N pushes a few buttons on the terminal.;
@pemit %#=%r%rYou push a few buttons on the terminal. It displays:%r%r%r%zgName: %zn[extract(v(RECORD_%0),1,1,|)]%t%t%zgRank: %zn[extract(v(RECORD_%0),2,1,|)]%r%r%zgAge: %zn[extract(v(RECORD_%0),3,1,|)]%r%zgSex: %zn[extract(v(RECORD_%0),4,1,|)]%t%t%zgMarital Status: %zn[extract(v(RECORD_%0),5,1,|)]%r%zgHeight: %zn[extract(v(RECORD_%0),6,1,|)]%t%t%zgWeight: %zn[extract(v(RECORD_%0),7,1,|)]%r%zgExamining Physician: %zn[extract(v(RECORD_%0),8,1,|)]%r%zgMedical History: %zn[extract(v(RECORD_%0),9,1,|)]%r%zgSurgical History: %zn[extract(v(RECORD_%0),10,1,|)]%r%zgMedications: %zn[extract(v(RECORD_%0),11,1,|)]%r%zgAllergies: %zn[extract(v(RECORD_%0),12,1,|)]%r%zgSocial History: %zn[extract(v(RECORD_%0),13,1,|)]%r%zgFamily history: %zn[extract(v(RECORD_%0),14,1,|)]%r%zgBlood Type: %zn[extract(v(RECORD_%0),15,1,|)]%r%zgTransfusions: %zn[extract(v(RECORD_%0),16,1,|)]%r%zgVital Signs: %zn[extract(v(RECORD_%0),17,1,|)]%r%zgLatest Notes: %zn[extract(v(RECORD_%0),18,1,|)]%r%r
},{
@pemit %#=That record does not exist!;
@oemit %#=A loud beep sounds from the terminal and you see a confused look on %N's face.
}

@desc Terminal=To use the medical terminal:%r%r%rrec new : Creates a new record under the name specified. If that record exists%r%t%talready, it will be overwritten.%r%rlist: List all of the records stored in the terminal.%r%rrec -: This will view a record under the specified name. Every record has 2 pages%r%r%t%t%b%b%bto it.%r%rset /=: Use this to change something in a record. The aspect is what%r%t%t%t%t%byou want to change. The new value is what you want it to say%r%t%t%t%t%bfrom now on.