Skip to content

Conversation

@sugat009
Copy link
Member

@sugat009 sugat009 commented Jul 16, 2025

Description

Adds Subscription of Claim resource of OpenIMIS. Also, later on added support on processing the Claim resource Provided by OpenIMIS and then, sending back the feedback data on the same Claim resource back to OpenIMIS as Communication resource.

#167

This PR will be in draft because the task is still in POC phase. The tests in the CI is failing as well because they are not true unit tests. They will be converted once this task takes some form of finalization.

Code review checklist

  • Readable: Concise, well named, follows the style guide, documented if necessary.
  • Documented: Configuration and user documentation on cht-docs
  • Tested: Unit and/or e2e where appropriate
  • Backwards compatible: Works with existing data and configuration or includes a migration. Any breaking changes documented in the release notes.

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

@sugat009 sugat009 requested review from PrjShrestha and witash July 16, 2025 15:04
@sugat009 sugat009 self-assigned this Jul 16, 2025
@sugat009 sugat009 linked an issue Jul 16, 2025 that may be closed by this pull request
Copy link
Contributor

@witash witash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a function for creating subscriptions in utils/fhir.ts

It is used in the loss to follow up workflow, for what seems to be a similar use case.
Instead of creating new functions for OpenIMIS specifically, can we use that, or, if not, modify it to make it more generic?

@sugat009
Copy link
Member Author

There is a function for creating subscriptions in utils/fhir.ts

It is used in the loss to follow up workflow, for what seems to be a similar use case. Instead of creating new functions for OpenIMIS specifically, can we use that, or, if not, modify it to make it more generic?

That function is not reusable at all for OpenIMIS use-case but I could make the createSubscriptionPayload and subscribe or other functions more generic. Should these generic functions be put in the fhir.ts file or somewhere else?

@witash
Copy link
Contributor

witash commented Jul 21, 2025

I could make the createSubscriptionPayload and subscribe or other functions more generic. Should these generic functions be put in the fhir.ts file or somewhere else?

Yea, the idea is not to have LTFU subscription and OpenIMIS subscription and OpenMRS subscription but a single subscription that works for any fhir api. could put it in fhir.ts or maybe create another utils file if it makes sense.

@sugat009
Copy link
Member Author

@witash I've refactored createFHIRSubscriptionResource function from mediator/src/utils/fhir.ts as a single function that will request the Subscription endpoint. I've left the generateFHIRSubscriptionResource from mediator/src/utils/fhir.ts and createFhirSubscriptionPayload from mediator/src/utils/openimis.ts because they are creating payloads from the passed params for different things.

/**
* Interface for the Subscription Channel object.
*/
interface SubscriptionChannel {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the types from the fhir module here instead of redefining them?

@sugat009 sugat009 requested a review from witash July 23, 2025 08:01
@sugat009 sugat009 changed the title feat(#167): Add Subscription workflow with OpenIMIS feat(#167): Add Subscription and Feedback workflow with OpenIMIS Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 2: Implementation of Subscription workflow

4 participants