Repository navigation
feat(profile): insurance number by country - #1660
Merged
Merged
Conversation
The insurance number followed one rule, the German KVNR, so an Austrian social insurance number or a US member ID was refused. The number now follows a country, any ISO 3166-1 alpha-2 code, stored beside it (insuranceNumberCountry; a number stored without one stays German). One module, src/lib/validations/insurance-number.ts, holds the rule: DE KVNR, AT SVNR, CH AHV number, NL BSN and FR NIR are checked by their check digit; every other country takes 3 to 30 letters, digits, spaces, hyphens or dots as entered. A US plan carries its group number (insuranceGroupNumber), cleared for every other country. The profile update checks the number under the country sent with it, or the stored one, and refuses a country change the stored number would fail; each refusal carries a per-rule code the form words in every language. The doctor's report prints the number in its country's form. The FHIR Patient identifier uses the national system where one is published (gematik KVNR, Austrian svnr-eHealth OID, CH AHVN13, Nictiz BSN, French INS-NIR), otherwise type MB with no system, and the group number rides Coverage.class. Additive on the profile read and write, feature key profile.insurance-number-country. Migration 0577 adds the two nullable columns; backup, wipe and the account seed carry them. Refs #1658
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The insurance number on the profile follows a country now, not only the German KVNR.
insuranceNumberCountry(ISO 3166-1 alpha-2, nullable; a number stored without one stays DE) andinsuranceGroupNumber(US only) on the profile read and write,/api/auth/meand the backup. Migration 0577 adds both columns, nullable, no backfill.src/lib/validations/insurance-number.ts: DE KVNR, AT SVNR, CH AHV number, NL BSN and FR NIR by check digit; every other country 3 to 30 letters, digits, spaces, hyphens or dots, as entered. Tests cover valid and invalid numbers for each.applyProfileUpdatechecks the number under the country sent with it, else the stored one, and refuses a country change the stored number would fail. Refusals carryinvalid_kvnr,invalid_svnr,invalid_ahv,invalid_bsn,invalid_nirorinvalid_member_id, worded per rule in all ten locales.svnr-eHealthOID 1.2.40.0.10.1.4.3.1, CH AHVN13urn:oid:2.16.756.5.32, Nictiz BSN, INS-NIRurn:oid:1.2.250.1.213.1.4.8), otherwise typeMBwith no system; the group number goes onCoverage.class(group).profile.insurance-number-country; OpenAPI regenerated.Refs #1658