opensrp / fhircore

FHIR Core / OpenSRP 2 is a Kotlin application for delivering offline-capable, mobile-first healthcare project implementations from local community to national and international scale using FHIR and WHO Smart Guidelines on Android.
https://opensrp.io
Apache License 2.0
56 stars 59 forks source link

CHW/ANC SubTask - Create a ANC Patient Encounter #406

Closed f-odhiambo closed 2 years ago

f-odhiambo commented 3 years ago

An Encounter is an interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. A patient encounter is further characterized by the setting in which it takes place. Amongst them are ambulatory, emergency, home health, inpatient and virtual encounters.

An Encounter encompasses the lifecycle from pre-admission, the actual encounter (for ambulatory encounters), and admission, stay and discharge (for inpatient encounters).

During the encounter, the patient may move from practitioner to practitioner and location to location. Possible fields to be captured

  1. Encounter.status
  2. Encounter.statusHistory.status
  3. Encounter.type
  4. Encounter.serviceType
  5. Encounter.priority
  6. Encounter.participant.type
  7. Encounter.location.status
  8. Encounter.location.physicalType

Linking fields

  1. Encounter.subject -> Patient

Sample StrucutreDefiniotn attached here

Subtasks

LOE for subtasks in individual tickets

pld commented 3 years ago

How does this fit in to the unified resource diagram?

Is there a Task for a CHW visit, how does this relate to that?

f-odhiambo commented 3 years ago

I think this is covered in the diagram unless am missing something

image

pld commented 3 years ago

OK cool! Let's add to the list of fields to capture, how we'll capture the links to other resources

pld commented 3 years ago

Added Patient, I think we need to be more specific on what this Encounter is to encode, this looks like maybe it's an implementation issue for

f-odhiambo commented 3 years ago

A while back I and Brynn worked on this ANC use case scenario to record the 1st ANC contact. This scenario illustrates the resources involved in the application of the WHO IG at the first contact for a new patient. Here is a list of profiles that can be applicable for ANC /CHW use case

Underlying data

  1. CareTeam/anc-team

The Use case

  1. ​The mother presents at the clinic, resulting in the creation of the Patient/charity
  2. ​The mother self-reports pregnancy, resulting in the creation of the Condition/charity-pregnancy
  3. The pregnancy triggers the application of the guideline, resulting in the creation of:
  1. ​the EpisodeOfCare/charity-pregnancy-episode
  2. ​the Encounter/charity-first-contact - StrucutreDefinition given here
  3. ​the Goal/charity-pregnancy-goal
  4. ​the CarePlan/charity-pregnancy-plan
  1. ​Filling out the profile results in an Observation of LMP Observation/charity-LMP, allowing gestational age to be calculated
  2. Recommendation B.1.1 is triggered to evaluate whether or not an anaemia test is due for the mother. Since this example is for a first contact scenario and no anaemia test (Observation) exists for the mother, a recommendation is triggered to perform an anaemia test - in this case, the recommendation is to perform a Full Blood Count test since that is the preferred method and is configured as the default test method.
  3. ​Tests result in the recording of Hb Observation/charity-HB, indicating anaemia and triggering recommendation #A2
  1. Recommendation A2 evaluates the “Has Anaemia” condition in the common library, resulting in true
  2. The ActivityDefinition/anc-120mg-daily-elemental-iron is applied, creating
  3. ​A proposal (or recommendation): MedicationRequest/charity-daily-elemental-iron-recommendation
  4. ​Acting on that recommendation, the provider creates an order: MedicationRequest/charity-daily-elemental-iron-prescription
  1. ​Finalizing the encounter involves a service request for a follow-up visit: ServiceRequest/charity-second-contact

CC @isabelcshaw @pld- We can record this as ​the Encounter/charity-first-contact - StrucutreDefinition given here

pld commented 3 years ago

Cool that looks great, how do we represent the link to the CareTeam?

f-odhiambo commented 3 years ago

Researching on this still . The Location hierarchy stuff may also influence how that is done by. Will update once done

f-odhiambo commented 3 years ago

Here is a StructureDefinition for the CareTeam

CareTeam.language | preferred | CommonLanguagesMax Binding: AllLanguages
CareTeam.identifier.use | required | IdentifierUse
CareTeam.identifier.type | extensible | Identifier Type Codes
CareTeam.status | required | CareTeamStatus
CareTeam.category | example | CareTeamCategory
CareTeam.participant.role | example | ParticipantRoles
CareTeam.reasonCode | example | SNOMEDCTClinicalFindings
CareTeam.telecom.system | required | ContactPointSystem
CareTeam.telecom.use | required | ContactPointUse
pld commented 3 years ago

K, is the only connection between the CareTeam and Encounter due to the connection between the Patient and the CareTeam?

f-odhiambo commented 3 years ago

Yes. I would further summarize the care team structure using the following FHIR Resource JSON code snippet

A CareTeam

