generated from NHSDigital/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
[GPCAPIM-287] Orange box #105
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
Open
Vox-Ben
wants to merge
18
commits into
main
Choose a base branch
from
feature/GPCAPIM-287-orange_box
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f9bf926
Add pyjwt, clinical_jwt, make ruff happy
Vox-Ben be50346
Review comments
Vox-Ben 78ef3f4
Make ruff happy, refactor controller JWT test
Vox-Ben b2e9906
Start of orange box connection
Vox-Ben e0e8212
Orange box working with debug script
Vox-Ben 8d9e6d9
Orange box connection working
Vox-Ben 3debed4
Pass $STUB_PROVIDER
Vox-Ben 2a84311
Pass STUB env vars
Vox-Ben 22a7499
Create call script
Vox-Ben d6db976
Fix algorithm string none
Vox-Ben dfd80cd
Tidy up error handling
Vox-Ben e142d0a
Add request validation to provider stub
Vox-Ben 4d05553
Fix rebase mess and tidy up
Vox-Ben 335eb79
Update TODO comment
Vox-Ben 36e7f7f
Improve test coverage
Vox-Ben 6db5298
Fix JWT default times and encoding value
Vox-Ben 42e28df
Move FHIR constants to single enum
Vox-Ben d34747c
Remove now-duplicate scripts dir
Vox-Ben File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from enum import StrEnum | ||
|
|
||
|
|
||
| class FHIRSystem(StrEnum): | ||
| """ | ||
| Enum for FHIR identifier systems used in the clinical data gateway. | ||
| """ | ||
|
|
||
| NHS_NUMBER = "https://fhir.nhs.uk/Id/nhs-number" | ||
| ODS_CODE = "https://fhir.nhs.uk/Id/ods-organization-code" | ||
| SDS_USER_ID = "https://fhir.nhs.uk/Id/sds-user-id" | ||
| SDS_ROLE_PROFILE_ID = "https://fhir.nhs.uk/Id/sds-role-profile-id" | ||
| NHS_SERVICE_INTERACTION_ID = "https://fhir.nhs.uk/Id/nhsServiceInteractionId" | ||
| NHS_MHS_PARTY_KEY = "https://fhir.nhs.uk/Id/nhsMhsPartyKey" | ||
| NHS_SPINE_ASID = "https://fhir.nhs.uk/Id/nhsSpineASID" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| from .device import Device | ||
| from .jwt import JWT | ||
| from .organization import Organization | ||
| from .practitioner import Practitioner | ||
| from .validator import JWTValidator | ||
|
|
||
| __all__ = ["JWT", "Device", "Practitioner"] | ||
| __all__ = ["JWT", "Device", "Organization", "Practitioner", "JWTValidator"] |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| from dataclasses import dataclass | ||
| from typing import Any | ||
|
|
||
| from fhir.constants import FHIRSystem | ||
|
|
||
|
|
||
| @dataclass(frozen=True, kw_only=True) | ||
| class Organization: | ||
| ods_code: str | ||
| name: str | ||
|
|
||
| def to_dict(self) -> dict[str, Any]: | ||
| """ | ||
| Return the Organization as a dictionary suitable for JWT payload. | ||
| """ | ||
| return { | ||
| "resourceType": "Organization", | ||
| "identifier": [ | ||
| { | ||
| "system": FHIRSystem.ODS_CODE, | ||
| "value": self.ods_code, | ||
| } | ||
| ], | ||
| "name": self.name, | ||
| } |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.