Versions Compared

Key

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

Reference for writing HTML for the Html Form Entry Module

...

  • required: Specifies that the diagnoses field must be completed/filled.
    • OPTIONAL
    • Example: <encounterDiagnoses required="true"/> 
    • Value: "true", "false"
    • Default: false
  • selectedDiagnosesTarget: Specifies the id of the <div>  container where the selected diagnoses are displayed. 
    • REQUIRED
    • Example:
      <encounterDiagnoses selectedDiagnosesTarget="encounter-diagnoses-target"/> 
      <div id="encounter-diagnoses-target"></div> 
    • Value: can be any valid HTML safe id
    • Default: There is no default for this and therefore should be provided as illustrated in the above example.
  • preferredCodingSource: This is used to notify the user that choices that are presented to him through the autocomplete don't pertain to a preferred source.
    • OPTIONAL
    • As of version Core Apps 1.23.0
    • Example:
      <encounterDiagnoses preferredCodingSource="ICD-10-WHO"/> 
    • Value: A valid concept source name, e.g "ICD-10-WHO", "CIEL", "ICPC2", ... etc.
    • Default: "ICD-10-WHO"
  • diagnosisConceptClasses: Specifies one or more concept classes in a form of a comma separated string to search in. Can be used together with diagnosisConceptSources
    • OPTIONAL
    • As of version 1.23.0
    • Examples: 
      <encounterDiagnoses diagnosisConceptClasses="Diagnosis"/> 
      <encounterDiagnoses diagnosisConceptClasses="Diagnosis,Finding"/> 
    • Value: A valid concept class e.g "Diagnosis", list of classes "Diagnosis,Finding"
  • diagnosisConceptSources: Specifies one or more concept sources in a form of a comma separated string to search in. Can be used together and works well with diagnosisConceptClasses
    • OPTIONAL
    • As of version 1.23.0
    • Examples: 
      <encounterDiagnoses diagnosisConceptSources="CIEL"/> 
      <encounterDiagnoses diagnosisConceptSources="CIEL,ICPC2"/> 
      <encounterDiagnoses diagnosisConceptSources="0"/>
      NOTE: pointing to a null concept source ensures that no default will be used, it will remove the concept sources as a space for the search. 
      <encounterDiagnoses diagnosisConceptSources=""/>
      NOTE: pointing to an empty concept source will lead to using the defaults.
    • Value: A valid concept sources e.g "ICD-10-WHO", list of sources "CIEL,ICPC2" or "0" (zero)
    • Default: "ICD-10-WHO"
  • diagnosisSets: Specifies the concept sets of diagnoses to search from. Can be one or more comma separated string of UUIDs, concept mappings (e.g CIEL:160170) or combination of both representing the sets. This when provided, overrides the default globally configured set of sets of diagnoses to search from.
    • OPTIONAL
    • As of version 1.23.0
    • Examples:
      <encounterDiagnoses diagnosisSets="160170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,160169AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"/> 
      <encounterDiagnoses diagnosisSets="CIEL:160170,CIEL:160169"/> 
      <encounterDiagnoses diagnosisSets="CIEL:160170,160170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"/> 
      <encounterDiagnoses diagnosisSets="0"/> 
      NOTE: pointing to a null concept set ensures that no default will be used, it will remove the concept sets as a space for the search.
      <encounterDiagnoses diagnosisSets=""/> 
      NOTE: pointing to a empty concept set will lead to using the defaults.
    • Value: comma separated string of UUID or Concept Mappings or both or "0". When "0" (zero) is used, this means that the default globally defined concept sets are not used to search in.
    • Default: concepts contained in the sets globally defined by a set of sets concept (CIEL:160167 or 160167AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA).
    • IMPORTANT NOTE: When the diagnosisSets  is specified either through global defaults or provided in this HFE tag, the name search for diagnoses within classes and/or sources is bypassed. This means that the name search only operates within those sets, such that the classes and/or sources are ignored. To globally define diagnosis concepts sets and/or diagnosis concept sources, edit the emr.concept.diagnosisSetOfSets and emrapi.conceptSourcesForDiagnosisSearch global properties respectively.

Example Usages

The following examples are identical to using the <encounterDiagnosesByObs/>  tag.