{
  "resourceType": "CareTeam",

contains a practitioner


  "contained": [
    {
      "resourceType": "Practitioner",
      "id": "pr1",
      "name": [
        {
          "family": "Nurse",
          "given": [
            "Mabel"
          ]
        }
      ]
    }
  ],

and has a unique identifier

  "identifier": [
    {
      "value": "12345"
    }
  ],

and its status could be proposed | active | suspended | inactive | entered-in-error

  "status": "active",

and the category for the CareTeam is an Encounter-focused care team - in this case to Check Pregnancy status

  "category": [
    {
      "coding": [
        {
          "system": "http://loinc.org",
          "code": "82810-3",
          "display": "Pregnancy status"
        }
      ]
    }
  ],

and the Care team name is

  "name": "Careteam  for ANC",

Taking care of a patient as the subject in this case Mary Ann

  "subject": {
    "reference": "Patient/example",
    "display": "Mary Ann"
  },

with Encounter ID

  "encounter": {
    "reference": "Encounter/example"
  },

for the period dated

  "period": {
    "end": "2021-01-01"
  },

CareTeam.participant - Identifies all people and organizations who are expected to be involved in the care team.

  "participant": [
    {
      "role": [
        {
          "text": "responsiblePerson"
        }
      ],
      "member": {
        "reference": "Patient/example",
        "display": "Mary Ann"
      }
    },

CareTeam.participant.role - Indicates specific responsibility of an individual within the care team, such as "Primary care physician", "Trained social worker counsellor", "Caregiver", etc.

    {
      "role": [
        {
          "text": "adviser"
        }
      ],
      "member": {
        "reference": "#pr1",
        "display": "Nurse Mabel"
      },
      "onBehalfOf": {
        "reference": "Organization/BA"
      },
      "period": {
        "end": "2021-02-01"
      }
    }
  ],

CareTeam.managing organization - The organization responsible for the care team.

  "managingOrganization": [
    {
      "reference": "Organization/BA"
    }
  ]
}
pld commented 3 years ago

Oh ok cool so I was incorrect, the CareTeam can link directly to the Encounter, will we want to make use of that?

Thinking operationally...

  1. There is an existing CareTeam, Groups, and Patients (will use Patient below to mean either below)
  2. When a Patient changes (including is first assigned a) location
    1. Remove the Patient from any CareTeams it's currently in
    2. See if the Patient's Location (which is GPS?) is within any CareTeam's Organization's OrganizationAffiliation's Location (which is a Jurisdiction)

Right now we don't have a direct link from Patient to CareTeam or Encounter to CareTeam, I will add those in the diagram.

I don't think we can do 2.ii. since GPS isn't in the Location hierarchy, did we have another way we are planning to do this?

isabelcshaw commented 3 years ago

@pld if there are some location constraints here, we could potentially address them in registration? Aka for the CHW implementation, it is generally safe to say that a family/patient is associated with the same location/catchment as the CHW who enrolls them and take location from that. Or, we could add a field beyond GPS to the registration form itself.

For Liberia, we don't have any facility interaction, so the only case we'd need to cover is if a family moves to a new catchment. And, as an MVP, we could just mark families as moved and "deactivate" them for the CHA. And later address the possibility of reassignment in a single step.

maimoonak commented 3 years ago

@f-odhiambo do we have an ANC visit form/questionnaire? What fields shall we capture and what codes should it be mapped to. So basically its kind of a pre-req for ANC details screen where we need data for EDD, GA, and basic ANC registration. @RaaziaTarique

f-odhiambo commented 3 years ago

@f-odhiambo do we have an ANC visit form/questionnaire? What fields shall we capture and what codes should it be mapped to. So basically its kind of a pre-req for ANC details screen where we need data for EDD, GA, and basic ANC registration. @RaaziaTarique

@maimoonak @RaaziaTarique I think part of the details lies here https://docs.google.com/document/d/1dl7VdPFsqRujSROEMGnN7gs4xRUzhEvra4XruX6PdRc/edit but Ill let @isabelcshaw review and revert back

maimoonak commented 3 years ago

I see the form fields are defined and provides details about constraints, names, relevances. However, these are mapped to openmrs concepts. We need to map the concepts to LOINC or SNOMED codes.

f-odhiambo commented 3 years ago

