Repository navigation
Generate the TypeScript FHIR Schemas from the Implementation Guides - #47
Draft
PSchmiedmayer wants to merge 31 commits into
Draft
PSchmiedmayer wants to merge 31 commits into
PSchmiedmayer wants to merge 31 commits into
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces a large, generator-driven surface-area change (many regenerated artifacts/config shifts), and there is at least one verified exported-type correctness issue that should be addressed before approval.
Review details
- Files reviewed: 98/1003 changed files
- Comments generated: 1
- Review effort level: Lite
Comment on lines
+13
to
+16
| /** Exact code union from the required FHIR R4 ResourceType value set. */ | ||
| export type R4ResourceType = | ||
| (typeof resourceTypeCodes)[number] | 'DomainResource' | ||
|
|
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces large, cross-cutting generated-contract and tooling changes where a full correctness/compatibility review requires broader human validation beyond the visible diffs.
Review details
- Files reviewed: 98/1003 changed files
- Comments generated: 0 new
- Review effort level: Lite
Merged
1 task done
… the Base Language
This branch has not been deployed
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.
♻️ Current situation & Problem
We need one place to define the FHIR structures exchanged across Grove and a deterministic way to keep every language implementation aligned with that contract. The Grove FHIR Implementation Guides are authoritative:
mobilecarries the shared exchange contract, while the adapter guides define source-specific claims.The FHIR types and Zod schemas in
packages/fhirwere maintained by hand across hundreds of files. That does not scale to the supported surface and cannot reliably prevent TypeScript from diverging from Swift, Kotlin, or the published Implementation Guides.This change generates the package contracts, measurement catalog, and conformance fixtures from the Implementation Guides. The source archive is checksum-pinned to SchmiedmayerLab/grove-fhir#42 (
9c5eff4), which settles the producer contract shared with Swift and Kotlin, so regeneration is reproducible and any drift becomes a failing build. The commits fromf350506onward align this package with it; everything before them is unchanged.⚙️ Release Notes
application/jsonpayloads and omit release-coupledCoding.versionfrom recording instances.Producer alignment with grove-fhir#42 (
f350506onward):deriveOpaqueIdentitySystemsderives all twelve deployment identifier systems from one root, key id and epoch. Systems are a brandedIdentifierSystem(parseIdentifierSystem).deriveSourceRecordIdentityandderiveProviderRecordIdentitymint output and artifact identities from their record.deriveOpaqueIdentifierno longer accepts the record kinds. The part index is a branded canonical unsigned decimal (parsePartIndex).StudyEnrollment(protocolUrl,protocolVersion) bundles ResearchStudy, PlanDefinition and ResearchSubject.isSemanticallyEqualdecides retry equality over lossless JSON tokens with a dependency-free tokenizer.IssueCodeis closed to schema codes plus the generated registry codes. Of the 37 former local codes, 21 are registered and 16 folded into existing rules.ProducerDiagnosticcarries the registryreason, andisProducerDiagnosticnarrows to it.locationis optional, so a refusal needs no pointer.Result.warningsuses themobile-omission.*codes; asource-offsetwarning names the element inlocation.WriterreplacessourceAuthor.gateway-applicationis a converter role. The docs recommend a form for application and host device tokens./mobile. A.d.tssurface snapshot sits beside the runtime export snapshot.languageis required on Questionnaires and responses; translations use the standardtranslationextension and are kept;buildQuestionnaireResponse(input, questionnaire)writes the response language and writes item text and coded answer displays only in the base language. Pair checks reportpair-item-textandpair-response-language, and single-resource checks reportqg-language-required,gqr-language-requiredandqg-translation-1, all asQuestionnaireRuleCode.Breaking: identifier systems require
parseIdentifierSystem.StudyEnrollment.protocolbecomesprotocolUrlandprotocolVersion, andsourceAuthorbecomeswriter.ProviderOutputCoordinatesbecomesOutputCoordinateswithroleanddiscriminator. Record kinds go through the record identity functions.buildQuestionnaireResponsetakes the Questionnaire it answers, and its input drops thequestionnairecanonical and itemtext.📚 Documentation
The package documentation explains the public TypeScript surface and links to the authoritative Implementation Guides instead of restating version-specific contracts.
✅ Testing
2034f2c, locally against the archive fetched and digest-checked from9c5eff4:@schmiedmayerlab/grove-fhir: 1023 tests in 35 suites.Code of Conduct & Contributing Guidelines
By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: