Skip to content

Patient Management Ingest Events

The Patient Management content block support the events related Healthcare Workers day to day tasks. This goes on from them using of the app to screening, assessment, medical review and managing elements for the patients like test results, counseling and prescriptions.

List of Events

Event Name Type Description
Module Selection module_selection Track when a module is selected on the main screen.
Patient Event patient Track when any action is performed on the patient.
Encounter Event encounter Track when any encounter/assessment is performed on the patient.
Appointment Event appointment Track when an action is performed on appointment.


Module Selection Event

To log module selection in a hcw management app screen. You can select the module type with the log values.

Format

Param Usability Format Enum Values Description
type REQUIRED STRING screening, assessment, enrolment, medical_review, my_patients, prescription, counseling_mgmt, lifestyle_mgmt, psychological_mgmt, investigation, appointment, hcw_mgmt, treatment_plan, transfers, other current module selected by the user in the patient mgmt section on the main screen.
meta OPTIONAL ANY --- Any additional value that is sent with the log.

Usage

     CFPatientMgmtEvent.logIngest(
        eventType = PatientMgmtEventType.ModuleSelection,
        logObject = HcwModuleObject(
            type = PatientMgmtModuleType.Screening,
        )
    )
    let moduleSelectionEvent = HcwModuleObject(
        type: PatientModuleType.Screening.rawValue
    )

    CFPatientMgmtEvent.shared.logIngest(eventType: PatientMgmtEventType.ModuleSelection, logObject: moduleSelectionEvent)
    let patientModuleObject = {
      type: PatientModuleType.Enrolment,
    }

    CfPatientMgmt.logPatientModuleEvent(patientModuleObject)
    {
        "type": "module_selection",
        "props": {
            "type": "screening"
        }
    }


Patient Event

To log any action is performed on the patient such as adding a new patient, updating patient details, or deleting a patient.

Format

Param Usability Format Enum Values Description
patient_id REQUIRED STRING --- id of the patient
site_id REQUIRED STRING --- Site ID where action is happening
action REQUIRED STRING view, add, update, done, remove, other Action that is happening
is_from_gho REQUIRED BOOLEAN --- Is the data fetched from a central repo - default is false.
category REQUIRED STRING facility, community, patient_address, virtual, other Category for site where the action was performed
type REQUIRED STRING triage, outpatient, inpatient, pharmacy, door_to_door, camp, other Type of the category/patient.
sub_type OPTIONAL STRING --- SubType of the category/patient.
biometric_list OPTIONAL ARRAY (Diagnosis Item) --- Details about Patient Biometric values. such as age, gender, height, weight, etc.
pregnancy_details OPTIONAL OBJECT (Pregnancy Detail Object) --- Details about the patient pregnancy values.
registration_date OPTIONAL LONG --- TimeInMillis for the date when the patient was registered
meta OPTIONAL ANY --- Any additional value that is sent with the log.

