Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Enumerations can be specified manually, using the screen provided in Guvnor.  For small projects with very few Enumerations, this may work OK.  It also works just fine for small ad-hoc enumerations that are not based on a controlled vocabulary.

However, if you are using the vMR and doing a lot of Knowledge Modules with a lot of rules, you will probably want to automate the process of populating the Guvnor Enumerations. 

Automating Enumerations

In OpenCDS we We provide a web service in OpenCDS that interfaces with the Apelon service, and populates the Guvnor Enumerations: 

  • This web service uses the Guvnor REST interface to replace all the Enumerations from Concepts stored in the OpenCDS Apelon. 
  • This web service can be easily adapted to point to your own instance of Apelon, or to use a different terminology management system.
  • By default this web service will update all the enumerations in Guvnor at a specified time each day.

Creating "OpenCDS Global Enumerations" for Automated Enumerations

Every vMR element that can have an enumeration in Guvnor needs to have two rows in the "OpenCDS global enumerations":

1.The first row defines the "Field" (openCDSConceptCode) that may be used as Concepts for an encoded Fact used in the specified vMR Element (ClinicalStatementRelationship)

2 The second row defines the "Field" (determinationMethodCode) that may be used for the mappings to the above OpenCDS Concept Code from an encoded Fact found in the specified vMR Element (ClinicalStatementRelationship)

There should be a pair of entries in the "OpenCDS global enumerations", following the pattern shown below, for each Fact that you will be referencing as an OpenCDS Concept in your rules.  You may need several hundred of these Enumerations defined.  Our suggestion is that you just use the ones we have already defined in this sample Knowledge Module.  It is a lot of work to create new ones by hand, and the enumerations we have defined can be automatically and dynamically updated from Apelon while you are using Guvnor...

FactFieldContext
ClinicalStatementRelationshipConceptopenCdsConceptCode(new org.opencds.common.terminology.VMREnumerationsClient()).getOpenCdsConcepts("clinicalStatementRelationship")
ClinicalStatementRelationshipConceptdeterminationMethodCode(new org.opencds.common.terminology.VMREnumerationsClient()).getOpenCdsConcepts("determinationMethod")


Creating "Package Enumerations" Manually

There may a need to define Enumerations for drop-downs in the DSLs that do not pertain directly to OpenCDS Concepts for the encoded facts in the data.  We create "Package Enumerations" for this purpose.  We use these to define constraints or attributes on the way we are referencing some of the data elements in the vMR.  Here are some examples that we use in some of our DSLs:

FactFieldContext
Comparisonoperator['>','>\\=','\\=\\=','<','<\\=','!\\=']
EnumerationTargetUCUM

['mg/dL','%','mm[Hg]','mg/mL']

TimeIntervalhighLowUpper['Low=low','High=high']
EncounterIdreference['EncA=Encounter A', 'EncB=Encounter B', 'EncC=Encounter C', 'EncD=Encounter D', 'EncE=Encounter E', 'EncF=Encounter F', 'EncG=Encounter G', 'EncH=Encounter H', 'EncI=Encounter I', 'EncJ=Encounter J', 'EncK=Encounter K']