The diagnoses pool that is known and used by the Ref App (and in particular by EMR API) is controlled by two GPs: EmrApiConstants.GP_DIAGNOSIS_SET_OF_SETS and EmrApiConstants.EMR_CONCEPT_SOURCES_FOR_DIAGNOSIS_SEARCH.
The use of HFE tags <encounterDiagnoses> and <encounterDiagnosesByObs> assumes the user wants to choose diagnoses defined by the sets in the superset specified by the above mentioned GP. This may most often include irrelevant diagnoses for the HFE usage.
The <encounterDiagnoses*/> tags should allow to specify the super set of diagnoses such that diagnoses relevant to the form are fetched for usage.
The tags should provide a way to specify the diagnosis sets in the form of a comma separated list if more than one set, something along the line below is ok:
The diagnoses super set that is used to fetch the diagnosis sets is determined by the EMR API from a global property.
Create a new attribute diagnosisSets for the EncounterDiagnosesElement and EncounterDiagnosesByObsElement that will be passed into the encounterDiagnoses.gsp through its config and attached to the <input id="diagnosis-search"...../> element. This would then look like.
For backwards compatibility, if the diagnosisSets attribute doesn't exist or is empty then the diagnoses super set defined by the EmrApiConstants.GP_DIAGNOSIS_SET_OF_SETS global property will be used.