Skip to content

Instantly share code, notes, and snippets.

@jacobmischka
Created March 6, 2020 17:24
Show Gist options
  • Save jacobmischka/97fe4ca00377dc4dbb26e8c856cf51e5 to your computer and use it in GitHub Desktop.
Save jacobmischka/97fe4ca00377dc4dbb26e8c856cf51e5 to your computer and use it in GitHub Desktop.
impl Location {
pub fn is_in_or(&self) -> bool {
use Location::*;
match self {
OrCmh | OrCmhEct | OrDtssc | OrFhIpp | OrFhe | OrFhw | OrFsc | OrLcsc | OrObCmh
| OrObFh | OrObSjh | OrSjh | OrWbsc => true,
_ => false,
}
}
pub fn is_fh(&self) -> bool {
use Location::*;
match self {
FhNonOrCathEp | FhNonOrEcho | FhNonOrIr | FhNonOrMpa | FhNonOrProcedures
| OrCystoFh | OrEiFh | OrFhAnesthesiaAway | OrFhIpp | OrFhMpa | OrFhe | OrFhw
| OrGiFh => true,
_ => false,
}
}
}
impl Room {
pub fn is_fh(&self) -> bool {
use self::Room::*;
match self {
FhIPP(_) | FhOr(_) | FhwOr(_) | EiToOr | OrEastPending | OrWestPending
| OrIppPending(_) | FmlhHybridIPP(_) | FhIrHybridOr(_) | FhGiOr(_) | FhCysto(_)
| FhCystoPending | FhGiCapsEndos | FhGiOutOfLab | FhProcedure | OrStaffAway
| FmlhMpaIp(_) | FmlhMpaBronch(_) => true,
_ => false,
}
}
pub fn is_in_or(&self) -> bool {
use self::Room::*;
match *self {
FhIPP(x) if x > 15 => true,
FhOr(x) if x <= 40 => true,
EiToOr | OrEastPending | OrWestPending | OrIppPending(_) | FmlhHybridIPP(_)
| FhIrHybridOr(_) => true,
FhwOr(_) => true,
SjhOr(_) | CmhOr(_) => true,
_ => false,
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment