Uploaded image for project: 'FHIR Module v2'
  1. FHIR Module v2
  2. FM2-352

Add support for creating encounters via the FHIR API



    • Enhancement
    • Status: Closed
    • Must
    • Resolution: Fixed
    • FM2 1.2.0
    • FM2 1.2.0
    • None
    • None


      We currently don't support creating encounters through the FHIR API. This is down to two things:

      1. Encounter in FHIR maps to OpenMRS Encounter but also to OpenMRS Visit
      2. We need the encounter type to be able to create the encounter or the visit type to be able to create the visit.

      Thanks to FM2-332, we now have a way to represent the encounter type in FHIR and with the completion of FM2-350, we will have a way to represent the visit type in FHIR. Thus, we should be able to solve both of those problems.

      To implement this fully we need to:

      1. Update getEncounterByUuid() to return either the encounter matching that UUID or the visit matching that UUID.
      2. Update deleteEncounter the same way.
      3. In createEncounter determine if the encounter submitted is an encounter or visit (based on the provided Encounter.type field. If the Encounter.type field is not provided, the request should be rejected.
      4. Modify updateEncounter in the same way as createEncounter described above.

      To determine if an incoming encounter is an Encounter or a Visit, we should look at the Encounter.type field. If the system property of that field is matches the ENCOUNTER_TYPE_SYSTEM_URI constant then it is an encounter. If it matches the VISIT_TYPE_SYSTEM_URI, then it is a visit. If it is anything else, it should be rejected.

      Gliffy Diagrams


          Issue Links



                medhavi Medhavi Srivastava
                ibacher Ian Bacher
                0 Vote for this issue
                2 Start watching this issue