... | ... | @@ -100,10 +100,9 @@ All CDM classes support serialization to and from a binding class. You will need |
|
|
|
|
|
**Headers**
|
|
|
|
|
|
* [Anesthesia Machine Action](https://gitlab.kitware.com/physiology/engine/blob/master/cdm/cpp/io/protobuf/PBAnesthesiaMachineActions.h)
|
|
|
* [Environment Action](https://gitlab.kitware.com/physiology/engine/blob/master/cdm/cpp/io/protobuf/PBEnvironmentActions.h)
|
|
|
* [Inhaler Action](https://gitlab.kitware.com/physiology/engine/blob/master/cdm/cpp/io/protobuf/PBInhalerActions.h)
|
|
|
* [Patient Action](https://gitlab.kitware.com/physiology/engine/blob/master/cdm/cpp/io/protobuf/PBInhalerActions.h)
|
|
|
* [Environment Actions](https://gitlab.kitware.com/physiology/engine/-/blob/stable/src/cpp/cdm/io/protobuf/PBEnvironmentActions.h)
|
|
|
* [Equipment Actions](https://gitlab.kitware.com/physiology/engine/-/blob/stable/src/cpp/cdm/io/protobuf/PBEquipmentActions.h)
|
|
|
* [Patient Actions](https://gitlab.kitware.com/physiology/engine/-/blob/stable/src/cpp/cdm/io/protobuf/PBPatientActions.h)
|
|
|
|
|
|
In our example, for adding a patient action we will add something like the following code to the appropriate header
|
|
|
|
... | ... | @@ -120,10 +119,9 @@ static void Copy(const SEMyNewAction& src, SEMyNewAction& dst); |
|
|
|
|
|
**Code**
|
|
|
|
|
|
* [Anesthesia Machine Action](https://gitlab.kitware.com/physiology/engine/blob/master/cdm/cpp/io/protobuf/PBAnesthesiaMachineActions.cpp)
|
|
|
* [Environment Action](https://gitlab.kitware.com/physiology/engine/blob/master/cdm/cpp/io/protobuf/PBEnvironmentActions.cpp)
|
|
|
* [Inhaler Action](https://gitlab.kitware.com/physiology/engine/blob/master/cdm/cpp/io/protobuf/PBInhalerActions.cpp)
|
|
|
* [Patient Action](https://gitlab.kitware.com/physiology/engine/blob/master/cdm/cpp/io/protobuf/PBInhalerActions.cpp)
|
|
|
* [Environment Actions](https://gitlab.kitware.com/physiology/engine/-/blob/stable/src/cpp/cdm/io/protobuf/PBEnvironmentActions.cpp)
|
|
|
* [Equipment Actions](https://gitlab.kitware.com/physiology/engine/-/blob/stable/src/cpp/cdm/io/protobuf/PBEquipmentActions.cpp)
|
|
|
* [Patient Actions](https://gitlab.kitware.com/physiology/engine/-/blob/stable/src/cpp/cdm/io/protobuf/PBPatientActions.cpp)
|
|
|
|
|
|
Implement the newly added methods. I suggest you just copy another action class method set and use the correct class names.
|
|
|
|
... | ... | @@ -163,10 +161,9 @@ cdm::AnyPatientActionData* PBPatientAction::Unload(const SEPatientAction& action |
|
|
|
|
|
The action manager contains different classes to organize the _collection_ of actions associated with the object on which the actions take place. The following files are those action collection managers:
|
|
|
|
|
|
* [Anesthesia Machine Action Collection](https://gitlab.kitware.com/physiology/engine/blob/master/cdm/cpp/scenario/SEAnesthesiaMachineActionCollection.cpp)
|
|
|
* [Environment Action Collection](https://gitlab.kitware.com/physiology/engine/blob/master/cdm/cpp/scenario/SEEnvironmentActionCollection.cpp)
|
|
|
* [Inhaler Action Collection](https://gitlab.kitware.com/physiology/engine/blob/master/cdm/cpp/scenario/SEInhalerActionCollection.cpp)
|
|
|
* [Patient Action Collection](https://gitlab.kitware.com/physiology/engine/blob/master/cdm/cpp/scenario/SEPatientActionCollection.cpp)
|
|
|
* [Environment Action Collection](https://gitlab.kitware.com/physiology/engine/-/blob/stable/src/cpp/cdm/engine/SEEnvironmentActionCollection.cpp)
|
|
|
* [Equipment Action Collection](https://gitlab.kitware.com/physiology/engine/-/blob/stable/src/cpp/cdm/engine/SEEquipmentActionCollection.cpp)
|
|
|
* [Patient Action Collection](https://gitlab.kitware.com/physiology/engine/-/blob/stable/src/cpp/cdm/engine/SEPatientActionCollection.cpp)
|
|
|
|
|
|
Since we are adding a patient action, we will edit the SEPatientActionCollection.h/.cpp files. Note this example is for one instance of the action for the entire engine, there are patterns in this file if want to, for example, have an instance of the action be associated with a compartment or some other way to handle multiple instances of the action type. Also, note the example of the Tension Pneumothorax actions. The one action can be of 2 different types and associated with the two lungs. Hence the interface was designed to check if any pneumothorax actions are present, then method for each combination of type/location. This exposure is up to you and what makes the most sense for your action to present to model developers. In this example, we are taking a simple approach to adding this new action. Just like we used the SEAcuteStress action files as a basis, you can go through the SEPatientActionCollection files, look for SEAcuteStress, and copy the patterns in the file. Note again that we organize instructions alphabetically.
|
|
|
|
... | ... | |