Usage

     CFPatientMgmtEvent.logIngest(
        eventType = PatientMgmtEventType.Patient,
        logObject = PatientEventObject(
            patientId = "patientID",
            siteId = "SampleSiteId",
            action = HcwItemAction.Add,
            isFromGHO = false,
            category = HcwSiteCategory.Community,
            type = PatientType.Outpatient,
            subType = "some Value",
            biometricList = listOf(
                DiagnosisItem(
                    type = DiagnosisType.Bio,
                    subType = DiagnosisSubType.Age,
                    category = DiagnosisCategory.Given,
                    value = "20",
                    unit = "years",
                    observationTime = System.currentTimeMillis(),
                    remarks = "Some Remarks"
                )
            ),
            pregnancyDetails = null,
            registrationDate = null
        )
    )
    CFPatientMgmtEvent.shared.logIngest(
        eventType: PatientMgmtEventType.Patient,
        logObject: PatientEventObject(
            patientId: "patientID",
            siteId: "SampleSiteId",
            action: HcwItemAction.Add.rawValue,
            isFromGho: false,
            category: HcwSiteCategory.Community.rawValue,
            type: PatientType.Outpatient.rawValue,
            subType: "some Value",
            biometricList: [
                DiagnosisItem(
                    type: DiagnosisType.Other.rawValue,
                    subType: DiagnosisSubType.Age.rawValue,
                    category: DiagnosisCategory.Given.rawValue,
                    value: "20",
                    unit: "years",
                    observationTime: Int64(Date().timeIntervalSince1970 * 1000),
                    remarks: "Some Remarks"
                )
            ],
            pregnancyDetails: nil,
            registrationDate: nil
        )
    )
    let patientObject = {
      patient_id: "patientID",
      site_id: "SampleSiteId",
      action: HcwItemAction.Add,
      is_from_gho: false,
      category: HcwSiteCategory.Community,
      type: PatientType.Outpatient,
      sub_type: "some Value",
      biometric_list: [
        {
          type: DiagnosisType.Bio,
          sub_type: DiagnosisSubType.Age,
          category: DiagnosisCategory.Given,
          value: "20",
          unit: "years",
          observation_time: 12321341234,
          remarks: "Some Remarks"
        }
      ],
      pregnancy_details: null,
      registration_date: null
    }

    CfPatientMgmt.logPatientEvent(patientObject);
    {
        "type": "patient",
        "props": {
            "action": "add",
            "biometric_list": [
              {
                "category": "given",
                "observation_time": 12321341234,
                "remarks": "Some Remarks",
                "sub_type": "age",
                "type": "bio",
                "unit": "years",
                "value": "20"
              }
            ],
            "category": "community",
            "patient_id": "patientID",
            "is_from_gho": false,
            "site_id": "SampleSiteId",
            "sub_type": "some Value",
            "type": "outpatient"
        }
    }


Encounter Event

To log encounter action is performed on the patient such as adding a new encounter/assessment, updating or deleting as well.

Format

Param Usability Format Enum Values Description
patient_id REQUIRED STRING --- id of the patient, involved in the encounter
site_id REQUIRED STRING --- Site ID where action is happening
action REQUIRED STRING view, add, update, done, remove, other Action that is happening
category REQUIRED STRING facility, community, patient_address, virtual, other Category for site where the action was performed
type REQUIRED STRING screening, assessment, enrolment, medical_review, counseling, other Type of the encounter.
sub_type REQUIRED STRING bio, hiv, ncd, tb, ecd, diabetes, hypertension, pregnancy, mental_health, substance_use_disorder, adolescent_health, general_screening, antenatal, postnatal, cervical_cancer, lifestyle, psychological, gender_based_violence, sexual_behaviour, economic_strengthening, other SubType of the encounter.
encounter_summary REQUIRED OBJECT (Encounter Summary Object) --- Details about encounter.
meta OPTIONAL ANY --- Any additional value that is sent with the log.

