Start No_Encounter Inpatient Outpatient Temporary_Leave ini /lastEvent = "ini"; comingFrom="start"; A01 /lastEvent = "A01"; comingFrom="No_Encounter"; A04 /lastEvent = "A04"; comingFrom = "No_Encounter"; A03 /lastEvent = "A03"; comingFrom = "Outpatient"; A03 /lastEvent = "A03"; comingFrom = "Inpatient"; A11 [lastEvent=="A04" && comingFrom=="No_Encounter"] A11 [lastEvent=="A01" && comingFrom=="No_Encounter"] A13 [lastEvent=="A03" && comingFrom=="Inpatient"] A13 [lastEvent=="A03" && comingFrom=="Outpatient"] A21 /lastEvent = "A21"; A22 /lastEvent = "A22"; A52 [lastEvent=="A21"] A53 [lastEvent=="A22"]