Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6204 name insurance join #6395

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open

Conversation

jmbrunskill
Copy link
Contributor

Fixes #6204

πŸ‘©πŸ»β€πŸ’» What does this PR do?

Adds sync for nameInsuranceJoin to open-mSupply

πŸ’Œ Any notes for the reviewer?

πŸ§ͺ Testing

For dev testing, we can do something like this...

  • Create an insuranceProvider in 4d
  • Choose a patient in your database and get their ID
    Run an insert record something like this in the database
    INSERT INTO "main"."name_insurance_join" ("id", "name_link_id", "insurance_provider_id", "policy_number", "policy_type", "discount_percentage", "expiry_date", "is_active") VALUES ('TEST_NAME_INSURANCE_JOIN', 'PATIENT_NAME_ID', 'INSURANCE_PROVIDER_ID', '2312', 'business', 10, '2027-01-01', 'true');
    Then insert the changelog
    INSERT INTO changelog (cursor, table_name, record_id, row_action) VALUES ((SELECT max(cursor)+1 FROM changelog), 'name_insurance_join', 'TEST_NAME_INSURANCE_JOIN' ,'UPSERT')
  • Sync
  • Check the name has the new record assigned
28819

πŸ“ƒ Documentation

  • Part of an epic: documentation will be completed for the feature as a whole
  • No documentation required: no user facing changes or a bug fix which isn't a change in behaviour
  • These areas should be updated or checked:
    1.
    2.

@github-actions github-actions bot added this to the v2.6.0 milestone Feb 3, 2025
@github-actions github-actions bot added Team Piwakawaka James, Carl, John, Zachariah feature: dispensing labels Feb 3, 2025
@CarlosNZ CarlosNZ self-assigned this Feb 4, 2025
Copy link
Contributor

@CarlosNZ CarlosNZ left a comment

Choose a reason for hiding this comment

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

Looks good as far as I can tell. Just that failing sync due the PG Enums to sort out, plus those suggestions re the OMS schema fields.

Comment on lines +42 to +44
policy_number_person TEXT,
policy_number_family TEXT,
policy_number TEXT NOT NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed, probably want to make "person" and "family" just boolean flags in OMS, and just translate them to OG?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've checked in mSupply, it looks like if both fields are filled in, they're combined in to the full field.
E.g. 123-321

So I think we probably want to keep it how it is...

policy_number_family TEXT,
policy_number TEXT NOT NULL,
policy_type {policy_type} NOT NULL,
discount_percentage INTEGER NOT NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can policy_type be null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doesn't look like it in OG, so I think it's ok to keep it as NOT NULL.

@jmbrunskill jmbrunskill requested a review from CarlosNZ February 4, 2025 03:03
Copy link
Contributor

@CarlosNZ CarlosNZ left a comment

Choose a reason for hiding this comment

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

Couple of quick things before approve:

  • The "discount percentage" in mSupply accepts non-integer values, so we should probably make our field float rather than integer?
  • The syncing only seems to be going one way (from OMS-> to OG) -- if I add a policy to a user in mSupply it doesn't sync back. Is this what we're expecting at the moment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: dispensing Team Piwakawaka James, Carl, John, Zachariah
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sync and Translate nameInsuranceJoin table
2 participants