Usage

     CFPatientMgmtEvent.logIngest(
        eventType = PatientMgmtEventType.Encounter,
        logObject = EncounterEventObject(
            patientId = "patientID",
            siteId = "SampleSiteId",
            action = HcwItemAction.Add,
            category = HcwSiteCategory.Community,
            type = EncounterType.Assessment,
            subType = DiagnosisType.HIV,
            encounterSummaryObject = EncounterSummaryObject(
                encounterId = "SomeEncounterId222",
                appointmentId = "Some Appointment ID",
                encounterTime = System.currentTimeMillis(),
                hcwIdList = listOf("hello"),
                prevDiagnosisStatusList = listOf(),
                diagnosisStatusList = listOf(),
                prevTreatmentPlan = null,
                treatmentPlan = null,
                mainComplaintsList = listOf(),
                diagnosticElements = DiagnosticElementItem(
                    id = "DiagnosticElementItem",
                    investigationList = listOf(),
                    biometricList = listOf(
                        DiagnosisItem(
                            type = DiagnosisType.Bio,
                            subType = DiagnosisSubType.Age,
                            category = DiagnosisCategory.Given,
                            value = "20",
                            unit = "years",
                            observationTime = System.currentTimeMillis(),
                            remarks = "Some Remarks"
                        )
                    ),
                    signSymptomList = listOf(),
                    treatmentAdherenceList = listOf(),
                    healthQuestionnaireList = listOf(
                        DiagnosisQuestionnaireObject(
                            type = DiagnosisType.HIV,
                            subType = DiagnosisSubType.Other,
                            category = DiagnosisQuestionnaireCategory.Assessment,
                            questionList = listOf(
                                DiagnosisQuestionItem(
                                    type = QuestionType.ClosedEnded,
                                    question = "Some Question Text",
                                    reply = "Some Reply here",
                                    score = null,
                                    fullScore = null,
                                    remarks = null,
                                    section = null
                                )
                            ),
                            outcomeList = listOf(
                                DiagnosisOutcomeItem(
                                    type = DiagnosisQuestionnaireOutcomeType.RiskStatus,
                                    subType = null,
                                    value = "high_risk",
                                    remarks = null
                                )
                            ),
                            remarks = null
                        )
                    )
                ),
                pregnancyDetails = null,
                counselingList = listOf(),
                immunizationList = listOf(),
                remarks = "",
                isFollowupId = "",
                isReferralId = "",
                hasFollowup = false,
                hasReferral = false
            )
        )
    )
    CFPatientMgmtEvent.shared.logIngest(
        eventType: PatientMgmtEventType.Encounter,
        logObject: EncounterEventObject(
            patientId: "patientID",
            siteId: "SampleSiteId",
            action: HcwItemAction.Add.rawValue,
            category: HcwSiteCategory.Community.rawValue,
            type: EncounterType.Assessment.rawValue,
            subType: DiagnosisType.HIV.rawValue,
            encounterSummaryObject : EncounterSummaryObject(
                encounterId: "SomeEncounterId",
                appointmentId: "Some Appointment ID",
                encounterTime: 1234234,
                hcwIdList: ["hello"],
                prevDiagnosisStatuslist: [],
                diagnosisStatusList: [],
                prevTreatmentPlan: nil,
                treatmentPlan: nil,
                mainComplaintsList: [],
                diagnosticElements: DiagnosticElementObject(
                    id: "DiagnosticElementItem",
                    investigationList: [],
                    biometricList: [
                        DiagnosisItem(
                            type: DiagnosisType.Bio.rawValue,
                            subType: DiagnosisSubType.Age.rawValue,
                            category: DiagnosisCategory.Given.rawValue,
                            value: "20",
                            unit: "years",
                            observationTime: 1234123,
                            remarks: "Some Remarks"
                        )
                    ],
                    signSymptomList: [],
                    treatmentAdherenceList: [],
                    healthQuestionnaireList: [
                        DiagnosisQuestionnaireObject(
                            type: DiagnosisType.HIV.rawValue,
                            subType: DiagnosisSubType.Other.rawValue,
                            category: DiagnosisQuestionnaireCategory.Assessment.rawValue,
                            questionList: [
                                DiagnosisQuestionItem(
                                    type: QuestionType.ClosedEnded.rawValue,
                                    question: "Some Question Text",
                                    reply: "Some Reply here",
                                    score: nil,
                                    fullScore: nil,
                                    section: nil,
                                    remarks: nil

                                )
                            ],
                            outcomeList: [
                                DiagnosisOutcomeItem(
                                    type: DiagnosisQuestionnaireOutcomeType.RiskStatus.rawValue,
                                    subType: nil,
                                    value: "high_risk",
                                    remarks: nil
                                )
                            ],
                            remarks: nil
                        )
                    ]
                ),
                pregnancyDetails: nil,
                counselingList: [],
                immunizationList: [],
                remarks: "",
                isFollowupId: "",
                isReferralId: "",
                hasFollowup: false,
                hasReferral: false
            )
        )
    )
    let encounterObject = {
      patient_id: "patientID",
      site_id: "SampleSiteId",
      action: HcwItemAction.Add,
      category: HcwSiteCategory.Community,
      type: EncounterType.Assessment,
      sub_type: DiagnosisType.HIV,
      encounter_summary: {
        id: "SomeEncounterId",
        appointment_id: "Some Appointment ID",
        encounter_time: 123123123,
        hcw_id_list: ["hello", "world"],
        prev_diagnosis_status_list: [],
        diagnosis_status_list: [],
        prev_treatment_plan: null,
        treatment_plan: null,
        main_complaints_list: [],
        diagnostic_elements: {
          id: "DiagnosticElementItem",
          investigation_list: [],
          biometric_list: [
            {
              type: DiagnosisType.Bio,
              sub_type: DiagnosisSubType.Age,
              category: DiagnosisCategory.Given,
              value: "20",
              unit: "years",
              observation_time: 12321341234,
              remarks: "Some Remarks"
            }
          ],
          sign_symptom_list: [],
          treatment_adherence_list: [],
          health_questionnaire_list: [
            {
              type: DiagnosisType.HIV,
              sub_type: DiagnosisSubType.Other,
              category: DiagnosisQuestionnaireCategory.Assessment,
              question_list: [
                {
                  type: QuestionType.ClosedEnded,
                  question: "Some Question Text",
                  reply: "Some Reply here",
                }
              ],
              outcome_list: [
                {
                  type: DiagnosisQuestionnaireOutcomeType.RiskStatus,
                  value: "high_risk",
                }
              ],
              remarks: null,
            }
          ]
        },
        pregnancy_details: null,
        counseling_list: [],
        immunization_list: [],
        remarks: "",
        is_followup_id: "",
        is_referral_id: "",
        has_followup: false,
        has_referral: false,
    }
}

