Menu

#203 How to use contexts?

Beta06
wont-fix
None
2015-11-23
2015-06-30
No

I have defined a WorkflowContext in device.xml:

<WorkflowContext Handle="myWorkflowContext">
  <Type>
    <CodeId>MDCX_MY_WORKFLOW_CONTEXT</CodeId>
  </Type>
</WorkflowContext>

Now I'm trying to use it on client side (pseudo code):

mdsContexts = bicepsClient.getMDSContexts
contextElements = mdsContexts.getMDSContextElements
find DefaultBICEPSWorkflowContext in contextElements:
  workflowContext.getContextElementItem // returns null

getContextElementItem returns null because in BICEPSProxyUtil.getCurrentStateFromDevice(...) it tries to determine the state's class. "myWorkflowContext" is of class ContextAssociationState. That's really weird because I'm using this method on a WorkflowContext with handle "myWorkflowContext".

I do not understand the relationship between Contexts (WorkflowContext, PatientContext, ...) and ContextAssociationState.

How to access a context's content from client side?

Discussion

  • Stefan Schlichting

    • status: open --> wont-fix
    • assigned_to: Stefan Schlichting
     
  • Stefan Schlichting

    ...
    List<BICEPSMDSContext> mdsContexts =
            this.sdcClient.getMDSContexts(this.mdsProxy);
    for (BICEPSMDSContext mdsContext : mdsContexts) {
                List<BICEPSMDSContextElementState<?, ?>> mdsContextElements = 
                                                                            mdsContext.getMDSContextElements();
                for (BICEPSMDSContextElementState<?, ?> contextElementState:
                                                                                                        mdsContextElements) 
                {
                    if (contextElementState instanceof BICEPSPatientState)
                    {
                           BICEPSPatientState patientProxy=
                                                        (BICEPSPatientState)contextElementState;
                            ...
                    }
                }
        }
    ...
    
     

Log in to post a comment.

MongoDB Logo MongoDB