serenity-health / roadmap

Public roadmap for development of Serenity's apps reported by our community of users
0 stars 1 forks source link

feature/link patient profiles #43

Open chris-dare opened 2 years ago

chris-dare commented 2 years ago

Tell us about your request! Should be able to see patient history across their multiple duplicate patient records

Which app does this concern? Provider portal

What will be benefit of this feature? Practitioners will have a 360 view of the patient

Describe the solution you'd like Implement patient link: https://www.hl7.org/fhir/patient.html#links

Describe alternatives you've considered Merging patient profiles however more complex

Additional context N/A

chris-dare commented 2 years ago

Important to accelerate this. For duplicate patients, it creates the impression that consultation notes are not being saved

chris-dare commented 2 years ago

Link patient prototype available here: https://www.figma.com/proto/f29U89yv9q1HvYVaStLIl9/SERENITY-EMR-(PRODUCTION-%E2%9C%85)?page-id=3695%3A30706&node-id=3695%3A31062&viewport=292%2C48%2C0.13&scaling=min-zoom&starting-point-node-id=3695%3A31062&show-proto-sidebar=1

Thanks for completing this @agbavorrichmond. @seddie62 had some concerns. I asked her to share them with you

chris-dare commented 2 years ago

@TuyizereBapt, here's what you need for the API implementation

  1. Implement a model called PatientLink in patient.models. Like most models it should inherit from fhirresourcemanager.models.ResourceModel Properties: a. primary_patient: Patient b. linked_patient: Patient c. performed_by: User d. performing_practitioner: Practitioner e. performer_name: Text f. comment: Text g. is_active: Boolean

    • unique_together -> (primary_patient, linked_patient)
    • None of the fields above should be null or allow blank
    • To ensure that there are not errors, the primary patient and the link patient must both share the same birth date and mobile number
  2. Implement an API with the url: {base_url}/providers/{provider_id}/patient_links/{primary_patient_id} Method should be POST This should accept a payload of a list of PatientLink objects and return the linked patients that have been saved in the database Input:

    {
    "primary_patient": "id",
    "linked_patient": ["patient_id1", "patient_id2"],
    "comment: "text goes here"
    }

Output:

[
  {
    "uuid": "uuid",
    "primary_patient": "id",
    "linked_patient": "id",
    "comment": "text goes here",
    "performing_practitioner": "practitioner_id",
    "performer_name": "name",
    "is_active": True,
    "created_at": date
  },
    {
    "uuid": "uuid",
    "primary_patient": "id",
    "linked_patient": "id",
    "comment": "text goes here",
    "performing_practitioner": "practitioner_id",
    "performer_name": "name",
    "is_active": True,
    "created_at": date
  }
]
  1. Update the Patient.get_duplicate_profiles method such that: a. It also returns the linked_patient profiles where self is the primary_patient b. It also returns the primary_patient with its other linked_patients profiles where self is the linked_patient

cc: @seddie62

chris-dare commented 2 years ago

Hi @seddie62,

API for link patients is done and available for integration on demo: https://serenity-health.readme.io/reference/patients#link-patients

Contact @TuyizereBapt if you have any questions.

chris-dare commented 2 years ago

Guys, also I want us to use the issue threads to communicate as well. It's helpful to track the progress of what's going on

chris-dare commented 2 years ago

@TuyizereBapt I've tried this out on demo. There are some duplication constraint exceptions being thrown by the API. Please reach out to Seddie and test with her. @seddie62 please give @TuyizereBapt a primer on what you integrated tomorrow

chris-dare commented 2 years ago

Sharing feedback post review:

We need cover 3 cases:

  1. All patients linked in operation (success)
  2. Some patients linked in operation (success)
  3. No patients linked in operation (success)

Important to display "x out of n patients linked" in API response message