CfPatientMgmt.logEncounterEvent(encounterObject);
    {
        "type": "encounter",
        "props": {
            "action": "add",
            "category": "community",
            "encounter_summary": {
              "appointment_id": "Some Appointment ID",
              "counseling_list": [],
              "diagnosis_status_list": [],
              "diagnostic_elements": {
                "biometric_list": [
                  {
                    "category": "given",
                    "observation_time": 12321341234,
                    "remarks": "Some Remarks",
                    "sub_type": "age",
                    "type": "bio",
                    "unit": "years",
                    "value": "20"
                  }
                ],
                "health_questionnaire_list": [
                  {
                    "category": "assessment",
                    "outcome_list": [
                      {
                        "type": "risk_status",
                        "value": "high_risk"
                      }
                    ],
                    "question_list": [
                      {
                        "question": "Some Question Text",
                        "reply": "Some Reply here",
                        "type": "closed_ended"
                      }
                    ],
                    "sub_type": "other",
                    "type": "hiv"
                  }
                ],
                "id": "DiagnosticElementItem",
                "investigation_list": [],
                "sign_symptom_list": [],
                "treatment_adherence_list": []
              },
              "encounter_time": 123123123,
              "has_followup": false,
              "has_referral": false,
              "hcw_id_list": [
                "hello",
                "world"
              ],
              "id": "SomeEncounterId",
              "immunization_list": [],
              "is_followup_id": "",
              "is_referral_id": "",
              "main_complaint_list": [],
              "prev_diagnosis_status_list": [],
              "remarks": ""
            },
            "patient_id": "patientID",
            "site_id": "SampleSiteId",
            "sub_type": "hiv",
            "type": "assessment"
        }
    }


Appointment Event

To log appointment event is performed on the patient such as adding a new appointment, updating or deleting as well.

Format

Param Usability Format Enum Values Description
patient_id REQUIRED STRING --- id of the patient
site_id REQUIRED STRING --- Site ID where action is happening
action REQUIRED STRING view, add, update, done, remove, other Action that is happening
appointment REQUIRED OBJECT (Appointment Item) --- Details about appointment.
meta OPTIONAL ANY --- Any additional value that is sent with the log.