...

  • default: Sets default provider for the widget (id or uuid of a Provider, or "currentUser"). 
    • If you specify "currentUser" but the currently-logged-in user does not have a Provider record associated with their Person record, nothing happens. (If that user has more than one Provider record, one is chosen arbitrarily.)
  • encounterRole: Use the given encounterRole  instead of rendering a dropdown.
    • If the encounterRole  attribute is not provided, the widget renders as a pair of dropdowns. The first allows selecting from a list of providers; the second allows selecting from a list of encounter roles. If the encounterRole  attribute is provided, the encounter role dropdown is omitted; the provider is added to the encounter with the encounter role given as the value of this attribute.
    • Value:  id or uuid of an encounterRole 
  • providerRoles:  Limit the list of possible providers to those with any of the specified providerRoles 
    • Example:  <encounterProviderAndRole providerRoles="8" />
    • Value:  Comma separated list of provider role id or uuid
    • Requires that the Provider Management module be installed
    • since HFE 1.9 Extensions 1.2
  • required: when true, the form cannot be submitted unless you have chosen a provider
  • autocompleteProvider: When true, the provider widget is rendered in autocomplete search box in which user is expected to type the few characters used to search for a particular provider (s).
    • Value: true or false
    • Default: false
    • Example: <encounterProviderAndRole autocompleteProvider="true"/>
    • since HFE 1.9 Extensions 1.6
  • providerMatchMode: Used in conjunction with autocompleteProvider attribute to specify the position to match search text in provider identifier/names.
    • Values: START, END, ANYWHERE (Default is START)
    • Example: <encounterProviderAndRole autocompleteProvider="true" providerMatchMode="ANYWHERE" />
    • Since HFE 1.9 Extensions 1.6
  • count: Repeat this widget count  times. See the "Note" below.
    • Default: 1
  • providerWidgetSeparator: If using count , this HTML is inserted in between each widget.
    • Default:  ", "
    • Since:  htmlformentry version 3.10.0
    • Example:  

      Code Block
      <div class="provider-grid">
          <div>
              <encounterProviderAndRole
      			encounterRole="98bf2792-3f0a-4388-81bb-c78b29c0df92"
      			count="2"
      			providerWidgetSeparator="&lt;/div&gt;&lt;div&gt;"/>
          </div>
      </div>


...

  • fn.logic(String logicExpression)
    • evaluates a logic expression, and returns an org.openmrs.logic.Result
    • since 1.7.0
    • NOTE:  logicTest is not available in htmlformentry version 4.0.0+
    • Example

      Code Block
      Latest BMI: <lookup expression="fn.logic('BMI')"/> <!-- requires that you have a BMI rule registered -->
      


  • fn.allObs(String conceptIdOrUuidOrMapping)
    • returns all the patient's observations for the given concept, as a List<Obs>
    • since 1.7.0
    • Example

      Code Block
      Past CD4 results: <lookup complexExpression="#foreach($cd4 in $fn.allObs(5497)) $cd4.valueNumeric #end"/>
      


  • fn.latestObs(String conceptIdOrUuidOrMapping)
    • returns the patient's most recent observation for the given concept (most recent ever and not in relation to this encounter's date)
    • since 1.7.0
    • Example

      Code Block
      Last Weight: <lookup expression="fn.latestObs('CIEL:5089').valueNumeric"/>
      Date of Last Weight: <lookup expression="fn.latestObs('CIEL:5089').obsDatetime"/>
      
      Last BMI: <lookup complexExpression="#set( $wt = $fn.latestObs('5089').valueNumeric ) #set( $ht = $fn.latestObs('5090').valueNumeric ) #set( $bmi = $wt / ($ht * $ht) ) $!{bmi}"/>
      


  • fn.latestObs(String conceptIdOrUuidOrMapping, String latestDate)
    • returns the patient's most recent observation for the given concept (most recent up to the specified date)
    • since 4.2.0
    • Example

      Code Block
      Last Weight: <lookup expression="fn.latestObs('CIEL:5089', '2021-06-30').valueNumeric"/>The example below creates an encounter date from either the visit date or the date of the current encounter for use as the latest date parameter <lookup complexExpression="#if ($encounter) #set ($encounterDate = $encounter.encounterDatetime) #else #set ($encounterDate = $visit.startDatetime) #end"/>
      Last Weight: <lookup expression="fn.latestObs('CIEL:5089', $encounterDate).valueNumeric"/>


  • fn.latestObsBeforeCurrentEncounter(String conceptIdOrUuidOrMapping, boolean onlyInCurrentVisit)
    • returns the patient's most recent observation for the given concept, as of:
      • the current date, if this is a newly entered form
      • the existing saved encounter date, if this is a form opened in the context of an existing encounter
      • if onlyInCurrentVisit is set to true, it will limit the results to only those obs recorded in the same visit context as the currently entered form
    • since 5.3.0
    • Example

      Code Block
      Last Weight Prior to this Encounter During this Visit: <lookup expression="fn.latestObsBeforeCurrentEncounter('CIEL:5089', true).valueNumeric"/>
      


  • fn.latestObsInVisitPriorToEncounter(String conceptIdOrUuidOrMapping, String valueCodedIdOrUuidOrMapping)
    • returns the patient's most recent observation for the given concept and (optional) coded answer, recorded in the visit associated with the form entry session, as of:
      • the current date, if this is a newly entered form
      • the existing saved encounter date, if this is a form opened in the context of an existing encounter
    • since 5.3.0
    • Example

      Code Block
      Date on which questionUuid was answered with answerUuid this visit: <lookup expression="fn.latestObsInVisitPriorToEncounter('questionUuid', 'answerUuid).valueDatetime"/>
      


  • fn.earliestObs(String conceptIdOrUuidOrMapping)
    • returns the patient's earliest observation for the given concept
    • since 1.7.0
    • Example

      Code Block
      First Weight: <lookup expression="fn.earliestObs(5089)"/>
      


  • fn.allEncounters(EncounterType type)
    • returns all the patient's encounters for the given encounter type ( or all the patient's encounters if given a null parameter), as a List<Encounter>
    • EncounterType type is the UUID of the desired encounter type
    • since 1.7.4
    • Example

      Code Block
      Past Encounter Dates: <lookup complexExpression="#foreach($encounter in $fn.allEncounters(null)) $encounter.encounterDatetime #end"/>
      
      Encounter ID's for Type ee95dbbf-5aec-4eaf-85e3-87cfad31bfa6: <lookup complexExpression="#foreach($encounter in $fn.allEncounters(ee95dbbf-5aec-4eaf-85e3-87cfad31bfa6)) $encounter.encounterId #end"/>