@syedowaisali90 once the ANC flow is complete as described in the comment then create the following resources

  1. Condition
    {
    "resourceType" : "Condition",
    "clinicalStatus" : {
    "coding" : [
      {
        "system" : "http://terminology.hl7.org/CodeSystem/condition-clinical",
        "code" : "active"
      }
    ]
    },
    "verificationStatus" : {
    "coding" : [
      {
        "system" : "http://terminology.hl7.org/CodeSystem/condition-ver-status",
        "code" : "confirmed"
      }
    ]
    },
    "category" : [
    {
      "coding" : [
        {
          "system" : "http://terminology.hl7.org/CodeSystem/condition-category",
          "code" : "problem-list-item",
          "display" : "Problem List Item"
        }
      ]
    }
    ],
    "code" : {
    "coding" : [
      {
        "system" : "http://example.org/tbd",
        "code" : "TBD",
        "display" : "Pregnancy"
      }
    ],
    "text" : "Pregnancy"
    },
    "subject" : {
    "reference" : "Patient/XXX"
    },
    "onsetDateTime" : "XXXX-05-22" 
    }
  2. Episode of Care
{
  "resourceType" : "EpisodeOfCare",
  "status" : "active",
  "type" : [
    {
      "coding" : [
        {
          "system" : "http://terminology.hl7.org/CodeSystem/episodeofcare-type",
          "code" : "hacc",
          "display" : "Home and Community Care"
        }
      ]
    }
  ],
  "diagnosis" : [
    {
      "condition" : {
        "reference" : "Condition/XXXX "
      },
      "role" : {
        "coding" : [
          {
            "system" : "http://terminology.hl7.org/CodeSystem/diagnosis-role",
            "code" : "CC",
            "display" : "Chief complaint"
          }
        ]
      },
      "rank" : 1
    }
  ],
  "patient" : {
    "reference" : "Patient/XXX"
  },
  "period" : {
    "start" : "XXXX-05-22"
  }
}
  1. Encounter
    
    {
    "resourceType" : "Encounter",
    "status" : "in-progress",
    "class" : {
    "system" : "http://terminology.hl7.org/CodeSystem/v3-ActCode",
    "code" : "TBD",
    "display" : "Home Visit"
    },
    "type" : [
    {
      "coding" : [
        {
          "system" : "http://example.org/CodeSystem/encounter-type",
          "code" : "anc-contact",
          "display" : "Antenatal care contact"
        }
      ],
      "text" : "Antenatal care contact"
    }
    ],
    "subject" : {
    "reference" : "Patient/XXX"
    },
    "episodeOfCare" : [
    {
      "reference" : "EpisodeOfCare/XXX"
    }
    ],
    "participant" : [
    {
      "type" : [
        {
          "coding" : [
            {
              "system" : "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
              "code" : "PPRF",
              "display" : "primary performer"
            }
          ]
        }
      ],
      "individual" : {
        "reference" : "Practitioner/XXX"
      }
    }
    ],
    "period" : {
    "start" : "XXXX-05-24"
    },
    "diagnosis" : [
    {
      "condition" : {
        "reference" : "Condition/XXX"
      },
      "rank" : 1
    }
    ]
    }
3. Goal 

{ "resourceType" : "Goal", "lifecycleStatus" : "active", "subject" : { "reference" : "Patient/XXX", "display" : "Name of ANC Client" } }


4. CarePlan - _To Be Discussed_ 
maimoonak commented 3 years ago

@dubdabasoduba looks like we are creating an IG here. For IGs I have seen people provide templates and some modifiable properties like we do have for SDC Questionnaires. So for e.g. here Condition for us is our own custom IG fhir-pregnancy-condition. This ideally should provide default implementation/template and we should modify only subject/onset.

Rightnow we are using a json template into our app with name pregnancy-condition-template and in future it should be picked from our synced IG resource i.e. StructureDefinition for pregnancy-condition.

Plz suggest different approaches we can use in future for this

Same is the case of other entities

maimoonak commented 3 years ago

@dubdabasoduba are we sending this info with login? "individual" : { "reference" : "Practitioner/XXX" } @f-odhiambo what it should be for encounter? We already have a diagnosis with EpisodeOfCare, so can skip this if there is nothing specific to this visit... "diagnosis" : [ { "condition" : { "reference" : "Condition/XXX" }, "rank" : 1 } ]

maimoonak commented 3 years ago

@f-odhiambo it somewhat overlaps and contradict with the mocks attached in #416 . The first encounter can not determine #of fetuses unless an ultrasound is done. Also I think we can associate the Observations created in form with encounter created here (omitting fetuses). We also need to think a way have EDD represented central to current episode of care as it is updated after ultrasound results or if health practitioner decides to do so

pld commented 3 years ago

Agree, this seems to be replaced by #416

maimoonak commented 3 years ago

@pld @f-odhiambo @dubdabasoduba The implementation of these resources was done including CarePlan with #288 and #416 . However, this is done with templates used on mobile side. We need to find out a way to create these IGs or Templates or Workflow on server and then use those. i.e. load template from DB instead of assets folder. Initially I had thought to use the URLs inside WHO guide itself but then those are not working and also we should not rely on external sources which keep changing frequently.

pld commented 3 years ago

sounds like this may overlap with some of the upcoming work on Quest, or at functionality we build for that may be related to organizing and loading of resources useful to this

pld commented 3 years ago

should we close this?

f-odhiambo commented 3 years ago

@pld I will close a majority of the issues as we close the sprint on Monday and begin a new one

f-odhiambo commented 2 years ago

Converting this into a discussion son as to preserve the information