PulseEngine.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5
6#include "engine/CommonDefs.h"
7#include "cdm/PhysiologyEngine.h"
8#include "cdm/utils/ScopedMutex.h"
9
10struct PULSE_DECL PulseBuildInformation
11{
12 static std::string Time();
13 static std::string Hash();
14 static std::string Version();
15};
16
17enum class eModelType { HumanAdultWholeBody=0, HumanAdultVentilationMechanics, HumanAdultHemodynamics };
18PULSE_DECL bool eModelType_ValueOf(const std::string s, eModelType& t);
19
20PULSE_DECL std::unique_ptr<PhysiologyEngine> CreatePulseEngine(eModelType type = eModelType::HumanAdultWholeBody, Logger* logger = nullptr);
21
22struct IrreversibleStateException : public std::runtime_error
23{
25 : std::runtime_error("Engine Has Entered An Irreversible State") {}
26
27 IrreversibleStateException(const std::string& _Message)
28 : std::runtime_error(_Message) {}
29};
30
31namespace pulse
32{
34 // All Compartments used by Pulse //
36
37 class Graph
38 {
39 public:
40 DEFINE_STATIC_STRING(ActiveCardiovascular);
41 DEFINE_STATIC_STRING(Cardiovascular);
42 DEFINE_STATIC_STRING(Renal);
43 DEFINE_STATIC_STRING(Respiratory);
44 DEFINE_STATIC_STRING(RespiratoryAndAnesthesiaMachine);
45 DEFINE_STATIC_STRING(RespiratoryAndBagValveMask);
46 DEFINE_STATIC_STRING(RespiratoryAndInhaler);
47 DEFINE_STATIC_STRING(RespiratoryAndMechanicalVentilation);
48 DEFINE_STATIC_STRING(RespiratoryAndMechanicalVentilator);
49 DEFINE_STATIC_STRING(RespiratoryAndNasalCannula);
50 DEFINE_STATIC_STRING(RespiratoryAndNonRebreatherMask);
51 DEFINE_STATIC_STRING(RespiratoryAndSimpleMask);
52 DEFINE_STATIC_STRING(Aerosol);
53 DEFINE_STATIC_STRING(AerosolAndBagValveMask);
54 DEFINE_STATIC_STRING(AerosolAndInhaler);
55 DEFINE_STATIC_STRING(AerosolAndMechanicalVentilation);
56 DEFINE_STATIC_STRING(AerosolAndMechanicalVentilator);
57 DEFINE_STATIC_STRING(AnesthesiaMachine);
58 DEFINE_STATIC_STRING(BagValveMask);
59 DEFINE_STATIC_STRING(MechanicalVentilator);
60
61 static const std::vector<std::string>& GetValues()
62 {
63 ScopedMutex lock;
64 if (_values.empty())
65 {
66 _values.push_back(ActiveCardiovascular);
67 _values.push_back(Cardiovascular);
68 _values.push_back(Renal);
69 _values.push_back(Respiratory);
70 _values.push_back(RespiratoryAndAnesthesiaMachine);
71 _values.push_back(RespiratoryAndBagValveMask);
72 _values.push_back(RespiratoryAndInhaler);
73 _values.push_back(RespiratoryAndMechanicalVentilation);
74 _values.push_back(RespiratoryAndMechanicalVentilator);
75 _values.push_back(RespiratoryAndNasalCannula);
76 _values.push_back(RespiratoryAndNonRebreatherMask);
77 _values.push_back(RespiratoryAndSimpleMask);
78 _values.push_back(Aerosol);
79 _values.push_back(AerosolAndBagValveMask);
80 _values.push_back(AerosolAndInhaler);
81 _values.push_back(AerosolAndMechanicalVentilation);
82 _values.push_back(AerosolAndMechanicalVentilator);
83 _values.push_back(BagValveMask);
84 _values.push_back(AnesthesiaMachine);
85 _values.push_back(MechanicalVentilator);
86 }
87 return _values;
88 }
89 static bool HasValue(const std::string& v)
90 {
91 return std::find(_values.begin(), _values.end(), v) != _values.end();
92 }
93 static void AddValue(const std::string& v)
94 {
95 if (!HasValue(v))
96 {
97 ScopedMutex lock;
98 _values.push_back(v);
99 }
100 }
101 protected:
102 static std::vector<std::string> _values;
103 };
104
105 // TODO Rachel
106 class CerebrospinalFluidCompartment
107 {
108 public:
109 DEFINE_STATIC_STRING(IntracranialSpace);
110
111 static const std::vector<std::string>& GetValues()
112 {
113 ScopedMutex lock;
114 if (_values.empty())
115 {
116 _values.push_back(IntracranialSpace);
117 }
118 return _values;
119 }
120 static bool HasValue(const std::string& v)
121 {
122 return std::find(_values.begin(), _values.end(), v) != _values.end();
123 }
124 static void AddValue(const std::string& v)
125 {
126 if (!HasValue(v))
127 {
128 ScopedMutex lock;
129 _values.push_back(v);
130 }
131 }
132 protected:
133 static std::vector<std::string> _values;
134 };
135
136 class ChymeCompartment
137 {
138 public:
139 DEFINE_STATIC_STRING_EX(SmallIntestine, SmallIntestineChyme);
140
141 static const std::vector<std::string>& GetValues()
142 {
143 ScopedMutex lock;
144 if (_values.empty())
145 {
146 _values.push_back(SmallIntestine);
147 }
148 return _values;
149 }
150 static bool HasValue(const std::string& v)
151 {
152 return std::find(_values.begin(), _values.end(), v) != _values.end();
153 }
154 static void AddValue(const std::string& v)
155 {
156 if (!HasValue(v))
157 {
158 ScopedMutex lock;
159 _values.push_back(v);
160 }
161 }
162 protected:
163 static std::vector<std::string> _values;
164 };
165
166 class ChymeLink
167 {
168 public:
169 DEFINE_STATIC_STRING(SmallIntestineChymeToVasculature);
170
171 static const std::vector<std::string>& GetValues()
172 {
173 ScopedMutex lock;
174 if (_values.empty())
175 {
176 _values.push_back(SmallIntestineChymeToVasculature);
177 }
178 return _values;
179 }
180 static bool HasValue(const std::string& v)
181 {
182 return std::find(_values.begin(), _values.end(), v) != _values.end();
183 }
184 static void AddValue(const std::string& v)
185 {
186 if (!HasValue(v))
187 {
188 ScopedMutex lock;
189 _values.push_back(v);
190 }
191 }
192 protected:
193 static std::vector<std::string> _values;
194 };
195
196 class PulmonaryCompartment
197 {
198 public:
199 DEFINE_STATIC_STRING(Airway);
200 DEFINE_STATIC_STRING(Stomach);
201 DEFINE_STATIC_STRING(Pharynx);
202 DEFINE_STATIC_STRING(Carina);
203 DEFINE_STATIC_STRING_EX(Lungs, PulmonaryLungs);
204 DEFINE_STATIC_STRING(Alveoli);
205 DEFINE_STATIC_STRING(AlveolarDeadSpace);
206 DEFINE_STATIC_STRING(AnatomicDeadSpace);
207 DEFINE_STATIC_STRING_EX(LeftLung, LeftLungPulmonary);
208 /***/DEFINE_STATIC_STRING(LeftAnatomicDeadSpace);
209 /***/DEFINE_STATIC_STRING(LeftAlveolarDeadSpace);
210 /***/DEFINE_STATIC_STRING(LeftAlveoli);
211 DEFINE_STATIC_STRING_EX(RightLung, RightLungPulmonary);
212 /***/DEFINE_STATIC_STRING(RightAnatomicDeadSpace);
213 /***/DEFINE_STATIC_STRING(RightAlveolarDeadSpace);
214 /***/DEFINE_STATIC_STRING(RightAlveoli);
215 DEFINE_STATIC_STRING(PleuralCavity);
216 DEFINE_STATIC_STRING(LeftPleuralCavity);
217 DEFINE_STATIC_STRING(RightPleuralCavity);
218
219 DEFINE_STATIC_STRING(LeftAlveoliLeak);
220 DEFINE_STATIC_STRING(LeftChestLeak);
221 DEFINE_STATIC_STRING(LeftNeedle);
222 DEFINE_STATIC_STRING(RightAlveoliLeak);
223 DEFINE_STATIC_STRING(RightChestLeak);
224 DEFINE_STATIC_STRING(RightNeedle);
225
226 static const std::vector<std::string>& GetValues()
227 {
228 ScopedMutex lock;
229 if (_values.empty())
230 {
231 _values.push_back(Airway);
232 _values.push_back(Stomach);
233 _values.push_back(Pharynx);
234 _values.push_back(Carina);
235 _values.push_back(Lungs);
236 _values.push_back(Alveoli);
237 _values.push_back(AlveolarDeadSpace);
238 _values.push_back(AnatomicDeadSpace);
239 _values.push_back(LeftLung);
240 _values.push_back(LeftAnatomicDeadSpace);
241 _values.push_back(LeftAlveolarDeadSpace);
242 _values.push_back(LeftAlveoli);
243 _values.push_back(RightLung);
244 _values.push_back(RightAnatomicDeadSpace);
245 _values.push_back(RightAlveolarDeadSpace);
246 _values.push_back(RightAlveoli);
247 _values.push_back(PleuralCavity);
248 _values.push_back(LeftPleuralCavity);
249 _values.push_back(RightPleuralCavity);
250 _values.push_back(LeftAlveoliLeak);
251 _values.push_back(LeftChestLeak);
252 _values.push_back(LeftNeedle);
253 _values.push_back(RightAlveoliLeak);
254 _values.push_back(RightChestLeak);
255 _values.push_back(RightNeedle);
256 }
257 return _values;
258 }
259 static bool HasValue(const std::string& v)
260 {
261 return std::find(_values.begin(), _values.end(), v) != _values.end();
262 }
263 static void AddValue(const std::string& v)
264 {
265 if (!HasValue(v))
266 {
267 ScopedMutex lock;
268 _values.push_back(v);
269 }
270 }
271 protected:
272 static std::vector<std::string> _values;
273 };
274
275 class PulmonaryLink
276 {
277 public:
278 DEFINE_STATIC_STRING(EnvironmentToAirway);
279 DEFINE_STATIC_STRING(AirwayToPharynx);
280 DEFINE_STATIC_STRING(AirwayToStomach);
281 DEFINE_STATIC_STRING(PharynxToCarina);
282 DEFINE_STATIC_STRING(PharynxToEnvironment);
283 DEFINE_STATIC_STRING(CarinaToLeftAnatomicDeadSpace);
284 DEFINE_STATIC_STRING(LeftAnatomicDeadSpaceToLeftAlveolarDeadSpace);
285 DEFINE_STATIC_STRING(LeftAlveolarDeadSpaceToLeftAlveoli);
286 DEFINE_STATIC_STRING(CarinaToRightAnatomicDeadSpace);
287 DEFINE_STATIC_STRING(RightAnatomicDeadSpaceToRightAlveolarDeadSpace);
288 DEFINE_STATIC_STRING(RightAlveolarDeadSpaceToRightAlveoli);
289 DEFINE_STATIC_STRING(EnvironmentToLeftChestLeak);
290 DEFINE_STATIC_STRING(EnvironmentToRightChestLeak);
291 DEFINE_STATIC_STRING(LeftAlveoliLeakToLeftPleural);
292 DEFINE_STATIC_STRING(LeftAlveoliToLeftAlveoliLeak);
293 DEFINE_STATIC_STRING(LeftChestLeakToLeftPleural);
294 DEFINE_STATIC_STRING(LeftNeedleToLeftPleural);
295 DEFINE_STATIC_STRING(EnvironmentToLeftNeedle);
296 DEFINE_STATIC_STRING(RightAlveoliLeakToRightPleural);
297 DEFINE_STATIC_STRING(RightAlveoliToRightAlveoliLeak);
298 DEFINE_STATIC_STRING(RightChestLeakToRightPleural);
299 DEFINE_STATIC_STRING(RightNeedleToRightPleural);
300 DEFINE_STATIC_STRING(EnvironmentToRightNeedle);
301
302 static const std::vector<std::string>& GetValues()
303 {
304 ScopedMutex lock;
305 if (_values.empty())
306 {
307 _values.push_back(EnvironmentToAirway);
308 _values.push_back(AirwayToPharynx);
309 _values.push_back(AirwayToStomach);
310 _values.push_back(PharynxToCarina);
311 _values.push_back(PharynxToEnvironment);
312 _values.push_back(CarinaToLeftAnatomicDeadSpace);
313 _values.push_back(LeftAnatomicDeadSpaceToLeftAlveolarDeadSpace);
314 _values.push_back(LeftAlveolarDeadSpaceToLeftAlveoli);
315 _values.push_back(CarinaToRightAnatomicDeadSpace);
316 _values.push_back(RightAnatomicDeadSpaceToRightAlveolarDeadSpace);
317 _values.push_back(RightAlveolarDeadSpaceToRightAlveoli);
318 _values.push_back(EnvironmentToLeftChestLeak);
319 _values.push_back(EnvironmentToRightChestLeak);
320 _values.push_back(LeftAlveoliLeakToLeftPleural);
321 _values.push_back(LeftAlveoliToLeftAlveoliLeak);
322 _values.push_back(LeftChestLeakToLeftPleural);
323 _values.push_back(LeftNeedleToLeftPleural);
324 _values.push_back(EnvironmentToLeftNeedle);
325 _values.push_back(RightAlveoliLeakToRightPleural);
326 _values.push_back(RightAlveoliToRightAlveoliLeak);
327 _values.push_back(RightChestLeakToRightPleural);
328 _values.push_back(RightNeedleToRightPleural);
329 _values.push_back(EnvironmentToRightNeedle);
330 }
331 return _values;
332 }
333 static bool HasValue(const std::string& v)
334 {
335 return std::find(_values.begin(), _values.end(), v)!=_values.end();
336 }
337 static void AddValue(const std::string& v)
338 {
339 if (!HasValue(v))
340 {
341 ScopedMutex lock;
342 _values.push_back(v);
343 }
344 }
345 protected:
346 static std::vector<std::string> _values;
347 };
348
349 class ExpandedPulmonaryCompartment
350 {
351 public:
352
353 static const std::vector<std::string>& GetValues()
354 {
355 ScopedMutex lock;
356 if (_values.empty())
357 {
358
359 }
360 return _values;
361 }
362 static bool HasValue(const std::string& v)
363 {
364 return std::find(_values.begin(), _values.end(), v) != _values.end();
365 }
366 static void AddValue(const std::string& v)
367 {
368 if (!HasValue(v))
369 {
370 ScopedMutex lock;
371 _values.push_back(v);
372 }
373 }
374 protected:
375 static std::vector<std::string> _values;
376 };
377
378 class ExpandedPulmonaryLink
379 {
380 public:
381
382 static const std::vector<std::string>& GetValues()
383 {
384 ScopedMutex lock;
385 if (_values.empty())
386 {
387
388 }
389 return _values;
390 }
391 static bool HasValue(const std::string& v)
392 {
393 return std::find(_values.begin(), _values.end(), v) != _values.end();
394 }
395 static void AddValue(const std::string& v)
396 {
397 if (!HasValue(v))
398 {
399 ScopedMutex lock;
400 _values.push_back(v);
401 }
402 }
403 protected:
404 static std::vector<std::string> _values;
405 };
406
407 class TissueCompartment
408 {
409 public:
410 DEFINE_STATIC_STRING_EX(Bone, BoneTissue);
411 DEFINE_STATIC_STRING_EX(Brain, BrainTissue);
412 DEFINE_STATIC_STRING_EX(Fat, FatTissue);
413 DEFINE_STATIC_STRING_EX(Gut, GutTissue);
414 DEFINE_STATIC_STRING_EX(LeftKidney, LeftKidneyTissue);
415 DEFINE_STATIC_STRING_EX(LeftLung, LeftLungTissue);
416 DEFINE_STATIC_STRING_EX(Liver, LiverTissue);
417 DEFINE_STATIC_STRING_EX(Muscle, MuscleTissue);
418 DEFINE_STATIC_STRING_EX(Myocardium, MyocardiumTissue);
419 DEFINE_STATIC_STRING_EX(RightKidney, RightKidneyTissue);
420 DEFINE_STATIC_STRING_EX(RightLung, RightLungTissue);
421 DEFINE_STATIC_STRING_EX(Skin, SkinTissue);
422 DEFINE_STATIC_STRING_EX(Spleen, SpleenTissue);
423
424 static const std::vector<std::string>& GetValues()
425 {
426 ScopedMutex lock;
427 if (_values.empty())
428 {
429 _values.push_back(Bone);
430 _values.push_back(Brain);
431 _values.push_back(Fat);
432 _values.push_back(Gut);
433 _values.push_back(LeftKidney);
434 _values.push_back(LeftLung);
435 _values.push_back(Liver);
436 _values.push_back(Muscle);
437 _values.push_back(Myocardium);
438 _values.push_back(RightKidney);
439 _values.push_back(RightLung);
440 _values.push_back(Skin);
441 _values.push_back(Spleen);
442 }
443 return _values;
444 }
445 static bool HasValue(const std::string& v)
446 {
447 return std::find(_values.begin(), _values.end(), v) != _values.end();
448 }
449 static void AddValue(const std::string& v)
450 {
451 if (!HasValue(v))
452 {
453 ScopedMutex lock;
454 _values.push_back(v);
455 }
456 }
457 protected:
458 static std::vector<std::string> _values;
459 };
460
461 class ExtravascularCompartment
462 {
463 public:
464 DEFINE_STATIC_STRING_EX(BoneExtracellular, BoneTissueExtracellular);
465 DEFINE_STATIC_STRING_EX(BrainExtracellular, BrainTissueExtracellular);
466 DEFINE_STATIC_STRING_EX(FatExtracellular, FatTissueExtracellular);
467 DEFINE_STATIC_STRING_EX(GutExtracellular, GutTissueExtracellular);
468 DEFINE_STATIC_STRING_EX(LeftKidneyExtracellular, LeftKidneyTissueExtracellular);
469 DEFINE_STATIC_STRING_EX(LeftLungExtracellular, LeftLungTissueExtracellular);
470 DEFINE_STATIC_STRING_EX(LiverExtracellular, LiverTissueExtracellular);
471 DEFINE_STATIC_STRING_EX(MuscleExtracellular, MuscleTissueExtracellular);
472 DEFINE_STATIC_STRING_EX(MyocardiumExtracellular, MyocardiumTissueExtracellular);
473 DEFINE_STATIC_STRING_EX(RightKidneyExtracellular, RightKidneyTissueExtracellular);
474 DEFINE_STATIC_STRING_EX(RightLungExtracellular, RightLungTissueExtracellular);
475 DEFINE_STATIC_STRING_EX(SkinExtracellular, SkinTissueExtracellular);
476 DEFINE_STATIC_STRING_EX(SpleenExtracellular, SpleenTissueExtracellular);
477
478 DEFINE_STATIC_STRING_EX(BoneIntracellular, BoneTissueIntracellular);
479 DEFINE_STATIC_STRING_EX(BrainIntracellular, BrainTissueIntracellular);
480 DEFINE_STATIC_STRING_EX(FatIntracellular, FatTissueIntracellular);
481 DEFINE_STATIC_STRING_EX(GutIntracellular, GutTissueIntracellular);
482 DEFINE_STATIC_STRING_EX(LeftKidneyIntracellular, LeftKidneyTissueIntracellular);
483 DEFINE_STATIC_STRING_EX(LeftLungIntracellular, LeftLungTissueIntracellular);
484 DEFINE_STATIC_STRING_EX(LiverIntracellular, LiverTissueIntracellular);
485 DEFINE_STATIC_STRING_EX(MuscleIntracellular, MuscleTissueIntracellular);
486 DEFINE_STATIC_STRING_EX(MyocardiumIntracellular, MyocardiumTissueIntracellular);
487 DEFINE_STATIC_STRING_EX(RightKidneyIntracellular, RightKidneyTissueIntracellular);
488 DEFINE_STATIC_STRING_EX(RightLungIntracellular, RightLungTissueIntracellular);
489 DEFINE_STATIC_STRING_EX(SkinIntracellular, SkinTissueIntracellular);
490 DEFINE_STATIC_STRING_EX(SpleenIntracellular, SpleenTissueIntracellular);
491
492 static const std::vector<std::string>& GetValues()
493 {
494 ScopedMutex lock;
495 if (_values.empty())
496 {
497 _values.push_back(BoneExtracellular);
498 _values.push_back(BrainExtracellular);
499 _values.push_back(FatExtracellular);
500 _values.push_back(GutExtracellular);
501 _values.push_back(LeftKidneyExtracellular);
502 _values.push_back(LeftLungExtracellular);
503 _values.push_back(LiverExtracellular);
504 _values.push_back(MuscleExtracellular);
505 _values.push_back(MyocardiumExtracellular);
506 _values.push_back(RightKidneyExtracellular);
507 _values.push_back(RightLungExtracellular);
508 _values.push_back(SkinExtracellular);
509 _values.push_back(SpleenExtracellular);
510
511 _values.push_back(BoneIntracellular);
512 _values.push_back(BrainIntracellular);
513 _values.push_back(FatIntracellular);
514 _values.push_back(GutIntracellular);
515 _values.push_back(LeftKidneyIntracellular);
516 _values.push_back(LeftLungIntracellular);
517 _values.push_back(LiverIntracellular);
518 _values.push_back(MuscleIntracellular);
519 _values.push_back(MyocardiumIntracellular);
520 _values.push_back(RightKidneyIntracellular);
521 _values.push_back(RightLungIntracellular);
522 _values.push_back(SkinIntracellular);
523 _values.push_back(SpleenIntracellular);
524 }
525 return _values;
526 }
527 static bool HasValue(const std::string& v)
528 {
529 return std::find(_values.begin(), _values.end(), v) != _values.end();
530 }
531 static void AddValue(const std::string& v)
532 {
533 if (!HasValue(v))
534 {
535 ScopedMutex lock;
536 _values.push_back(v);
537 }
538 }
539 protected:
540 static std::vector<std::string> _values;
541 };
542
543 class VascularCompartment
544 {
545 public:
546 // Cardio
547 DEFINE_STATIC_STRING(Aorta);
548 DEFINE_STATIC_STRING(Heart);
549 DEFINE_STATIC_STRING_EX(Myocardium, MyocardiumVasculature);
550 DEFINE_STATIC_STRING(LeftHeart);
551 DEFINE_STATIC_STRING(RightHeart);
552 DEFINE_STATIC_STRING(Pericardium);
553 DEFINE_STATIC_STRING(VenaCava);
554 // Pulmonary
555 DEFINE_STATIC_STRING(PulmonaryArteries);
556 DEFINE_STATIC_STRING(PulmonaryCapillaries);
557 DEFINE_STATIC_STRING(PulmonaryVeins);
558 DEFINE_STATIC_STRING_EX(Lungs, LungsVasculature);
559 DEFINE_STATIC_STRING_EX(LeftLung, LeftLungVasculature);
560 /***/DEFINE_STATIC_STRING(LeftPulmonaryArteries);
561 /***/DEFINE_STATIC_STRING(LeftPulmonaryCapillaries);
562 /***/DEFINE_STATIC_STRING(LeftPulmonaryVeins);
563 DEFINE_STATIC_STRING_EX(RightLung, RightLungVasculature);
564 /***/DEFINE_STATIC_STRING(RightPulmonaryArteries);
565 /***/DEFINE_STATIC_STRING(RightPulmonaryCapillaries);
566 /***/DEFINE_STATIC_STRING(RightPulmonaryVeins);
567 // Renal
568 DEFINE_STATIC_STRING_EX(Kidneys, KidneyVasculature);
569 DEFINE_STATIC_STRING_EX(LeftKidney, LeftKidneyVasculature);
570 /***/DEFINE_STATIC_STRING(LeftRenalArtery);
571 /***/DEFINE_STATIC_STRING(LeftNephron);
572 /*********/DEFINE_STATIC_STRING(LeftAfferentArteriole);
573 /*********/DEFINE_STATIC_STRING(LeftGlomerularCapillaries);
574 /*********/DEFINE_STATIC_STRING(LeftEfferentArteriole);
575 /*********/DEFINE_STATIC_STRING(LeftPeritubularCapillaries);
576 /*********/DEFINE_STATIC_STRING(LeftBowmansCapsules);
577 /*********/DEFINE_STATIC_STRING(LeftTubules);
578 /***/DEFINE_STATIC_STRING(LeftRenalVein);
579 DEFINE_STATIC_STRING_EX(RightKidney, RightKidneyVasculature);
580 /***/DEFINE_STATIC_STRING(RightRenalArtery);
581 /***/DEFINE_STATIC_STRING(RightNephron);
582 /*********/DEFINE_STATIC_STRING(RightAfferentArteriole);
583 /*********/DEFINE_STATIC_STRING(RightGlomerularCapillaries);
584 /*********/DEFINE_STATIC_STRING(RightEfferentArteriole);
585 /*********/DEFINE_STATIC_STRING(RightPeritubularCapillaries);
586 /*********/DEFINE_STATIC_STRING(RightBowmansCapsules);
587 /*********/DEFINE_STATIC_STRING(RightTubules);
588 /***/DEFINE_STATIC_STRING(RightRenalVein);
589 // General Organs and Periphery
590 DEFINE_STATIC_STRING_EX(Bone, BoneVasculature);
591 DEFINE_STATIC_STRING_EX(Brain, BrainVasculature);
592 DEFINE_STATIC_STRING_EX(Fat, FatVasculature);
593 DEFINE_STATIC_STRING_EX(Gut, GutVasculature);
594 DEFINE_STATIC_STRING_EX(Splanchnic, SplanchnicVasculature);
595 DEFINE_STATIC_STRING_EX(SmallIntestine, SmallIntestineVasculature);
596 DEFINE_STATIC_STRING_EX(LargeIntestine, LargeIntestineVasculature);
597 DEFINE_STATIC_STRING_EX(Liver, LiverVasculature);
598 DEFINE_STATIC_STRING_EX(Spleen, SpleenVasculature);
599 DEFINE_STATIC_STRING_EX(Skin, SkinVasculature);
600 DEFINE_STATIC_STRING_EX(Muscle, MuscleVasculature);
601 DEFINE_STATIC_STRING_EX(LeftArm, LeftArmVasculature);
602 DEFINE_STATIC_STRING_EX(LeftLeg, LeftLegVasculature);
603 DEFINE_STATIC_STRING_EX(RightArm, RightArmVasculature);
604 DEFINE_STATIC_STRING_EX(RightLeg, RightLegVasculature);
605 DEFINE_STATIC_STRING(Abdomen);
606 DEFINE_STATIC_STRING(AbdominalCavity);
607
608 DEFINE_STATIC_STRING(Ground);
609
610
611 static const std::vector<std::string>& GetValues()
612 {
613 ScopedMutex lock;
614 if (_values.empty())
615 {
616 _values.push_back(Aorta);
617 _values.push_back(Abdomen);
618 _values.push_back(Heart);
619 _values.push_back(Myocardium);
620 _values.push_back(LeftHeart);
621 _values.push_back(RightHeart);
622 _values.push_back(Pericardium);
623 _values.push_back(VenaCava);
624 _values.push_back(PulmonaryArteries);
625 _values.push_back(PulmonaryCapillaries);
626 _values.push_back(PulmonaryVeins);
627 _values.push_back(Lungs);
628 _values.push_back(LeftLung);
629 _values.push_back(LeftPulmonaryArteries);
630 _values.push_back(LeftPulmonaryCapillaries);
631 _values.push_back(LeftPulmonaryVeins);
632 _values.push_back(RightLung);
633 _values.push_back(RightPulmonaryArteries);
634 _values.push_back(RightPulmonaryCapillaries);
635 _values.push_back(RightPulmonaryVeins);
636 _values.push_back(Kidneys);
637 _values.push_back(LeftKidney);
638 _values.push_back(LeftRenalArtery);
639 _values.push_back(LeftNephron);
640 _values.push_back(LeftAfferentArteriole);
641 _values.push_back(LeftGlomerularCapillaries);
642 _values.push_back(LeftEfferentArteriole);
643 _values.push_back(LeftPeritubularCapillaries);
644 _values.push_back(LeftBowmansCapsules);
645 _values.push_back(LeftTubules);
646 _values.push_back(LeftRenalVein);
647 _values.push_back(RightKidney);
648 _values.push_back(RightRenalArtery);
649 _values.push_back(RightNephron);
650 _values.push_back(RightAfferentArteriole);
651 _values.push_back(RightGlomerularCapillaries);
652 _values.push_back(RightEfferentArteriole);
653 _values.push_back(RightPeritubularCapillaries);
654 _values.push_back(RightBowmansCapsules);
655 _values.push_back(RightTubules);
656 _values.push_back(RightRenalVein);
657 _values.push_back(Bone);
658 _values.push_back(Brain);
659 _values.push_back(Fat);
660 _values.push_back(Gut);
661 _values.push_back(Splanchnic);
662 _values.push_back(SmallIntestine);
663 _values.push_back(LargeIntestine);
664 _values.push_back(Liver);
665 _values.push_back(Spleen);
666 _values.push_back(Skin);
667 _values.push_back(Muscle);
668 _values.push_back(LeftArm);
669 _values.push_back(LeftLeg);
670 _values.push_back(RightArm);
671 _values.push_back(RightLeg);
672 //_values.push_back(Ground);
673 }
674 return _values;
675 }
676 static bool HasValue(const std::string& v)
677 {
678 return std::find(_values.begin(), _values.end(), v) != _values.end();
679 }
680 static void AddValue(const std::string& v)
681 {
682 if (!HasValue(v))
683 {
684 ScopedMutex lock;
685 _values.push_back(v);
686 }
687 }
688 protected:
689 static std::vector<std::string> _values;
690 };
691
692 class VascularLink
693 {
694 public:
695 // Heart and Lungs
696 DEFINE_STATIC_STRING(VenaCavaToRightHeart);
697 DEFINE_STATIC_STRING(RightHeartToLeftPulmonaryArteries);
698 DEFINE_STATIC_STRING(LeftPulmonaryArteriesToCapillaries);
699 DEFINE_STATIC_STRING(LeftPulmonaryArteriesToVeins);
700 DEFINE_STATIC_STRING(LeftPulmonaryCapillariesToVeins);
701 DEFINE_STATIC_STRING(LeftPulmonaryVeinsLeak);
702 DEFINE_STATIC_STRING(LeftPulmonaryVeinsToLeftHeart);
703 DEFINE_STATIC_STRING(RightHeartToRightPulmonaryArteries);
704 DEFINE_STATIC_STRING(RightPulmonaryArteriesToCapillaries);
705 DEFINE_STATIC_STRING(RightPulmonaryArteriesToVeins);
706 DEFINE_STATIC_STRING(RightPulmonaryCapillariesToVeins);
707 DEFINE_STATIC_STRING(RightPulmonaryVeinsLeak);
708 DEFINE_STATIC_STRING(RightPulmonaryVeinsToLeftHeart);
709 DEFINE_STATIC_STRING(LeftHeartToAorta);
710 // Bone
711 DEFINE_STATIC_STRING(AortaToBone);
712 DEFINE_STATIC_STRING(BoneToVenaCava);
713 // Brain
714 DEFINE_STATIC_STRING(AortaToBrain);
715 DEFINE_STATIC_STRING(BrainToVenaCava);
716 // Fat
717 DEFINE_STATIC_STRING(AortaToFat);
718 DEFINE_STATIC_STRING(FatToVenaCava);
719 // Large Intestine
720 DEFINE_STATIC_STRING(AortaToLargeIntestine);
721 DEFINE_STATIC_STRING(LargeIntestineToLiver);
722 // Left Arm
723 DEFINE_STATIC_STRING(AortaToLeftArm);
724 DEFINE_STATIC_STRING(LeftArmToVenaCava);
725 // Left Kidney
726 DEFINE_STATIC_STRING(AortaToLeftKidney);
727 DEFINE_STATIC_STRING(LeftKidneyToVenaCava);
728 // Left Leg
729 DEFINE_STATIC_STRING(AortaToLeftLeg);
730 DEFINE_STATIC_STRING(LeftLegToVenaCava);
731 // Liver
732 DEFINE_STATIC_STRING(AortaToLiver);
733 DEFINE_STATIC_STRING(LiverToVenaCava);
734 // Muscle
735 DEFINE_STATIC_STRING(AortaToMuscle);
736 DEFINE_STATIC_STRING(MuscleToVenaCava);
737 // Myocardium
738 DEFINE_STATIC_STRING(AortaToMyocardium);
739 DEFINE_STATIC_STRING(MyocardiumToVenaCava);
740 // Right Arm
741 DEFINE_STATIC_STRING(AortaToRightArm);
742 DEFINE_STATIC_STRING(RightArmToVenaCava);
743 // Right Kidney
744 DEFINE_STATIC_STRING(AortaToRightKidney);
745 DEFINE_STATIC_STRING(RightKidneyToVenaCava);
746 // Right Leg
747 DEFINE_STATIC_STRING(AortaToRightLeg);
748 DEFINE_STATIC_STRING(RightLegToVenaCava);
749 // Skin
750 DEFINE_STATIC_STRING(AortaToSkin);
751 DEFINE_STATIC_STRING(SkinToVenaCava);
752 // Small Intestine
753 DEFINE_STATIC_STRING(AortaToSmallIntestine);
754 DEFINE_STATIC_STRING(SmallIntestineToLiver);
755 // Splanchnic
756 DEFINE_STATIC_STRING(AortaToSplanchnic);
757 DEFINE_STATIC_STRING(SplanchnicToLiver);
758 // Spleen
759 DEFINE_STATIC_STRING(AortaToSpleen);
760 DEFINE_STATIC_STRING(SpleenToLiver);
761
762 // Hemorrhage and IV
763 DEFINE_STATIC_STRING(VenaCavaIV);
764
765 // Vascular To Tissue Links
766 DEFINE_STATIC_STRING(BoneVascularToTissue);
767 DEFINE_STATIC_STRING(BrainVascularToTissue);
768 DEFINE_STATIC_STRING(FatVascularToTissue);
769 DEFINE_STATIC_STRING(SmallIntestineVascularToTissue);
770 DEFINE_STATIC_STRING(LargeIntestineVascularToTissue);
771 DEFINE_STATIC_STRING(SplanchnicVascularToTissue);
772 DEFINE_STATIC_STRING(LeftKidneyVascularToTissue);
773 DEFINE_STATIC_STRING(LeftLungVascularToTissue);
774 DEFINE_STATIC_STRING(LiverVascularToTissue);
775 DEFINE_STATIC_STRING(MuscleVascularToTissue);
776 DEFINE_STATIC_STRING(MyocardiumVascularToTissue);
777 DEFINE_STATIC_STRING(RightKidneyVascularToTissue);
778 DEFINE_STATIC_STRING(RightLungVascularToTissue);
779 DEFINE_STATIC_STRING(SkinVascularToTissue);
780 DEFINE_STATIC_STRING(SpleenVascularToTissue);
781
782 // Renal Links
783 // Reusing 'AortaToLeftKidney' to connect the Aorta To Left Renal Artery
784 DEFINE_STATIC_STRING(LeftRenalArteryToAfferentArteriole);
785 DEFINE_STATIC_STRING(LeftAfferentArterioleToGlomerularCapillaries);
786 DEFINE_STATIC_STRING(LeftGlomerularCapillariesToEfferentArteriole);
787 DEFINE_STATIC_STRING(LeftGlomerularCapillariesToBowmansCapsules);
788 DEFINE_STATIC_STRING(LeftBowmansCapsulesToTubules);
789 DEFINE_STATIC_STRING(LeftTubulesToPeritubularCapillaries);
790 DEFINE_STATIC_STRING(LeftEfferentArterioleToPeritubularCapillaries);
791 DEFINE_STATIC_STRING(LeftPeritubularCapillariesToRenalVein);
792 // Reusing 'LeftKidneyToVenaCava' to connect the Left Renal Vein To Vena Cava
793
794 // Reusing 'AortaToRightKidney' to connect the Aorta To Right Renal Artery
795 DEFINE_STATIC_STRING(RightRenalArteryToAfferentArteriole);
796 DEFINE_STATIC_STRING(RightAfferentArterioleToGlomerularCapillaries);
797 DEFINE_STATIC_STRING(RightGlomerularCapillariesToEfferentArteriole);
798 DEFINE_STATIC_STRING(RightGlomerularCapillariesToBowmansCapsules);
799 DEFINE_STATIC_STRING(RightBowmansCapsulesToTubules);
800 DEFINE_STATIC_STRING(RightTubulesToPeritubularCapillaries);
801 DEFINE_STATIC_STRING(RightEfferentArterioleToPeritubularCapillaries);
802 DEFINE_STATIC_STRING(RightPeritubularCapillariesToRenalVein);
803 // Reusing 'RightKidneyToVenaCava' to connect the Right Renal Vein To Vena Cava);
804
805
806 static const std::vector<std::string>& GetValues()
807 {
808 ScopedMutex lock;
809 if (_values.empty())
810 {
811 _values.push_back(VenaCavaToRightHeart);
812 _values.push_back(RightHeartToLeftPulmonaryArteries);
813 _values.push_back(LeftPulmonaryArteriesToCapillaries);
814 _values.push_back(LeftPulmonaryArteriesToVeins);
815 _values.push_back(LeftPulmonaryCapillariesToVeins);
816 _values.push_back(LeftPulmonaryVeinsLeak);
817 _values.push_back(LeftPulmonaryVeinsToLeftHeart);
818 _values.push_back(RightHeartToRightPulmonaryArteries);
819 _values.push_back(RightPulmonaryArteriesToCapillaries);
820 _values.push_back(RightPulmonaryArteriesToVeins);
821 _values.push_back(RightPulmonaryCapillariesToVeins);
822 _values.push_back(RightPulmonaryVeinsLeak);
823 _values.push_back(RightPulmonaryVeinsToLeftHeart);
824 _values.push_back(LeftHeartToAorta);
825 _values.push_back(AortaToBone);
826 _values.push_back(BoneToVenaCava);
827 _values.push_back(AortaToBrain);
828 _values.push_back(BrainToVenaCava);
829 _values.push_back(AortaToFat);
830 _values.push_back(FatToVenaCava);
831 _values.push_back(AortaToLargeIntestine);
832 _values.push_back(LargeIntestineToLiver);
833 _values.push_back(AortaToLeftArm);
834 _values.push_back(LeftArmToVenaCava);
835 _values.push_back(AortaToLeftKidney);
836 _values.push_back(LeftKidneyToVenaCava);
837 _values.push_back(AortaToLeftLeg);
838 _values.push_back(LeftLegToVenaCava);
839 _values.push_back(AortaToLiver);
840 _values.push_back(LiverToVenaCava);
841 _values.push_back(AortaToMuscle);
842 _values.push_back(MuscleToVenaCava);
843 _values.push_back(AortaToMyocardium);
844 _values.push_back(MyocardiumToVenaCava);
845 _values.push_back(AortaToRightArm);
846 _values.push_back(RightArmToVenaCava);
847 _values.push_back(AortaToRightKidney);
848 _values.push_back(RightKidneyToVenaCava);
849 _values.push_back(AortaToRightLeg);
850 _values.push_back(RightLegToVenaCava);
851 _values.push_back(AortaToSkin);
852 _values.push_back(SkinToVenaCava);
853 _values.push_back(AortaToSmallIntestine);
854 _values.push_back(SmallIntestineToLiver);
855 _values.push_back(AortaToSplanchnic);
856 _values.push_back(SplanchnicToLiver);
857 _values.push_back(AortaToSpleen);
858 _values.push_back(SpleenToLiver);
859
860 _values.push_back(BoneVascularToTissue);
861 _values.push_back(BrainVascularToTissue);
862 _values.push_back(FatVascularToTissue);
863 _values.push_back(SmallIntestineVascularToTissue);
864 _values.push_back(LargeIntestineVascularToTissue);
865 _values.push_back(SplanchnicVascularToTissue);
866 _values.push_back(LeftKidneyVascularToTissue);
867 _values.push_back(LeftLungVascularToTissue);
868 _values.push_back(LiverVascularToTissue);
869 _values.push_back(MuscleVascularToTissue);
870 _values.push_back(MyocardiumVascularToTissue);
871 _values.push_back(RightKidneyVascularToTissue);
872 _values.push_back(RightLungVascularToTissue);
873 _values.push_back(SkinVascularToTissue);
874 _values.push_back(SpleenVascularToTissue);
875
876 _values.push_back(LeftRenalArteryToAfferentArteriole);
877 _values.push_back(LeftAfferentArterioleToGlomerularCapillaries);
878 _values.push_back(LeftGlomerularCapillariesToEfferentArteriole);
879 _values.push_back(LeftGlomerularCapillariesToBowmansCapsules);
880 _values.push_back(LeftBowmansCapsulesToTubules);
881 _values.push_back(LeftTubulesToPeritubularCapillaries);
882 _values.push_back(LeftEfferentArterioleToPeritubularCapillaries);
883 _values.push_back(LeftPeritubularCapillariesToRenalVein);
884 _values.push_back(RightRenalArteryToAfferentArteriole);
885 _values.push_back(RightAfferentArterioleToGlomerularCapillaries);
886 _values.push_back(RightGlomerularCapillariesToEfferentArteriole);
887 _values.push_back(RightGlomerularCapillariesToBowmansCapsules);
888 _values.push_back(RightBowmansCapsulesToTubules);
889 _values.push_back(RightTubulesToPeritubularCapillaries);
890 _values.push_back(RightEfferentArterioleToPeritubularCapillaries);
891 _values.push_back(RightPeritubularCapillariesToRenalVein);
892 }
893 return _values;
894 }
895 static bool HasValue(const std::string& v)
896 {
897 return std::find(_values.begin(), _values.end(), v) != _values.end();
898 }
899 static void AddValue(const std::string& v)
900 {
901 if (!HasValue(v))
902 {
903 ScopedMutex lock;
904 _values.push_back(v);
905 }
906 }
907 protected:
908 static std::vector<std::string> _values;
909 };
910
911 class ExpandedVascularCompartment
912 {
913 public:
914 // Cardio
915 DEFINE_STATIC_STRING(Aorta);
916 DEFINE_STATIC_STRING(ArterialBuffer);
917 DEFINE_STATIC_STRING(Heart);
918 DEFINE_STATIC_STRING_EX(Myocardium, MyocardiumVasculature);
919 DEFINE_STATIC_STRING(LeftHeart);
920 DEFINE_STATIC_STRING(RightHeart);
921 DEFINE_STATIC_STRING(Pericardium);
922 DEFINE_STATIC_STRING(VenaCava);
923 DEFINE_STATIC_STRING(VenousBuffer);
924 // Pulmonary
925 DEFINE_STATIC_STRING(PulmonaryArteries);
926 DEFINE_STATIC_STRING(PulmonaryCapillaries);
927 DEFINE_STATIC_STRING(PulmonaryVeins);
928 DEFINE_STATIC_STRING_EX(Lungs, LungsVasculature);
929 DEFINE_STATIC_STRING_EX(LeftLung, LeftLungVasculature);
930 /***/DEFINE_STATIC_STRING(LeftPulmonaryArteries);
931 /***/DEFINE_STATIC_STRING(LeftPulmonaryCapillaries);
932 /***/DEFINE_STATIC_STRING(LeftPulmonaryVeins);
933 DEFINE_STATIC_STRING_EX(RightLung, RightLungVasculature);
934 /***/DEFINE_STATIC_STRING(RightPulmonaryArteries);
935 /***/DEFINE_STATIC_STRING(RightPulmonaryCapillaries);
936 /***/DEFINE_STATIC_STRING(RightPulmonaryVeins);
937 // Renal
938 DEFINE_STATIC_STRING_EX(Kidneys, KidneyVasculature);
939 DEFINE_STATIC_STRING_EX(LeftKidney, LeftKidneyVasculature);
940 /***/DEFINE_STATIC_STRING(LeftRenalArtery);
941 /***/DEFINE_STATIC_STRING(LeftNephron);
942 /*********/DEFINE_STATIC_STRING(LeftAfferentArteriole);
943 /*********/DEFINE_STATIC_STRING(LeftGlomerularCapillaries);
944 /*********/DEFINE_STATIC_STRING(LeftEfferentArteriole);
945 /*********/DEFINE_STATIC_STRING(LeftPeritubularCapillaries);
946 /*********/DEFINE_STATIC_STRING(LeftBowmansCapsules);
947 /*********/DEFINE_STATIC_STRING(LeftTubules);
948 /***/DEFINE_STATIC_STRING(LeftRenalVein);
949 DEFINE_STATIC_STRING_EX(RightKidney, RightKidneyVasculature);
950 /***/DEFINE_STATIC_STRING(RightRenalArtery);
951 /***/DEFINE_STATIC_STRING(RightNephron);
952 /*********/DEFINE_STATIC_STRING(RightAfferentArteriole);
953 /*********/DEFINE_STATIC_STRING(RightGlomerularCapillaries);
954 /*********/DEFINE_STATIC_STRING(RightEfferentArteriole);
955 /*********/DEFINE_STATIC_STRING(RightPeritubularCapillaries);
956 /*********/DEFINE_STATIC_STRING(RightBowmansCapsules);
957 /*********/DEFINE_STATIC_STRING(RightTubules);
958 /***/DEFINE_STATIC_STRING(RightRenalVein);
959 // General Organs and Periphery
960 DEFINE_STATIC_STRING_EX(Bone, BoneVasculature);
961 DEFINE_STATIC_STRING_EX(Head, HeadVasculature);
962 DEFINE_STATIC_STRING_EX(Extracranial, ExtracranialVasculature);
963 DEFINE_STATIC_STRING_EX(Intracranial, IntracranialVasculature);
964 DEFINE_STATIC_STRING_EX(Fat, FatVasculature);
965 DEFINE_STATIC_STRING_EX(Gut, GutVasculature);
966 DEFINE_STATIC_STRING_EX(Gut1, Gut1Vasculature);
967 DEFINE_STATIC_STRING_EX(Splanchnic, SplanchnicVasculature);
968 DEFINE_STATIC_STRING_EX(SmallIntestine, SmallIntestineVasculature);
969 DEFINE_STATIC_STRING_EX(LargeIntestine, LargeIntestineVasculature);
970 DEFINE_STATIC_STRING_EX(LeftArm, LeftArmVasculature);
971 DEFINE_STATIC_STRING_EX(LeftArmArterioles, LeftArmArteriolesVasculature);
972 DEFINE_STATIC_STRING_EX(LeftArmBone, LeftArmBoneVasculature);
973 DEFINE_STATIC_STRING_EX(LeftArmFat, LeftArmFatVasculature);
974 DEFINE_STATIC_STRING(LeftArmMicrovasculature);
975 DEFINE_STATIC_STRING_EX(LeftArmMuscle, LeftArmMuscleVasculature);
976 DEFINE_STATIC_STRING_EX(LeftArmSkin, LeftArmSkinVasculature);
977 DEFINE_STATIC_STRING_EX(LeftArmVenules, LeftArmVenulesVasculature);
978 DEFINE_STATIC_STRING_EX(LeftLeg, LeftLegVasculature);
979 DEFINE_STATIC_STRING_EX(LeftLegArterioles, LeftLegArteriolesVasculature);
980 DEFINE_STATIC_STRING_EX(LeftLegBone, LeftLegBoneVasculature);
981 DEFINE_STATIC_STRING_EX(LeftLegFat, LeftLegFatVasculature);
982 DEFINE_STATIC_STRING(LeftLegMicrovasculature);
983 DEFINE_STATIC_STRING_EX(LeftLegMuscle, LeftLegMuscleVasculature);
984 DEFINE_STATIC_STRING_EX(LeftLegSkin, LeftLegSkinVasculature);
985 DEFINE_STATIC_STRING_EX(LeftLegVenules, LeftLegVenulesVasculature);
986 DEFINE_STATIC_STRING_EX(Liver, LiverVasculature);
987 DEFINE_STATIC_STRING_EX(Muscle, MuscleVasculature);
988 DEFINE_STATIC_STRING_EX(RightArm, RightArmVasculature);
989 DEFINE_STATIC_STRING_EX(RightArmArterioles, RightArmArteriolesVasculature);
990 DEFINE_STATIC_STRING_EX(RightArmBone, RightArmBoneVasculature);
991 DEFINE_STATIC_STRING_EX(RightArmFat, RightArmFatVasculature);
992 DEFINE_STATIC_STRING(RightArmMicrovasculature);
993 DEFINE_STATIC_STRING_EX(RightArmMuscle, RightArmMuscleVasculature);
994 DEFINE_STATIC_STRING_EX(RightArmSkin, RightArmSkinVasculature);
995 DEFINE_STATIC_STRING_EX(RightArmVenules, RightArmVenulesVasculature);
996 DEFINE_STATIC_STRING_EX(RightLeg, RightLegVasculature);
997 DEFINE_STATIC_STRING_EX(RightLegArterioles, RightLegArteriolesVasculature);
998 DEFINE_STATIC_STRING_EX(RightLegBone, RightLegBoneVasculature);
999 DEFINE_STATIC_STRING_EX(RightLegFat, RightLegFatVasculature);
1000 DEFINE_STATIC_STRING(RightLegMicrovasculature);
1001 DEFINE_STATIC_STRING_EX(RightLegMuscle, RightLegMuscleVasculature);
1002 DEFINE_STATIC_STRING_EX(RightLegSkin, RightLegSkinVasculature);
1003 DEFINE_STATIC_STRING_EX(RightLegVenules, RightLegVenulesVasculature);
1004 DEFINE_STATIC_STRING_EX(Skin, SkinVasculature);
1005 DEFINE_STATIC_STRING_EX(Spleen, SpleenVasculature);
1006 DEFINE_STATIC_STRING_EX(Torso, TorsoVasculature);
1007 DEFINE_STATIC_STRING_EX(TorsoArterioles, TorsoArteriolesVasculature);
1008 DEFINE_STATIC_STRING_EX(TorsoBone, TorsoBoneVasculature);
1009 DEFINE_STATIC_STRING_EX(TorsoFat, TorsoFatVasculature);
1010 DEFINE_STATIC_STRING(TorsoMicrovasculature);
1011 DEFINE_STATIC_STRING_EX(TorsoMuscle, TorsoMuscleVasculature);
1012 DEFINE_STATIC_STRING_EX(TorsoSkin, TorsoSkinVasculature);
1013 DEFINE_STATIC_STRING_EX(TorsoVenules, TorsoVenulesVasculature);
1014 DEFINE_STATIC_STRING(Abdomen);
1015 DEFINE_STATIC_STRING(AbdominalCavity);
1016
1017 DEFINE_STATIC_STRING(Ground);
1018
1019
1020 static const std::vector<std::string>& GetValues()
1021 {
1022 ScopedMutex lock;
1023 if (_values.empty())
1024 {
1025 _values.push_back(Aorta);
1026 _values.push_back(ArterialBuffer);
1027 _values.push_back(Abdomen);
1028 _values.push_back(Heart);
1029 _values.push_back(Myocardium);
1030 _values.push_back(LeftHeart);
1031 _values.push_back(RightHeart);
1032 _values.push_back(Pericardium);
1033 _values.push_back(VenaCava);
1034 _values.push_back(VenousBuffer);
1035 _values.push_back(PulmonaryArteries);
1036 _values.push_back(PulmonaryCapillaries);
1037 _values.push_back(PulmonaryVeins);
1038 _values.push_back(Lungs);
1039 _values.push_back(LeftLung);
1040 _values.push_back(LeftPulmonaryArteries);
1041 _values.push_back(LeftPulmonaryCapillaries);
1042 _values.push_back(LeftPulmonaryVeins);
1043 _values.push_back(RightLung);
1044 _values.push_back(RightPulmonaryArteries);
1045 _values.push_back(RightPulmonaryCapillaries);
1046 _values.push_back(RightPulmonaryVeins);
1047 _values.push_back(Kidneys);
1048 _values.push_back(LeftKidney);
1049 _values.push_back(LeftRenalArtery);
1050 _values.push_back(LeftNephron);
1051 _values.push_back(LeftAfferentArteriole);
1052 _values.push_back(LeftGlomerularCapillaries);
1053 _values.push_back(LeftEfferentArteriole);
1054 _values.push_back(LeftPeritubularCapillaries);
1055 _values.push_back(LeftBowmansCapsules);
1056 _values.push_back(LeftTubules);
1057 _values.push_back(LeftRenalVein);
1058 _values.push_back(RightKidney);
1059 _values.push_back(RightRenalArtery);
1060 _values.push_back(RightNephron);
1061 _values.push_back(RightAfferentArteriole);
1062 _values.push_back(RightGlomerularCapillaries);
1063 _values.push_back(RightEfferentArteriole);
1064 _values.push_back(RightPeritubularCapillaries);
1065 _values.push_back(RightBowmansCapsules);
1066 _values.push_back(RightTubules);
1067 _values.push_back(RightRenalVein);
1068 _values.push_back(Bone);
1069 _values.push_back(Head);
1070 _values.push_back(Extracranial);
1071 _values.push_back(Intracranial);
1072 _values.push_back(Fat);
1073 _values.push_back(Gut);
1074 _values.push_back(Gut1);
1075 _values.push_back(Splanchnic);
1076 _values.push_back(SmallIntestine);
1077 _values.push_back(LargeIntestine);
1078 _values.push_back(Liver);
1079 _values.push_back(Spleen);
1080 _values.push_back(Skin);
1081 _values.push_back(Muscle);
1082 _values.push_back(LeftArm);
1083 _values.push_back(LeftArmArterioles);
1084 _values.push_back(LeftArmFat);
1085 _values.push_back(LeftArmMuscle);
1086 _values.push_back(LeftArmSkin);
1087 _values.push_back(LeftArmBone);
1088 _values.push_back(LeftArmMicrovasculature);
1089 _values.push_back(LeftArmVenules);
1090 _values.push_back(LeftLeg);
1091 _values.push_back(LeftLegArterioles);
1092 _values.push_back(LeftLegFat);
1093 _values.push_back(LeftLegMuscle);
1094 _values.push_back(LeftLegSkin);
1095 _values.push_back(LeftLegBone);
1096 _values.push_back(LeftLegMicrovasculature);
1097 _values.push_back(LeftLegVenules);
1098 _values.push_back(RightArm);
1099 _values.push_back(RightArmArterioles);
1100 _values.push_back(RightArmFat);
1101 _values.push_back(RightArmMuscle);
1102 _values.push_back(RightArmSkin);
1103 _values.push_back(RightArmBone);
1104 _values.push_back(RightArmMicrovasculature);
1105 _values.push_back(RightArmVenules);
1106 _values.push_back(RightLeg);
1107 _values.push_back(RightLegArterioles);
1108 _values.push_back(RightLegFat);
1109 _values.push_back(RightLegMuscle);
1110 _values.push_back(RightLegSkin);
1111 _values.push_back(RightLegBone);
1112 _values.push_back(RightLegMicrovasculature);
1113 _values.push_back(RightLegVenules);
1114 _values.push_back(Torso);
1115 _values.push_back(TorsoArterioles);
1116 _values.push_back(TorsoBone);
1117 _values.push_back(TorsoFat);
1118 _values.push_back(TorsoMicrovasculature);
1119 _values.push_back(TorsoMuscle);
1120 _values.push_back(TorsoSkin);
1121 _values.push_back(TorsoVenules);
1122 //_values.push_back(Ground);
1123 }
1124 return _values;
1125 }
1126 static bool HasValue(const std::string& v)
1127 {
1128 return std::find(_values.begin(), _values.end(), v) != _values.end();
1129 }
1130 static void AddValue(const std::string& v)
1131 {
1132 if (!HasValue(v))
1133 {
1134 ScopedMutex lock;
1135 _values.push_back(v);
1136 }
1137 }
1138 protected:
1139 static std::vector<std::string> _values;
1140 };
1141
1142 class ExpandedVascularLink
1143 {
1144 public:
1145 // Heart and Lungs
1146
1147 DEFINE_STATIC_STRING(VenousBufferToVenaCava);
1148 DEFINE_STATIC_STRING(VenaCavaToRightHeart);
1149 DEFINE_STATIC_STRING(RightHeartToLeftPulmonaryArteries);
1150 DEFINE_STATIC_STRING(LeftPulmonaryArteriesToCapillaries);
1151 DEFINE_STATIC_STRING(LeftPulmonaryArteriesToVeins);
1152 DEFINE_STATIC_STRING(LeftPulmonaryCapillariesToVeins);
1153 DEFINE_STATIC_STRING(LeftPulmonaryVeinsToLeftHeart);
1154 DEFINE_STATIC_STRING(RightHeartToRightPulmonaryArteries);
1155 DEFINE_STATIC_STRING(RightPulmonaryArteriesToCapillaries);
1156 DEFINE_STATIC_STRING(RightPulmonaryArteriesToVeins);
1157 DEFINE_STATIC_STRING(RightPulmonaryCapillariesToVeins);
1158 DEFINE_STATIC_STRING(RightPulmonaryVeinsToLeftHeart);
1159 DEFINE_STATIC_STRING(LeftHeartToAorta);
1160 DEFINE_STATIC_STRING(AortaToArterialBuffer);
1161 // Head
1162 DEFINE_STATIC_STRING(AortaToIntracranial);
1163 DEFINE_STATIC_STRING(IntracranialToVenaCava);
1164 DEFINE_STATIC_STRING(AortaToExtracranial);
1165 DEFINE_STATIC_STRING(ExtracranialToVenaCava);
1166 // Left Arm
1167 DEFINE_STATIC_STRING(AortaToLeftArmArterioles);
1168 DEFINE_STATIC_STRING(LeftArmArteriolesToLeftArmBone);
1169 DEFINE_STATIC_STRING(LeftArmArteriolesToLeftArmFat);
1170 DEFINE_STATIC_STRING(LeftArmArteriolesToLeftArmMicrovasculature);
1171 DEFINE_STATIC_STRING(LeftArmArteriolesToLeftArmMuscle);
1172 DEFINE_STATIC_STRING(LeftArmArteriolesToLeftArmSkin);
1173
1174 DEFINE_STATIC_STRING(LeftArmBoneToLeftArmVenules);
1175 DEFINE_STATIC_STRING(LeftArmFatToLeftArmVenules);
1176 DEFINE_STATIC_STRING(LeftArmMicrovasculatureToLeftArmVenules);
1177 DEFINE_STATIC_STRING(LeftArmMuscleToLeftArmVenules);
1178 DEFINE_STATIC_STRING(LeftArmSkinToLeftArmVenules);
1179 DEFINE_STATIC_STRING(LeftArmVenulesToVenaCava);
1180
1181 // Left Kidney
1182 DEFINE_STATIC_STRING(AortaToLeftKidney);
1183 DEFINE_STATIC_STRING(LeftKidneyToVenaCava);
1184 // Left Leg
1185 DEFINE_STATIC_STRING(AortaToLeftLegArterioles);
1186 DEFINE_STATIC_STRING(LeftLegArteriolesToLeftLegBone);
1187 DEFINE_STATIC_STRING(LeftLegArteriolesToLeftLegFat);
1188 DEFINE_STATIC_STRING(LeftLegArteriolesToLeftLegMicrovasculature);
1189 DEFINE_STATIC_STRING(LeftLegArteriolesToLeftLegMuscle);
1190 DEFINE_STATIC_STRING(LeftLegArteriolesToLeftLegSkin);
1191
1192 DEFINE_STATIC_STRING(LeftLegBoneToLeftLegVenules);
1193 DEFINE_STATIC_STRING(LeftLegFatToLeftLegVenules);
1194 DEFINE_STATIC_STRING(LeftLegMicrovasculatureToLeftLegVenules);
1195 DEFINE_STATIC_STRING(LeftLegMuscleToLeftLegVenules);
1196 DEFINE_STATIC_STRING(LeftLegSkinToLeftLegVenules);
1197 DEFINE_STATIC_STRING(LeftLegVenulesToVenaCava);
1198 // Gut
1199 DEFINE_STATIC_STRING(AortaToGut);
1201 DEFINE_STATIC_STRING(AortaToLargeIntestine);
1202 DEFINE_STATIC_STRING(LargeIntestineToLiver);
1204 DEFINE_STATIC_STRING(AortaToSmallIntestine);
1205 DEFINE_STATIC_STRING(SmallIntestineToLiver);
1207 DEFINE_STATIC_STRING(AortaToSplanchnic);
1208 DEFINE_STATIC_STRING(SplanchnicToLiver);
1210 DEFINE_STATIC_STRING(AortaToSpleen);
1211 DEFINE_STATIC_STRING(SpleenToLiver);
1213 DEFINE_STATIC_STRING(AortaToLiver);
1214 DEFINE_STATIC_STRING(LiverToVenaCava);
1215 // Myocardium
1216 DEFINE_STATIC_STRING(AortaToMyocardium);
1217 DEFINE_STATIC_STRING(MyocardiumToVenaCava);
1218 // Right Arm
1219 DEFINE_STATIC_STRING(AortaToRightArmArterioles);
1220 DEFINE_STATIC_STRING(RightArmArteriolesToRightArmBone);
1221 DEFINE_STATIC_STRING(RightArmArteriolesToRightArmFat);
1222 DEFINE_STATIC_STRING(RightArmArteriolesToRightArmMicrovasculature);
1223 DEFINE_STATIC_STRING(RightArmArteriolesToRightArmMuscle);
1224 DEFINE_STATIC_STRING(RightArmArteriolesToRightArmSkin);
1225
1226 DEFINE_STATIC_STRING(RightArmBoneToRightArmVenules);
1227 DEFINE_STATIC_STRING(RightArmFatToRightArmVenules);
1228 DEFINE_STATIC_STRING(RightArmMicrovasculatureToRightArmVenules);
1229 DEFINE_STATIC_STRING(RightArmMuscleToRightArmVenules);
1230 DEFINE_STATIC_STRING(RightArmSkinToRightArmVenules);
1231 DEFINE_STATIC_STRING(RightArmVenulesToVenaCava);
1232
1233 // Right Kidney
1234 DEFINE_STATIC_STRING(AortaToRightKidney);
1235 DEFINE_STATIC_STRING(RightKidneyToVenaCava);
1236 // Right Leg
1237 DEFINE_STATIC_STRING(AortaToRightLegArterioles);
1238 DEFINE_STATIC_STRING(RightLegArteriolesToRightLegBone);
1239 DEFINE_STATIC_STRING(RightLegArteriolesToRightLegFat);
1240 DEFINE_STATIC_STRING(RightLegArteriolesToRightLegMicrovasculature);
1241 DEFINE_STATIC_STRING(RightLegArteriolesToRightLegMuscle);
1242 DEFINE_STATIC_STRING(RightLegArteriolesToRightLegSkin);
1243
1244 DEFINE_STATIC_STRING(RightLegBoneToRightLegVenules);
1245 DEFINE_STATIC_STRING(RightLegFatToRightLegVenules);
1246 DEFINE_STATIC_STRING(RightLegMicrovasculatureToRightLegVenules);
1247 DEFINE_STATIC_STRING(RightLegMuscleToRightLegVenules);
1248 DEFINE_STATIC_STRING(RightLegSkinToRightLegVenules);
1249 DEFINE_STATIC_STRING(RightLegVenulesToVenaCava);
1250
1251 // Torso
1252 DEFINE_STATIC_STRING(AortaToTorsoArterioles);
1253 DEFINE_STATIC_STRING(TorsoArteriolesToTorsoBone);
1254 DEFINE_STATIC_STRING(TorsoArteriolesToTorsoFat);
1255 DEFINE_STATIC_STRING(TorsoArteriolesToTorsoMicrovasculature);
1256 DEFINE_STATIC_STRING(TorsoArteriolesToTorsoMuscle);
1257 DEFINE_STATIC_STRING(TorsoArteriolesToTorsoSkin);
1258
1259 DEFINE_STATIC_STRING(TorsoSkinToTorsoVenules);
1260 DEFINE_STATIC_STRING(TorsoMuscleToTorsoVenules);
1261 DEFINE_STATIC_STRING(TorsoMicrovasculatureToTorsoVenules);
1262 DEFINE_STATIC_STRING(TorsoFatToTorsoVenules);
1263 DEFINE_STATIC_STRING(TorsoBoneToTorsoVenules);
1264 DEFINE_STATIC_STRING(TorsoVenulesToVenaCava);
1265 // Hemorrhage and IV
1266 DEFINE_STATIC_STRING(VenaCavaIV);
1267
1268 // Vascular To Tissue Links
1269 DEFINE_STATIC_STRING(TorsoBoneVascularToTissue);
1270 DEFINE_STATIC_STRING(LeftArmBoneVascularToTissue);
1271 DEFINE_STATIC_STRING(LeftLegBoneVascularToTissue);
1272 DEFINE_STATIC_STRING(RightArmBoneVascularToTissue);
1273 DEFINE_STATIC_STRING(RightLegBoneVascularToTissue);
1274 DEFINE_STATIC_STRING(BrainVascularToTissue);
1275 DEFINE_STATIC_STRING(TorsoFatVascularToTissue);
1276 DEFINE_STATIC_STRING(LeftArmFatVascularToTissue);
1277 DEFINE_STATIC_STRING(LeftLegFatVascularToTissue);
1278 DEFINE_STATIC_STRING(RightArmFatVascularToTissue);
1279 DEFINE_STATIC_STRING(RightLegFatVascularToTissue);
1280 DEFINE_STATIC_STRING(SmallIntestineVascularToTissue);
1281 DEFINE_STATIC_STRING(LargeIntestineVascularToTissue);
1282 DEFINE_STATIC_STRING(SplanchnicVascularToTissue);
1283 DEFINE_STATIC_STRING(LeftKidneyVascularToTissue);
1284 DEFINE_STATIC_STRING(LeftLungVascularToTissue);
1285 DEFINE_STATIC_STRING(LiverVascularToTissue);
1286 DEFINE_STATIC_STRING(TorsoMuscleVascularToTissue);
1287 DEFINE_STATIC_STRING(LeftArmMuscleVascularToTissue);
1288 DEFINE_STATIC_STRING(LeftLegMuscleVascularToTissue);
1289 DEFINE_STATIC_STRING(RightArmMuscleVascularToTissue);
1290 DEFINE_STATIC_STRING(RightLegMuscleVascularToTissue);
1291 DEFINE_STATIC_STRING(MyocardiumVascularToTissue);
1292 DEFINE_STATIC_STRING(RightKidneyVascularToTissue);
1293 DEFINE_STATIC_STRING(RightLungVascularToTissue);
1294 DEFINE_STATIC_STRING(TorsoSkinVascularToTissue);
1295 DEFINE_STATIC_STRING(LeftArmSkinVascularToTissue);
1296 DEFINE_STATIC_STRING(LeftLegSkinVascularToTissue);
1297 DEFINE_STATIC_STRING(RightArmSkinVascularToTissue);
1298 DEFINE_STATIC_STRING(RightLegSkinVascularToTissue);
1299 DEFINE_STATIC_STRING(SpleenVascularToTissue);
1300
1301 // Renal Links
1302 // Reusing 'AortaToLeftKidney' to connect the Aorta To Left Renal Artery
1303 DEFINE_STATIC_STRING(LeftRenalArteryToAfferentArteriole);
1304 DEFINE_STATIC_STRING(LeftAfferentArterioleToGlomerularCapillaries);
1305 DEFINE_STATIC_STRING(LeftGlomerularCapillariesToEfferentArteriole);
1306 DEFINE_STATIC_STRING(LeftGlomerularCapillariesToBowmansCapsules);
1307 DEFINE_STATIC_STRING(LeftBowmansCapsulesToTubules);
1308 DEFINE_STATIC_STRING(LeftTubulesToPeritubularCapillaries);
1309 DEFINE_STATIC_STRING(LeftEfferentArterioleToPeritubularCapillaries);
1310 DEFINE_STATIC_STRING(LeftPeritubularCapillariesToRenalVein);
1311 // Reusing 'LeftKidneyToVenaCava' to connect the Left Renal Vein To Vena Cava
1312
1313 // Reusing 'AortaToRightKidney' to connect the Aorta To Right Renal Artery
1314 DEFINE_STATIC_STRING(RightRenalArteryToAfferentArteriole);
1315 DEFINE_STATIC_STRING(RightAfferentArterioleToGlomerularCapillaries);
1316 DEFINE_STATIC_STRING(RightGlomerularCapillariesToEfferentArteriole);
1317 DEFINE_STATIC_STRING(RightGlomerularCapillariesToBowmansCapsules);
1318 DEFINE_STATIC_STRING(RightBowmansCapsulesToTubules);
1319 DEFINE_STATIC_STRING(RightTubulesToPeritubularCapillaries);
1320 DEFINE_STATIC_STRING(RightEfferentArterioleToPeritubularCapillaries);
1321 DEFINE_STATIC_STRING(RightPeritubularCapillariesToRenalVein);
1322 // Reusing 'RightKidneyToVenaCava' to connect the Right Renal Vein To Vena Cava);
1323
1324
1325 static const std::vector<std::string>& GetValues()
1326 {
1327 ScopedMutex lock;
1328 if (_values.empty())
1329 {
1330 _values.push_back(VenaCavaToRightHeart);
1331 _values.push_back(RightHeartToLeftPulmonaryArteries);
1332 _values.push_back(LeftPulmonaryArteriesToCapillaries);
1333 _values.push_back(LeftPulmonaryArteriesToVeins);
1334 _values.push_back(LeftPulmonaryCapillariesToVeins);
1335 _values.push_back(LeftPulmonaryVeinsToLeftHeart);
1336 _values.push_back(RightHeartToRightPulmonaryArteries);
1337 _values.push_back(RightPulmonaryArteriesToCapillaries);
1338 _values.push_back(RightPulmonaryArteriesToVeins);
1339 _values.push_back(RightPulmonaryCapillariesToVeins);
1340 _values.push_back(RightPulmonaryVeinsToLeftHeart);
1341 _values.push_back(LeftHeartToAorta);
1342 _values.push_back(AortaToIntracranial);
1343 _values.push_back(IntracranialToVenaCava);
1344 _values.push_back(AortaToExtracranial);
1345 _values.push_back(ExtracranialToVenaCava);
1346 _values.push_back(AortaToLargeIntestine);
1347 _values.push_back(LargeIntestineToLiver);
1348 _values.push_back(LeftArmArteriolesToLeftArmBone);
1349 _values.push_back(LeftArmArteriolesToLeftArmFat);
1350 _values.push_back(LeftArmArteriolesToLeftArmMicrovasculature);
1351 _values.push_back(LeftArmArteriolesToLeftArmMuscle);
1352 _values.push_back(LeftArmArteriolesToLeftArmSkin);
1353
1354 _values.push_back(AortaToLeftKidney);
1355 _values.push_back(LeftKidneyToVenaCava);
1356 _values.push_back(LeftLegArteriolesToLeftLegBone);
1357 _values.push_back(LeftLegArteriolesToLeftLegFat);
1358 _values.push_back(LeftLegArteriolesToLeftLegMicrovasculature);
1359 _values.push_back(LeftLegArteriolesToLeftLegMuscle);
1360 _values.push_back(LeftLegArteriolesToLeftLegSkin);
1361 _values.push_back(AortaToLiver);
1362 _values.push_back(LiverToVenaCava);
1363 _values.push_back(AortaToMyocardium);
1364 _values.push_back(MyocardiumToVenaCava);
1365 _values.push_back(RightArmArteriolesToRightArmBone);
1366 _values.push_back(RightArmArteriolesToRightArmFat);
1367 _values.push_back(RightArmArteriolesToRightArmMicrovasculature);
1368 _values.push_back(RightArmArteriolesToRightArmMuscle);
1369 _values.push_back(RightArmArteriolesToRightArmSkin);
1370
1371 _values.push_back(AortaToRightKidney);
1372 _values.push_back(RightKidneyToVenaCava);
1373 _values.push_back(RightLegArteriolesToRightLegBone);
1374 _values.push_back(RightLegArteriolesToRightLegFat);
1375 _values.push_back(RightLegArteriolesToRightLegMicrovasculature);
1376 _values.push_back(RightLegArteriolesToRightLegMuscle);
1377 _values.push_back(RightLegArteriolesToRightLegSkin);
1378
1379
1380
1381 _values.push_back(AortaToSmallIntestine);
1382 _values.push_back(SmallIntestineToLiver);
1383 _values.push_back(AortaToSplanchnic);
1384 _values.push_back(SplanchnicToLiver);
1385 _values.push_back(AortaToSpleen);
1386 _values.push_back(SpleenToLiver);
1387 _values.push_back(AortaToTorsoArterioles);
1388 _values.push_back(TorsoArteriolesToTorsoBone);
1389 _values.push_back(TorsoArteriolesToTorsoFat);
1390 _values.push_back(TorsoArteriolesToTorsoMicrovasculature);
1391 _values.push_back(TorsoArteriolesToTorsoMuscle);
1392 _values.push_back(TorsoArteriolesToTorsoSkin);
1393
1394 _values.push_back(RightArmBoneToRightArmVenules);
1395 _values.push_back(RightArmFatToRightArmVenules);
1396 _values.push_back(RightArmMicrovasculatureToRightArmVenules);
1397 _values.push_back(RightArmMuscleToRightArmVenules);
1398 _values.push_back(RightArmSkinToRightArmVenules);
1399 _values.push_back(RightLegBoneToRightLegVenules);
1400 _values.push_back(RightLegFatToRightLegVenules);
1401 _values.push_back(RightLegMicrovasculatureToRightLegVenules);
1402 _values.push_back(RightLegMuscleToRightLegVenules);
1403 _values.push_back(RightLegSkinToRightLegVenules);
1404 _values.push_back(LeftArmBoneToLeftArmVenules);
1405 _values.push_back(LeftArmFatToLeftArmVenules);
1406 _values.push_back(LeftArmMicrovasculatureToLeftArmVenules);
1407 _values.push_back(LeftArmMuscleToLeftArmVenules);
1408 _values.push_back(LeftArmSkinToLeftArmVenules);
1409 _values.push_back(LeftLegBoneToLeftLegVenules);
1410 _values.push_back(LeftLegFatToLeftLegVenules);
1411 _values.push_back(LeftLegMicrovasculatureToLeftLegVenules);
1412 _values.push_back(LeftLegMuscleToLeftLegVenules);
1413 _values.push_back(LeftLegSkinToLeftLegVenules);
1414 _values.push_back(TorsoSkinToTorsoVenules);
1415 _values.push_back(TorsoMuscleToTorsoVenules);
1416 _values.push_back(TorsoMicrovasculatureToTorsoVenules);
1417 _values.push_back(TorsoFatToTorsoVenules);
1418 _values.push_back(TorsoBoneToTorsoVenules);
1419 _values.push_back(TorsoVenulesToVenaCava);
1420
1421
1422 _values.push_back(TorsoBoneVascularToTissue);
1423 _values.push_back(LeftArmBoneVascularToTissue);
1424 _values.push_back(LeftLegBoneVascularToTissue);
1425 _values.push_back(RightArmBoneVascularToTissue);
1426 _values.push_back(RightLegBoneVascularToTissue);
1427 _values.push_back(BrainVascularToTissue);
1428 _values.push_back(TorsoFatVascularToTissue);
1429 _values.push_back(LeftArmFatVascularToTissue);
1430 _values.push_back(LeftLegFatVascularToTissue);
1431 _values.push_back(RightArmFatVascularToTissue);
1432 _values.push_back(RightLegFatVascularToTissue);
1433 _values.push_back(SmallIntestineVascularToTissue);
1434 _values.push_back(LargeIntestineVascularToTissue);
1435 _values.push_back(SplanchnicVascularToTissue);
1436 _values.push_back(LeftKidneyVascularToTissue);
1437 _values.push_back(LeftLungVascularToTissue);
1438 _values.push_back(LiverVascularToTissue);
1439 _values.push_back(TorsoMuscleVascularToTissue);
1440 _values.push_back(LeftArmMuscleVascularToTissue);
1441 _values.push_back(LeftLegMuscleVascularToTissue);
1442 _values.push_back(RightArmMuscleVascularToTissue);
1443 _values.push_back(RightLegMuscleVascularToTissue);
1444 _values.push_back(MyocardiumVascularToTissue);
1445 _values.push_back(RightKidneyVascularToTissue);
1446 _values.push_back(RightLungVascularToTissue);
1447 _values.push_back(TorsoSkinVascularToTissue);
1448 _values.push_back(LeftArmSkinVascularToTissue);
1449 _values.push_back(LeftLegSkinVascularToTissue);
1450 _values.push_back(RightArmSkinVascularToTissue);
1451 _values.push_back(RightLegSkinVascularToTissue);
1452 _values.push_back(SpleenVascularToTissue);
1453
1454 _values.push_back(LeftRenalArteryToAfferentArteriole);
1455 _values.push_back(LeftAfferentArterioleToGlomerularCapillaries);
1456 _values.push_back(LeftGlomerularCapillariesToEfferentArteriole);
1457 _values.push_back(LeftGlomerularCapillariesToBowmansCapsules);
1458 _values.push_back(LeftBowmansCapsulesToTubules);
1459 _values.push_back(LeftTubulesToPeritubularCapillaries);
1460 _values.push_back(LeftEfferentArterioleToPeritubularCapillaries);
1461 _values.push_back(LeftPeritubularCapillariesToRenalVein);
1462 _values.push_back(RightRenalArteryToAfferentArteriole);
1463 _values.push_back(RightAfferentArterioleToGlomerularCapillaries);
1464 _values.push_back(RightGlomerularCapillariesToEfferentArteriole);
1465 _values.push_back(RightGlomerularCapillariesToBowmansCapsules);
1466 _values.push_back(RightBowmansCapsulesToTubules);
1467 _values.push_back(RightTubulesToPeritubularCapillaries);
1468 _values.push_back(RightEfferentArterioleToPeritubularCapillaries);
1469 _values.push_back(RightPeritubularCapillariesToRenalVein);
1470 }
1471 return _values;
1472 }
1473 static bool HasValue(const std::string& v)
1474 {
1475 return std::find(_values.begin(), _values.end(), v) != _values.end();
1476 }
1477 static void AddValue(const std::string& v)
1478 {
1479 if (!HasValue(v))
1480 {
1481 ScopedMutex lock;
1482 _values.push_back(v);
1483 }
1484 }
1485 protected:
1486 static std::vector<std::string> _values;
1487 };
1488
1489
1490 class UrineCompartment
1491 {
1492 public:
1493 DEFINE_STATIC_STRING(Ureters);
1494 /*****/DEFINE_STATIC_STRING(LeftUreter);
1495 /*****/DEFINE_STATIC_STRING(RightUreter);
1496 DEFINE_STATIC_STRING(Bladder);
1497
1498 static const std::vector<std::string>& GetValues()
1499 {
1500 ScopedMutex lock;
1501 if (_values.empty())
1502 {
1503 _values.push_back(Ureters);
1504 _values.push_back(LeftUreter);
1505 _values.push_back(RightUreter);
1506 _values.push_back(Bladder);
1507 }
1508 return _values;
1509 }
1510 static bool HasValue(const std::string& v)
1511 {
1512 return std::find(_values.begin(), _values.end(), v) != _values.end();
1513 }
1514 static void AddValue(const std::string& v)
1515 {
1516 if (!HasValue(v))
1517 {
1518 ScopedMutex lock;
1519 _values.push_back(v);
1520 }
1521 }
1522 protected:
1523 static std::vector<std::string> _values;
1524 };
1525
1526 class UrineLink
1527 {
1528 public:
1529 DEFINE_STATIC_STRING(LeftTubulesToUreter);
1530 DEFINE_STATIC_STRING(LeftUreterToBladder);
1531
1532 DEFINE_STATIC_STRING(RightTubulesToUreter);
1533 DEFINE_STATIC_STRING(RightUreterToBladder);
1534
1535 DEFINE_STATIC_STRING(BladderToGround);
1536 DEFINE_STATIC_STRING(BladderToGroundSource);
1537
1538 static const std::vector<std::string>& GetValues()
1539 {
1540 ScopedMutex lock;
1541 if (_values.empty())
1542 {
1543 _values.push_back(LeftTubulesToUreter);
1544 _values.push_back(LeftUreterToBladder);
1545 _values.push_back(RightTubulesToUreter);
1546 _values.push_back(RightUreterToBladder);
1547 _values.push_back(BladderToGround);
1548 _values.push_back(BladderToGroundSource);
1549 }
1550 return _values;
1551 }
1552 static bool HasValue(const std::string& v)
1553 {
1554 return std::find(_values.begin(), _values.end(), v) != _values.end();
1555 }
1556 static void AddValue(const std::string& v)
1557 {
1558 if (!HasValue(v))
1559 {
1560 ScopedMutex lock;
1561 _values.push_back(v);
1562 }
1563 }
1564 protected:
1565 static std::vector<std::string> _values;
1566 };
1567
1568 class LymphCompartment
1569 {
1570 public:
1571 DEFINE_STATIC_STRING(Lymph);
1572
1573 static const std::vector<std::string>& GetValues()
1574 {
1575 ScopedMutex lock;
1576 if (_values.empty())
1577 {
1578 _values.push_back(Lymph);
1579 }
1580 return _values;
1581 }
1582 static bool HasValue(const std::string& v)
1583 {
1584 return std::find(_values.begin(), _values.end(), v) != _values.end();
1585 }
1586 static void AddValue(const std::string& v)
1587 {
1588 if (!HasValue(v))
1589 {
1590 ScopedMutex lock;
1591 _values.push_back(v);
1592 }
1593 }
1594 protected:
1595 static std::vector<std::string> _values;
1596 };
1597
1598 class LymphLink
1599 {
1600 public:
1601 DEFINE_STATIC_STRING(BoneTissueToLymph);
1602 DEFINE_STATIC_STRING(BrainTissueToLymph);
1603 DEFINE_STATIC_STRING(FatTissueToLymph);
1604 DEFINE_STATIC_STRING(GutTissueToLymph);
1605 DEFINE_STATIC_STRING(LeftKidneyTissueToLymph);
1606 DEFINE_STATIC_STRING(LeftLungTissueToLymph);
1607 DEFINE_STATIC_STRING(LiverTissueToLymph);
1608 DEFINE_STATIC_STRING(MuscleTissueToLymph);
1609 DEFINE_STATIC_STRING(MyocardiumTissueToLymph);
1610 DEFINE_STATIC_STRING(RightKidneyTissueToLymph);
1611 DEFINE_STATIC_STRING(RightLungTissueToLymph);
1612 DEFINE_STATIC_STRING(SkinTissueToLymph);
1613 DEFINE_STATIC_STRING(SpleenTissueToLymph);
1614
1615 DEFINE_STATIC_STRING(LymphToVenaCava);
1616
1617 static const std::vector<std::string>& GetValues()
1618 {
1619 ScopedMutex lock;
1620 if (_values.empty())
1621 {
1622 _values.push_back(BoneTissueToLymph);
1623 _values.push_back(BrainTissueToLymph);
1624 _values.push_back(FatTissueToLymph);
1625 _values.push_back(GutTissueToLymph);
1626 _values.push_back(LeftKidneyTissueToLymph);
1627 _values.push_back(LeftLungTissueToLymph);
1628 _values.push_back(LiverTissueToLymph);
1629 _values.push_back(MuscleTissueToLymph);
1630 _values.push_back(MyocardiumTissueToLymph);
1631 _values.push_back(RightKidneyTissueToLymph);
1632 _values.push_back(RightLungTissueToLymph);
1633 _values.push_back(SkinTissueToLymph);
1634 _values.push_back(SpleenTissueToLymph);
1635 _values.push_back(LymphToVenaCava);
1636 }
1637 return _values;
1638 }
1639 static bool HasValue(const std::string& v)
1640 {
1641 return std::find(_values.begin(), _values.end(), v) != _values.end();
1642 }
1643 static void AddValue(const std::string& v)
1644 {
1645 if (!HasValue(v))
1646 {
1647 ScopedMutex lock;
1648 _values.push_back(v);
1649 }
1650 }
1651 protected:
1652 static std::vector<std::string> _values;
1653 };
1654
1655 class TemperatureCompartment
1656 {
1657 public:
1658 DEFINE_STATIC_STRING(Active);
1659 DEFINE_STATIC_STRING(Ambient);
1660 DEFINE_STATIC_STRING(Clothing);
1661 DEFINE_STATIC_STRING(Enclosure);
1662 DEFINE_STATIC_STRING(ExternalCore);
1663 DEFINE_STATIC_STRING(ExternalSkin);
1664 DEFINE_STATIC_STRING(ExternalGround);
1665 DEFINE_STATIC_STRING(InternalCore);
1666 DEFINE_STATIC_STRING(InternalSkin);
1667 DEFINE_STATIC_STRING(InternalGround);
1668
1669 static const std::vector<std::string>& GetValues()
1670 {
1671 ScopedMutex lock;
1672 if (_values.empty())
1673 {
1674 _values.push_back(Active);
1675 _values.push_back(Ambient);
1676 _values.push_back(Clothing);
1677 _values.push_back(Enclosure);
1678 _values.push_back(ExternalCore);
1679 _values.push_back(ExternalSkin);
1680 _values.push_back(ExternalGround);
1681 _values.push_back(InternalCore);
1682 _values.push_back(InternalSkin);
1683 _values.push_back(InternalGround);
1684 }
1685 return _values;
1686 }
1687 static bool HasValue(const std::string& v)
1688 {
1689 return std::find(_values.begin(), _values.end(), v) != _values.end();
1690 }
1691 static void AddValue(const std::string& v)
1692 {
1693 if (!HasValue(v))
1694 {
1695 ScopedMutex lock;
1696 _values.push_back(v);
1697 }
1698 }
1699 protected:
1700 static std::vector<std::string> _values;
1701 };
1702
1703 class TemperatureLink
1704 {
1705 public:
1706
1707 DEFINE_STATIC_STRING(ActiveToClothing);
1708 DEFINE_STATIC_STRING(ClothingToEnclosure);
1709 DEFINE_STATIC_STRING(ClothingToEnvironment);
1710 DEFINE_STATIC_STRING(ExternalCoreToGround);
1711 DEFINE_STATIC_STRING(GroundToActive);
1712 DEFINE_STATIC_STRING(GroundToClothing);
1713 DEFINE_STATIC_STRING(GroundToEnclosure);
1714 DEFINE_STATIC_STRING(GroundToEnvironment);
1715 DEFINE_STATIC_STRING(ExternalSkinToGround);
1716 DEFINE_STATIC_STRING(ExternalSkinToClothing);
1717 DEFINE_STATIC_STRING(GroundToInternalCore);
1718 DEFINE_STATIC_STRING(InternalCoreToInternalSkin);
1719 DEFINE_STATIC_STRING(InternalCoreToGround);
1720 DEFINE_STATIC_STRING(InternalSkinToGround);
1721 DEFINE_STATIC_STRING(InternalCoreToExternalCore);
1722 DEFINE_STATIC_STRING(InternalSkinToExternalSkin);
1723
1724 static const std::vector<std::string>& GetValues()
1725 {
1726 ScopedMutex lock;
1727 if (_values.empty())
1728 {
1729 _values.push_back(ActiveToClothing);
1730 _values.push_back(ClothingToEnclosure);
1731 _values.push_back(ClothingToEnvironment);
1732 _values.push_back(ExternalCoreToGround);
1733 _values.push_back(GroundToActive);
1734 _values.push_back(GroundToClothing);
1735 _values.push_back(GroundToEnclosure);
1736 _values.push_back(GroundToEnvironment);
1737 _values.push_back(ExternalSkinToGround);
1738 _values.push_back(ExternalSkinToClothing);
1739 _values.push_back(GroundToInternalCore);
1740 _values.push_back(InternalCoreToInternalSkin);
1741 _values.push_back(InternalCoreToGround);
1742 _values.push_back(InternalSkinToGround);
1743 _values.push_back(InternalCoreToExternalCore);
1744 _values.push_back(InternalSkinToExternalSkin);
1745 }
1746 return _values;
1747 }
1748 static bool HasValue(const std::string& v)
1749 {
1750 return std::find(_values.begin(), _values.end(), v) != _values.end();
1751 }
1752 static void AddValue(const std::string& v)
1753 {
1754 if (!HasValue(v))
1755 {
1756 ScopedMutex lock;
1757 _values.push_back(v);
1758 }
1759 }
1760 protected:
1761 static std::vector<std::string> _values;
1762 };
1763
1764 class EnvironmentCompartment
1765 {
1766 public:
1767 DEFINE_STATIC_STRING(Ambient);
1768
1769 static const std::vector<std::string>& GetValues()
1770 {
1771 ScopedMutex lock;
1772 if (_values.empty())
1773 {
1774 _values.push_back(Ambient);
1775 }
1776 return _values;
1777 }
1778 static bool HasValue(const std::string& v)
1779 {
1780 return std::find(_values.begin(), _values.end(), v) != _values.end();
1781 }
1782 static void AddValue(const std::string& v)
1783 {
1784 if (!HasValue(v))
1785 {
1786 ScopedMutex lock;
1787 _values.push_back(v);
1788 }
1789 }
1790 protected:
1791 static std::vector<std::string> _values;
1792 };
1793
1794 class AnesthesiaMachineCompartment
1795 {
1796 public:
1797 DEFINE_STATIC_STRING_EX(Connection, AnesthesiaMachineConnection);
1798 DEFINE_STATIC_STRING_EX(ExpiratoryLimb, AnesthesiaMachineExpiratoryLimb);
1799 DEFINE_STATIC_STRING_EX(GasInlet, AnesthesiaMachineGasInlet);
1800 DEFINE_STATIC_STRING_EX(GasSource, AnesthesiaMachineGasSource);
1801 DEFINE_STATIC_STRING_EX(InspiratoryLimb, AnesthesiaMachineInspiratoryLimb);
1802 DEFINE_STATIC_STRING_EX(ReliefValve, AnesthesiaMachineReliefValve);
1803 DEFINE_STATIC_STRING_EX(Scrubber, AnesthesiaMachineScrubber);
1804 DEFINE_STATIC_STRING_EX(Selector, AnesthesiaMachineSelector);
1805 DEFINE_STATIC_STRING_EX(Ventilator, AnesthesiaMachineVentilator);
1806 DEFINE_STATIC_STRING_EX(YPiece, AnesthesiaMachineYPiece);
1807
1808 static const std::vector<std::string>& GetValues()
1809 {
1810 ScopedMutex lock;
1811 if (_values.empty())
1812 {
1813 _values.push_back(Connection);
1814 _values.push_back(ExpiratoryLimb);
1815 _values.push_back(GasInlet);
1816 _values.push_back(GasSource);
1817 _values.push_back(InspiratoryLimb);
1818 _values.push_back(ReliefValve);
1819 _values.push_back(Scrubber);
1820 _values.push_back(Selector);
1821 _values.push_back(Ventilator);
1822 _values.push_back(YPiece);
1823 }
1824 return _values;
1825 }
1826 static bool HasValue(const std::string& v)
1827 {
1828 return std::find(_values.begin(), _values.end(), v) != _values.end();
1829 }
1830 static void AddValue(const std::string& v)
1831 {
1832 if (!HasValue(v))
1833 {
1834 ScopedMutex lock;
1835 _values.push_back(v);
1836 }
1837 }
1838 protected:
1839 static std::vector<std::string> _values;
1840 };
1841
1842 class AnesthesiaMachineLink
1843 {
1844 public:
1845 DEFINE_STATIC_STRING_EX(EnvironmentToReliefValve, EnvironmentToAnesthesiaMachineReliefValve);
1846 DEFINE_STATIC_STRING_EX(VentilatorToSelector, AnesthesiaMachineVentilatorToSelector);
1847 DEFINE_STATIC_STRING_EX(SelectorToReliefValve, AnesthesiaMachineSelectorToReliefValve);
1848 DEFINE_STATIC_STRING_EX(SelectorToScrubber, AnesthesiaMachineSelectorToScrubber);
1849 DEFINE_STATIC_STRING_EX(ScrubberToGasInlet, AnesthesiaMachineScrubberToGasInlet);
1850 DEFINE_STATIC_STRING_EX(GasSourceToGasInlet, AnesthesiaMachineGasSourceToGasInlet);
1851 DEFINE_STATIC_STRING_EX(GasInletToInspiratoryLimb, AnesthesiaMachineGasInletToInspiratoryLimb);
1852 DEFINE_STATIC_STRING_EX(InspiratoryLimbToYPiece, AnesthesiaMachineInspiratoryLimbToYPiece);
1853 DEFINE_STATIC_STRING_EX(YPieceToExpiratoryLimb, AnesthesiaMachineYPieceToExpiratoryLimb);
1854 DEFINE_STATIC_STRING_EX(ExpiratoryLimbToSelector, AnesthesiaMachineExpiratoryLimbToSelector);
1855 DEFINE_STATIC_STRING_EX(YPieceToConnection, AnesthesiaMachineYPieceToConnection);
1856 DEFINE_STATIC_STRING_EX(ConnectionLeak, AnesthesiaMachineConnectionLeak);
1857 DEFINE_STATIC_STRING_EX(ConnectionToAirway, AnesthesiaMachineConnectionToAirway);
1858
1859 static const std::vector<std::string>& GetValues()
1860 {
1861 ScopedMutex lock;
1862 if (_values.empty())
1863 {
1864 _values.push_back(EnvironmentToReliefValve);
1865 _values.push_back(VentilatorToSelector);
1866 _values.push_back(SelectorToReliefValve);
1867 _values.push_back(SelectorToScrubber);
1868 _values.push_back(ScrubberToGasInlet);
1869 _values.push_back(GasSourceToGasInlet);
1870 _values.push_back(GasInletToInspiratoryLimb);
1871 _values.push_back(InspiratoryLimbToYPiece);
1872 _values.push_back(YPieceToExpiratoryLimb);
1873 _values.push_back(ExpiratoryLimbToSelector);
1874 _values.push_back(YPieceToConnection);
1875 _values.push_back(ConnectionLeak);
1876 _values.push_back(ConnectionToAirway);
1877 }
1878 return _values;
1879 }
1880 static bool HasValue(const std::string& v)
1881 {
1882 return std::find(_values.begin(), _values.end(), v) != _values.end();
1883 }
1884 static void AddValue(const std::string& v)
1885 {
1886 if (!HasValue(v))
1887 {
1888 ScopedMutex lock;
1889 _values.push_back(v);
1890 }
1891 }
1892 protected:
1893 static std::vector<std::string> _values;
1894 };
1895
1896 class BagValveMaskCompartment
1897 {
1898 public:
1899 DEFINE_STATIC_STRING_EX(Reservoir, BagValveMaskReservoir);
1900 DEFINE_STATIC_STRING_EX(Bag, BagValveMaskBag);
1901 DEFINE_STATIC_STRING_EX(Valve, BagValveMaskValve);
1902 DEFINE_STATIC_STRING_EX(Filter, BagValveMaskFilter);
1903 DEFINE_STATIC_STRING_EX(Connection, BagValveMaskConnection);
1904
1905 static const std::vector<std::string>& GetValues()
1906 {
1907 ScopedMutex lock;
1908 if (_values.empty())
1909 {
1910 _values.push_back(Reservoir);
1911 _values.push_back(Bag);
1912 _values.push_back(Valve);
1913 _values.push_back(Filter);
1914 _values.push_back(Connection);
1915 }
1916 return _values;
1917 }
1918 protected:
1919 static std::vector<std::string> _values;
1920 };
1921
1922 class BagValveMaskLink
1923 {
1924 public:
1925 DEFINE_STATIC_STRING_EX(ReservoirToBag, BagValveMaskReservoirToBag);
1926 DEFINE_STATIC_STRING_EX(BagToValve, BagValveMaskBagToValve);
1927 DEFINE_STATIC_STRING_EX(ValveToFilter, BagValveMaskValveToFilter);
1928 DEFINE_STATIC_STRING_EX(FilterToConnection, BagValveMaskFilterToConnection);
1929 DEFINE_STATIC_STRING_EX(ConnectionToEnvironment, BagValveMaskConnectionToEnvironment);
1930 DEFINE_STATIC_STRING_EX(ConnectionToAirway, BagValveMaskConnectionToAirway);
1931
1932 static const std::vector<std::string>& GetValues()
1933 {
1934 ScopedMutex lock;
1935 if (_values.empty())
1936 {
1937 _values.push_back(ReservoirToBag);
1938 _values.push_back(BagToValve);
1939 _values.push_back(ValveToFilter);
1940 _values.push_back(FilterToConnection);
1941 _values.push_back(ConnectionToEnvironment);
1942 _values.push_back(ConnectionToAirway);
1943 }
1944 return _values;
1945 }
1946 protected:
1947 static std::vector<std::string> _values;
1948 };
1949
1950 class ECMOCompartment
1951 {
1952 public:
1953 DEFINE_STATIC_STRING_EX(Oxygenator, ECMOOxygenator);
1954 DEFINE_STATIC_STRING_EX(BloodSamplingPort, ECMOBloodSamplingPort);
1955
1956 static const std::vector<std::string>& GetValues()
1957 {
1958 ScopedMutex lock;
1959 if (_values.empty())
1960 {
1961 _values.push_back(Oxygenator);
1962 _values.push_back(BloodSamplingPort);
1963 }
1964 return _values;
1965 }
1966 static bool HasValue(const std::string& v)
1967 {
1968 return std::find(_values.begin(), _values.end(), v) != _values.end();
1969 }
1970 static void AddValue(const std::string& v)
1971 {
1972 if (!HasValue(v))
1973 {
1974 ScopedMutex lock;
1975 _values.push_back(v);
1976 }
1977 }
1978 protected:
1979 static std::vector<std::string> _values;
1980 };
1981
1982 class ECMOLink
1983 {
1984 public:
1985 DEFINE_STATIC_STRING(OxygenatorToVasculature);
1986 DEFINE_STATIC_STRING(VasculatureToBloodSamplingPort);
1987 DEFINE_STATIC_STRING(BloodSamplingPortToOxygenator);
1988
1989 static const std::vector<std::string>& GetValues()
1990 {
1991 ScopedMutex lock;
1992 if (_values.empty())
1993 {
1994 _values.push_back(OxygenatorToVasculature);
1995 _values.push_back(VasculatureToBloodSamplingPort);
1996 _values.push_back(BloodSamplingPortToOxygenator);
1997 }
1998 return _values;
1999 }
2000 static bool HasValue(const std::string& v)
2001 {
2002 return std::find(_values.begin(), _values.end(), v) != _values.end();
2003 }
2004 static void AddValue(const std::string& v)
2005 {
2006 if (!HasValue(v))
2007 {
2008 ScopedMutex lock;
2009 _values.push_back(v);
2010 }
2011 }
2012 protected:
2013 static std::vector<std::string> _values;
2014 };
2015
2016 class InhalerCompartment
2017 {
2018 public:
2019 DEFINE_STATIC_STRING_EX(Mouthpiece, InhalerMouthpiece);
2020
2021 static const std::vector<std::string>& GetValues()
2022 {
2023 ScopedMutex lock;
2024 if (_values.empty())
2025 {
2026 _values.push_back(Mouthpiece);
2027 }
2028 return _values;
2029 }
2030 static bool HasValue(const std::string& v)
2031 {
2032 return std::find(_values.begin(), _values.end(), v) != _values.end();
2033 }
2034 static void AddValue(const std::string& v)
2035 {
2036 if (!HasValue(v))
2037 {
2038 ScopedMutex lock;
2039 _values.push_back(v);
2040 }
2041 }
2042 protected:
2043 static std::vector<std::string> _values;
2044 };
2045
2046 class InhalerLink
2047 {
2048 public:
2049 DEFINE_STATIC_STRING_EX(EnvironmentToMouthpiece, EnvironmentToInhalerMouthpiece);
2050 DEFINE_STATIC_STRING_EX(MouthpieceToAirway, InhalerMouthpieceToAirway);
2051
2052 static const std::vector<std::string>& GetValues()
2053 {
2054 ScopedMutex lock;
2055 if (_values.empty())
2056 {
2057 _values.push_back(EnvironmentToMouthpiece);
2058 _values.push_back(MouthpieceToAirway);
2059 }
2060 return _values;
2061 }
2062 static bool HasValue(const std::string& v)
2063 {
2064 return std::find(_values.begin(), _values.end(), v) != _values.end();
2065 }
2066 static void AddValue(const std::string& v)
2067 {
2068 if (!HasValue(v))
2069 {
2070 ScopedMutex lock;
2071 _values.push_back(v);
2072 }
2073 }
2074 protected:
2075 static std::vector<std::string> _values;
2076 };
2077
2078 class MechanicalVentilationCompartment
2079 {
2080 public:
2081 DEFINE_STATIC_STRING_EX(Connection, MechanicalVentilationConnection);
2082
2083 static const std::vector<std::string>& GetValues()
2084 {
2085 ScopedMutex lock;
2086 if (_values.empty())
2087 {
2088 _values.push_back(Connection);
2089 }
2090 return _values;
2091 }
2092 static bool HasValue(const std::string& v)
2093 {
2094 return std::find(_values.begin(), _values.end(), v) != _values.end();
2095 }
2096 static void AddValue(const std::string& v)
2097 {
2098 if (!HasValue(v))
2099 {
2100 ScopedMutex lock;
2101 _values.push_back(v);
2102 }
2103 }
2104 protected:
2105 static std::vector<std::string> _values;
2106 };
2107
2108 class MechanicalVentilationLink
2109 {
2110 public:
2111 DEFINE_STATIC_STRING_EX(ConnectionToAirway, MechanicalVentilationConnectionToAirway);
2112
2113 static const std::vector<std::string>& GetValues()
2114 {
2115 ScopedMutex lock;
2116 if (_values.empty())
2117 {
2118 _values.push_back(ConnectionToAirway);
2119 }
2120 return _values;
2121 }
2122 static bool HasValue(const std::string& v)
2123 {
2124 return std::find(_values.begin(), _values.end(), v) != _values.end();
2125 }
2126 static void AddValue(const std::string& v)
2127 {
2128 if (!HasValue(v))
2129 {
2130 ScopedMutex lock;
2131 _values.push_back(v);
2132 }
2133 }
2134 protected:
2135 static std::vector<std::string> _values;
2136 };
2137
2138 class MechanicalVentilatorCompartment
2139 {
2140 public:
2141 DEFINE_STATIC_STRING(MechanicalVentilator);
2142 DEFINE_STATIC_STRING_EX(ExpiratoryValve, MechanicalVentilatorExpiratoryValve);
2143 DEFINE_STATIC_STRING_EX(InspiratoryValve, MechanicalVentilatorInspiratoryValve);
2144 DEFINE_STATIC_STRING_EX(ExpiratoryLimb, MechanicalVentilatorExpiratoryLimb);
2145 DEFINE_STATIC_STRING_EX(InspiratoryLimb, MechanicalVentilatorInspiratoryLimb);
2146 DEFINE_STATIC_STRING_EX(YPiece, MechanicalVentilatorYPiece);
2147 DEFINE_STATIC_STRING_EX(ReliefValve, MechanicalVentilatorReliefValve);
2148 DEFINE_STATIC_STRING_EX(Connection, MechanicalVentilatorConnection);
2149
2150 static const std::vector<std::string>& GetValues()
2151 {
2152 ScopedMutex lock;
2153 if (_values.empty())
2154 {
2155 _values.push_back(MechanicalVentilator);
2156 _values.push_back(ExpiratoryValve);
2157 _values.push_back(InspiratoryValve);
2158 _values.push_back(ExpiratoryLimb);
2159 _values.push_back(InspiratoryLimb);
2160 _values.push_back(YPiece);
2161 _values.push_back(ReliefValve);
2162 _values.push_back(Connection);
2163 }
2164 return _values;
2165 }
2166 static bool HasValue(const std::string& v)
2167 {
2168 return std::find(_values.begin(), _values.end(), v) != _values.end();
2169 }
2170 static void AddValue(const std::string& v)
2171 {
2172 if (!HasValue(v))
2173 {
2174 ScopedMutex lock;
2175 _values.push_back(v);
2176 }
2177 }
2178 protected:
2179 static std::vector<std::string> _values;
2180 };
2181
2182 class MechanicalVentilatorLink
2183 {
2184 public:
2185 DEFINE_STATIC_STRING(MechanicalVentilatorToExpiratoryValve);
2186 DEFINE_STATIC_STRING(MechanicalVentilatorToInspiratoryValve);
2187 DEFINE_STATIC_STRING_EX(ExpiratoryLimbToExpiratoryValve, MechanicalVentilatorExpiratoryLimbToExpiratoryValve);
2188 DEFINE_STATIC_STRING_EX(InspiratoryValveToInspiratoryLimb, MechanicalVentilatorInspiratoryValveToInspiratoryLimb);
2189 DEFINE_STATIC_STRING_EX(ExpiratoryLimbToYPiece, MechanicalVentilatorExpiratoryLimbToYPiece);
2190 DEFINE_STATIC_STRING_EX(InspiratoryLimbToYPiece, MechanicalVentilatorInspiratoryLimbToYPiece);
2191 DEFINE_STATIC_STRING_EX(YPieceToConnection, MechanicalVentilatorYPieceToConnection);
2192 DEFINE_STATIC_STRING_EX(LeakConnectionToEnvironment, MechanicalVentilatorLeakConnectionToEnvironment);
2193 DEFINE_STATIC_STRING_EX(ConnectionToReliefValve, MechanicalVentilatorConnectionToReliefValve);
2194 DEFINE_STATIC_STRING_EX(EnvironmentToReliefValve, MechanicalVentilatorEnvironmentToReliefValve);
2195 DEFINE_STATIC_STRING_EX(ConnectionToEnvironment, MechanicalVentilatorConnectionToEnvironment);
2196 DEFINE_STATIC_STRING_EX(ConnectionToAirway, MechanicalVentilatorConnectionToAirway);
2197
2198 static const std::vector<std::string>& GetValues()
2199 {
2200 ScopedMutex lock;
2201 if (_values.empty())
2202 {
2203 _values.push_back(MechanicalVentilatorToExpiratoryValve);
2204 _values.push_back(MechanicalVentilatorToInspiratoryValve);
2205 _values.push_back(ExpiratoryLimbToExpiratoryValve);
2206 _values.push_back(InspiratoryValveToInspiratoryLimb);
2207 _values.push_back(ExpiratoryLimbToYPiece);
2208 _values.push_back(InspiratoryLimbToYPiece);
2209 _values.push_back(YPieceToConnection);
2210 _values.push_back(LeakConnectionToEnvironment);
2211 _values.push_back(ConnectionToReliefValve);
2212 _values.push_back(EnvironmentToReliefValve);
2213 _values.push_back(ConnectionToEnvironment);
2214 _values.push_back(ConnectionToAirway);
2215 }
2216 return _values;
2217 }
2218 static bool HasValue(const std::string& v)
2219 {
2220 return std::find(_values.begin(), _values.end(), v) != _values.end();
2221 }
2222 static void AddValue(const std::string& v)
2223 {
2224 if (!HasValue(v))
2225 {
2226 ScopedMutex lock;
2227 _values.push_back(v);
2228 }
2229 }
2230 protected:
2231 static std::vector<std::string> _values;
2232 };
2233
2234 class NasalCannulaCompartment
2235 {
2236 public:
2237 DEFINE_STATIC_STRING(NasalCannulaOxygenSource);
2238 DEFINE_STATIC_STRING(NasalCannula);
2239
2240 static const std::vector<std::string>& GetValues()
2241 {
2242 ScopedMutex lock;
2243 if (_values.empty())
2244 {
2245 _values.push_back(NasalCannulaOxygenSource);
2246 _values.push_back(NasalCannula);
2247 }
2248 return _values;
2249 }
2250 static bool HasValue(const std::string& v)
2251 {
2252 return std::find(_values.begin(), _values.end(), v) != _values.end();
2253 }
2254 static void AddValue(const std::string& v)
2255 {
2256 if (!HasValue(v))
2257 {
2258 ScopedMutex lock;
2259 _values.push_back(v);
2260 }
2261 }
2262 protected:
2263 static std::vector<std::string> _values;
2264 };
2265
2266 class NasalCannulaLink
2267 {
2268 public:
2269 DEFINE_STATIC_STRING(NasalCannulaOxygenInlet);
2270 DEFINE_STATIC_STRING(NasalCannulaSeal);
2271 DEFINE_STATIC_STRING(NasalCannulaToAirway);
2272
2273 static const std::vector<std::string>& GetValues()
2274 {
2275 ScopedMutex lock;
2276 if (_values.empty())
2277 {
2278 _values.push_back(NasalCannulaOxygenInlet);
2279 _values.push_back(NasalCannulaSeal);
2280 _values.push_back(NasalCannulaToAirway);
2281 }
2282 return _values;
2283 }
2284 static bool HasValue(const std::string& v)
2285 {
2286 return std::find(_values.begin(), _values.end(), v) != _values.end();
2287 }
2288 static void AddValue(const std::string& v)
2289 {
2290 if (!HasValue(v))
2291 {
2292 ScopedMutex lock;
2293 _values.push_back(v);
2294 }
2295 }
2296 protected:
2297 static std::vector<std::string> _values;
2298 };
2299
2300 class NonRebreatherMaskCompartment
2301 {
2302 public:
2303 DEFINE_STATIC_STRING(NonRebreatherMaskOxygenSource);
2304 DEFINE_STATIC_STRING(NonRebreatherMaskPorts);
2305 DEFINE_STATIC_STRING(NonRebreatherMaskBag);
2306 DEFINE_STATIC_STRING(NonRebreatherMask);
2307
2308 static const std::vector<std::string>& GetValues()
2309 {
2310 ScopedMutex lock;
2311 if (_values.empty())
2312 {
2313 _values.push_back(NonRebreatherMaskOxygenSource);
2314 _values.push_back(NonRebreatherMaskPorts);
2315 _values.push_back(NonRebreatherMaskBag);
2316 _values.push_back(NonRebreatherMask);
2317 }
2318 return _values;
2319 }
2320 static bool HasValue(const std::string& v)
2321 {
2322 return std::find(_values.begin(), _values.end(), v) != _values.end();
2323 }
2324 static void AddValue(const std::string& v)
2325 {
2326 if (!HasValue(v))
2327 {
2328 ScopedMutex lock;
2329 _values.push_back(v);
2330 }
2331 }
2332 protected:
2333 static std::vector<std::string> _values;
2334 };
2335
2336 class NonRebreatherMaskLink
2337 {
2338 public:
2339 DEFINE_STATIC_STRING(NonRebreatherMaskOxygenInlet);
2340 DEFINE_STATIC_STRING(NonRebreatherMaskReservoirValve);
2341 DEFINE_STATIC_STRING(NonRebreatherMaskSeal);
2342 DEFINE_STATIC_STRING(NonRebreatherMaskExhalationValves);
2343 DEFINE_STATIC_STRING(NonRebreatherMaskExhalation);
2344 DEFINE_STATIC_STRING(NonRebreatherMaskToAirway);
2345
2346 static const std::vector<std::string>& GetValues()
2347 {
2348 ScopedMutex lock;
2349 if (_values.empty())
2350 {
2351 _values.push_back(NonRebreatherMaskOxygenInlet);
2352 _values.push_back(NonRebreatherMaskReservoirValve);
2353 _values.push_back(NonRebreatherMaskSeal);
2354 _values.push_back(NonRebreatherMaskExhalationValves);
2355 _values.push_back(NonRebreatherMaskExhalation);
2356 _values.push_back(NonRebreatherMaskToAirway);
2357 }
2358 return _values;
2359 }
2360 static bool HasValue(const std::string& v)
2361 {
2362 return std::find(_values.begin(), _values.end(), v) != _values.end();
2363 }
2364 static void AddValue(const std::string& v)
2365 {
2366 if (!HasValue(v))
2367 {
2368 ScopedMutex lock;
2369 _values.push_back(v);
2370 }
2371 }
2372 protected:
2373 static std::vector<std::string> _values;
2374 };
2375
2376 class SimpleMaskCompartment
2377 {
2378 public:
2379 DEFINE_STATIC_STRING(SimpleMaskOxygenSource);
2380 DEFINE_STATIC_STRING(SimpleMask);
2381
2382 static const std::vector<std::string>& GetValues()
2383 {
2384 ScopedMutex lock;
2385 if (_values.empty())
2386 {
2387 _values.push_back(SimpleMaskOxygenSource);
2388 _values.push_back(SimpleMask);
2389 }
2390 return _values;
2391 }
2392 static bool HasValue(const std::string& v)
2393 {
2394 return std::find(_values.begin(), _values.end(), v) != _values.end();
2395 }
2396 static void AddValue(const std::string& v)
2397 {
2398 if (!HasValue(v))
2399 {
2400 ScopedMutex lock;
2401 _values.push_back(v);
2402 }
2403 }
2404 protected:
2405 static std::vector<std::string> _values;
2406 };
2407
2408 class SimpleMaskLink
2409 {
2410 public:
2411 DEFINE_STATIC_STRING(SimpleMaskOxygenInlet);
2412 DEFINE_STATIC_STRING(SimpleMaskSeal);
2413 DEFINE_STATIC_STRING(SimpleMaskPorts);
2414 DEFINE_STATIC_STRING(SimpleMaskToAirway);
2415
2416 static const std::vector<std::string>& GetValues()
2417 {
2418 ScopedMutex lock;
2419 if (_values.empty())
2420 {
2421 _values.push_back(SimpleMaskOxygenInlet);
2422 _values.push_back(SimpleMaskSeal);
2423 _values.push_back(SimpleMaskPorts);
2424 _values.push_back(SimpleMaskToAirway);
2425 }
2426 return _values;
2427 }
2428 static bool HasValue(const std::string& v)
2429 {
2430 return std::find(_values.begin(), _values.end(), v) != _values.end();
2431 }
2432 static void AddValue(const std::string& v)
2433 {
2434 if (!HasValue(v))
2435 {
2436 ScopedMutex lock;
2437 _values.push_back(v);
2438 }
2439 }
2440 protected:
2441 static std::vector<std::string> _values;
2442 };
2443END_NAMESPACE
Definition: Logger.h:71
Definition: ScopedMutex.h:7
Definition: Logger.h:14
STL namespace.
Definition: PulseEngine.h:23
IrreversibleStateException(const std::string &_Message)
Definition: PulseEngine.h:27
IrreversibleStateException()
Definition: PulseEngine.h:24
Definition: PulseEngine.h:11
static std::string Version()
static std::string Time()
static std::string Hash()

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.