Usage

     CFPatientMgmtEvent.logIngest(
        eventType = PatientMgmtEventType.Appointment,
        logObject = AppointmentEventObject(
            patientId = "taciti",                
            siteId = "efficiantur",
            action = HcwItemAction.Add,
            appointmentItem = AppointmentItem(
                appointmentId = "percipit",
                hcwId = "dui",
                category = HcwSiteCategory.Other,
                status = AppointmentStatus.Missed,
                appointmentDateTime = System.currentTimeMillis(),
                isTimeSensitive = false,
                typeList = listOf(ScheduleItemType.Assessment),
                subTypeList = listOf(DiagnosisType.HIV),
                update = AppointmentUpdateItem(
                    appointmentId = "percipit",
                    reason = "percipit",
                    prevTime = System.currentTimeMillis().minus(100)
                ),
                missed = AppointmentMissedItem(
                    appointmentId = "dolorum",
                    appointmentFollowUpType = AppointmentFollowupType.WhatsApp,
                    followUptime = System.currentTimeMillis().minus(100),
                    response = "conceptam"
                )
            ),
            meta = null

        )
    )
    CFPatientMgmtEvent.shared.logIngest(
        eventType: PatientMgmtEventType.Appointment,
        logObject: AppointmentEventObject(
            patientId = "taciti",                
            siteId = "efficiantur",
            action = HcwItemAction.Add,
            action: HcwItemAction.Add.rawValue,
            appointment: AppointmentItem(
                appointmentId: "percipit",
                hcwId: "dui",
                category: HcwSiteCategory.Other.rawValue,
                status: AppointmentStatus.Missed.rawValue,
                appointmentDateTime: 123123,
                isTimeSensitive: false,
                typeList: [ScheduleItemType.Assessment.rawValue],
                subTypeList: [DiagnosisType.HIV.rawValue],
                update: AppointmentUpdateItem(
                    appointmentId: "percipit",
                    reason: "percipit",
                    prevTime: 123
                        ),
                missed: AppointmentMissedItem(
                    appointmentId: "dolorum",
                    appointmentFollowUpType: AppointmentFollowupType.WhatsApp.rawValue,
                    followUptime: 111111,
                    response: "conceptam"
                )
            )
        )
    )
    let appointmentObject = {
        patient_id: "taciti",
        site_id: "efficiantur",
        action: HcwItemAction.Add,
        appointment: {
            id: "percipit",
            hcw_id: "dui",
            category: HcwSiteCategory.Other,
            status: AppointmentStatus.Missed,
            time: 123123123,
            is_time_sensitive: false,
            type_list: [ScheduleItemType.Assessment],
            sub_type_list: [DiagnosisType.HIV],
            update: {
              id : "percipit",
              reason : "percipit",
              prev_time : 123123
            },
            missed: {
              id : "dolorum",
              type : AppointmentFollowupType.WhatsApp,
              time : 131232,
              response : "conceptam"
            },
        },
}

CfPatientMgmt.logAppointmentEvent(appointmentObject);
    {
        "type": "appointment",
        "props": {
            "patient_id": "patientId",
            "site_id": "efficiantur",
            "action": "add",
            "appointment": {
                "category": "other",
                "hcw_id": "someHealthCareWorkerId",
                "id": "appointmentId",
                "is_time_sensitive": false,
                "missed": {
                    "id": "missedAppointmentId",
                    "response": "Some response text here",
                    "time": 131232,
                    "type": "whatsapp"
                },
                "status": "missed",
                "sub_type_list": [
                    "hiv"
                ],
                "time": 123123123,
                "type_list": [
                    "assessment"
                ],
                "update": {
                    "id": "updateappointmentId",
                    "prev_time": 123123,
                    "reason": "some update reason"
                }
            }
        }
    }