...

  • answerConceptIds: Concept references corresponding to the coded answers for the question. Used with radio buttons and dropdowns.
    • OPTIONAL
    • Examples:
      • <obs conceptId="1319" labelText="Toiture/Roofing: " answerConceptIds="1320,1321,1316" answerLabels="tole,tache,beton"/>
      • <obs conceptId="1319" labelText="Toiture/Roofing: " answerConceptIds="XYZ:HT,ABC:QQ,QWE:TR" answerLabels="tole,tache,beton"/>
      • <obs conceptId="1319" labelText="Toiture/Roofing: " answerConceptIds="5ecb88f3-cd5f-4f46-9459-26127c9265ab,74e3ded1-cd4f-4f4b-9459-26127c9265ab,0cbe2ed3-cd5f-4f46-9459-26127c9265ab" answerLabels="tole,tache,beton"/>
      • <obs conceptId="1319" labelText="Toiture/Roofing: " answerConceptIds="1320,ABC:QQ,0cbe2ed3-cd5f-4f46-9459-26127c9265ab" answerLabels="tole,tache,beton"/>
      • <obs conceptId="3509" answerConceptIds="org.openmrs.module.mymod.Dictionary.YES,org.openmrs.module.mymod.Dictionary.NO" answerLabels="Yes,No" />
    • Value: Quoted, comma separated list of valid Concept Integer IDs, Concept Mappings, Concept UUIDs or fully qualified constant names.
    • Default: None
  • answerConceptSetIds:  Concept reference allowing coded answers for the question where the coded answers are assigned from one or more concept set.  Use with autocomplete. (Added in Version 3.0)
    • OPTIONAL
    • Examples:
      • <obs conceptId="PIH:Mental health diagnosis (coded)" answerConceptSetIds="PIH:HUM Mental Health diagnosis set" labelText="Diagnosis" style="autocomplete" />

    • Value: Quoted, comma separated list of valid Concept Integer IDs, Concept Mappings, Concept UUIDs or fully qualified constant names.
    • Default: None
  • answerDrugId: Drug reference corresponding to the coded Drug answer for the question. The obs renders as a checkbox, and if it's checked then the obs is saved as: obs.concept_id=conceptId, obs.value_coded=Concept ID of the concept associated with the Drug specified; obs.value_drug=the ID(integer) of the drug specified
    • OPTIONAL
    • Example: <obs conceptId="PIH:MEDICATION ORDERS" answerDrugId="4534a926-8dc4-440b-bdf9-f9e96d282a28" />
    • Value: the UUID of the Drug
    • Version: since 3.9.0
  • answerDrugs: for coded concepts, if true, displays an autocomplete widget to pick a drug as the obs value
    • OPTIONAL
    • Example: <obs conceptId="1234" answerDrugs="true" />
    • Value: true or false
    • Default: false
    • Version: since 2.1.6
  • answerDrugIds: A comma-separated list of drugs referenced by uuid; renders a dropdown the allows the user to choose one of those drugs; when saved, that drug is saved as Obs value_drug (and the related concept as Obs value_coded); the names of the drugs are used as a label, but can be overwritten using the answerLabels attribute
    • OPTIONAL
    • Example:  <obs conceptId="CIEL:1282" answerDrugIds="78f95d38-dfbe-11e9-8a34-2a2ae2dbcce4,78f95e78-dfbe-11e9-8a34-2a2ae2dbcce4,78f95bc6-dfbe-11e9-8a34-2a2ae2dbcce4" answerLabels="Atazanavir,Lopinavir,Zivoduvine" />
    • Version: since 3.12.0

...