\begin{tikzpicture}[node distance=2.5cm]
\tikzstyle{process} = [rectangle, minimum width=1.5cm, minimum height=0.8cm, text centered, draw=black]
\tikzstyle{resource} = [rectangle, minimum height=0.8cm, text centered]
\tikzstyle{arrow} = [thick,->,>=stealth]
\node (start)[process] {ward};
\node (stage1)[process, right of=start, xshift= 0.5cm]{PHU};
\node (stage2)[process, right of=stage1]{OR};
\node (stage3)[process, right of=stage2, xshift=0.5cm]{PACU};
\node (stage4)[process, right of=stage3]{ICU};
\node (nurse)[resource, below of=stage1, yshift=0.6cm, xshift= 1.25cm]{nurses (circulating/scrub/anesthetist)};
\node (surgeon)[resource, above of=stage2, yshift= -1cm, text width=5cm]{surgeons/anesthesiologist/ tools and equipment};
\node (bed)[resource, below of=stage3, yshift= 1.2cm]{recovery bed};
\node (discharge)[resource, below of=start, yshift= 1.2cm]{patient discharge};
\node (arrival)[resource, left of=start, text width=1.3cm]{patient arrival};
\draw [arrow] (arrival)--(start);
\draw [arrow] (start)--(stage1);
\draw [arrow] (start)--(discharge);
\draw [arrow] (nurse)--(stage1);
\draw [arrow] (stage1)--(stage2);
\draw [arrow] (nurse)--(stage2);
\draw [arrow] (surgeon)--(stage2);
\draw [arrow] (stage2)--(stage3);
\draw [arrow] (bed)--(stage3);
\draw [arrow, densely dashed] (stage3)--(stage4);
\draw [arrow] (nurse)-|(stage4);
\draw [arrow] (stage3) -- +(0,2.2) -| (start);
\draw [arrow, densely dashed] (stage4) -- +(0,2.2) -- +(-2.5,2.2);
\end{tikzpicture}
este é o meu código para esta foto mas eu preciso da foto como esta foto
Responder1
Você pode usar |-
para determinar os pontos corretos
Notas:
- Adicionei cor às linhas que foram alteradas para que sejam fáceis de localizar (algo para ter em mente em futurasMWE).
- De acordo com o comentário do gato de Schrödinger, substituí
\tikzstyle
por\tikzset
. VerDeve \tikzset ou \tikzstyle ser usado para definir estilos TikZ? . - Conectando no meio da linha |
pode ser uma referência útil sobre como usar
|-
e-|
.
Código:
\documentclass[10pt]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[node distance=2.5cm]
\tikzset{process/.style={rectangle, minimum width=1.5cm, minimum height=0.8cm, text centered, draw=black}}
\tikzset{resource/.style={rectangle, minimum height=0.8cm, text centered}}
\tikzset{arrow/.style={thick,->,>=stealth}}
\node (start)[process] {ward};
\node (stage1)[process, right of=start, xshift= 0.5cm]{PHU};
\node (stage2)[process, right of=stage1]{OR};
\node (stage3)[process, right of=stage2, xshift=0.5cm]{PACU};
\node (stage4)[process, right of=stage3]{ICU};
\node (nurse)[resource, below of=stage1, yshift=0.6cm, xshift= 1.25cm]{nurses (circulating/scrub/anesthetist)};
\node (surgeon)[resource, above of=stage2, yshift= -1cm, text width=5cm]{surgeons/anesthesiologist/ tools and equipment};
\node (bed)[resource, below of=stage3, yshift= 1.2cm]{recovery bed};
\node (discharge)[resource, below of=start, yshift= 1.2cm]{patient discharge};
\node (arrival)[resource, left of=start, text width=1.3cm]{patient arrival};
\draw [arrow] (arrival)--(start);
\draw [arrow] (start)--(stage1);
\draw [arrow] (start)--(discharge);
\draw [arrow, <-, red] (stage1) -- (stage1 |- nurse.north);
\draw [arrow] (stage1)--(stage2);
\draw [arrow, <-, blue] (stage2) -- (stage2 |- nurse.north);
\draw [arrow] (surgeon)--(stage2);
\draw [arrow] (stage2)--(stage3);
\draw [arrow] (bed)--(stage3);
\draw [arrow, densely dashed] (stage3)--(stage4);
\draw [arrow] (nurse)-|(stage4);
\draw [arrow] (stage3) -- +(0,2.2) -| (start);
\draw [arrow, densely dashed] (stage4) -- +(0,2.2) -- +(-2.5,2.2);
\end{tikzpicture}
\end{document}