OpenMRS uses a property called sort_weight to store a default order for both concept answers and concept sets. For instance, I may have a question labelled:
"Does the patient smoke?"
With answers like:
- "Didn't Ask"
In OpenMRS this would be represented as 5 concepts, one for "Does the patient smoke?" and one for each of the answers. The answers would then be linked to the question as answers via the concept_answer table. In this table, we have a sort_weight column that can be used to determine the order the answers should be displayed.
Currently, in the dictionary manager, we capture the order of concept answers by writing to a sort_weight property in the extras field of the mapping (note that this property is entirely optional). Where this value is populated, the corresponding concept_answer in the OpenMRS data should have it's sort_weight set to that value.
The above also applies to set members of concept sets, where the sort_weight is a property of the concept_set table that relates concepts that are the "head" of sets to concepts that make up that set.
1. When a mapping of type Q-AND-A is downloaded from OCL and the extras section contains a sort_weight, the resulting ConceptAnswer object should have this sort_weight value assigned to its sortWeight property.
2. When a mapping of type CONCEPT-SET is downloaded from OCL and the extras section contains a sort_weight, the resulting ConceptSet object should have this sort_weight value assigned to its sortWeight property.
This feature is requested by PIH