diff --git a/aidbox-features/aidbox-orchestration-service/.env.example b/aidbox-features/aidbox-orchestration-service/.env.example new file mode 100644 index 0000000..bac1cb4 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/.env.example @@ -0,0 +1,6 @@ +# SMART Backend Services credentials +# Test RSA private key (PKCS#8) — matches public key in general-practice-config/init.json +# Use \n for newlines +SMART_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC+EfYcGCDTGRh8\natyBcMQP5ehtE3bv06VaQCLk+uDV0+CPjsLxO+5XRiAUOg9ea2Gufw72DLNpUd30\ndo7d50iaqmDfC/ixCy0UXT0UHjHQNfqUizhJY1/AVj4HaxubGkpK/FVeIzpBEG8L\nruDqGCZflPkjDMYVTeb6Gk4ZnnSLIJWZE6ZCwWvFT9fFI+x2sf/JhpyPTsomhPN6\n6qja//MVjzw0HRy4Nb6SOhprGbK55fhKke3oz8hW2Y90nrBEn/HUCdqV9IQvaAeK\nILETxmEZYnni0+9IrefgD4AyIfFR4KCNfqPG7KyxJvC1o7wrd/yuXCyz03+sZjWX\ni6DXM7mxAgMBAAECggEAXuK+l0XgVSIpHCuIy0HNTxZ6UsGt1Yo1+PkdsmwgA/9T\nEre1UBKYKI+EgjR96af3ytH5WRH8Gu7YvCrXpaXJlBTMaW0jiNbIeWsWi82LFqNr\n5e4eelyWt4EWVEO/M04LmqWfxHAXq9WVaiKye4r01TCcs0e0N3x9e4vYQ2fcTHto\n2jybdna/dIuFzgnhk5fGC7nJ17Dnf00/8pJHd6JRoYb/EecuSbB4OjGuPgtF7N9j\nlKto8TwEeIIcKnUpqUxQD5keVluTqDVZt38LS62V7wRnwLzINIlzsTZ7fdgd/CPm\nnjY3Sa8t+j4ULzvWm4goW4kBYJ76G8hXRvA+oKkYAQKBgQD6BylXOswFlDgO6VoP\nQVrujxjalpSp9Vvovo/sSS40UO9hqsNHjuuwPNtLsV1e+GSC14oKfmKt4YooeES5\nmDkzAtlyKUcLtIRJifqQRyBbqf+8ZqtZkXavEp2L8VsKu45rNalHvgwqgCNNVdJ/\n1vnpiGt9z0wrCrQ63fWVOcXnMQKBgQDCnC16ZRgWLKAMc5j6gBAjsMk/SbLk7yM9\n7Ru1YSDFubQ/d8RTNcWDsM1r7OuwsD3zpTHk7b2BFSXtHKgtmV02TPlen9IFA1AV\nUT7rF840ONJSZzUq1/737kSuznQh83WL6BksDfWZRV2iYMuUZNcO0tTX+aUJAgt4\nQwvFY6NagQKBgQDRT018iOxjf0Guugt62euV6pWT6Jtr7MuUfHNgC6NyiI7d5Ga2\ncR892rR7GXBhIPCD2IznXAagKj/OwWBHPvgjjC8dMxEW63gTWD86qVCdbCN7RTgN\nM4l35s2daeAdjAYeGj4soRzuN3dWNpKSExYEOwBBwlixb7SR017UHhlfAQKBgGp1\nWx+Ia/u9X7RQDFCEe8+6ZuzbGSTJeMLokW7QekgPxX2uu9Q1Jx5aOpWennQihVFi\nff/Y2gDiG8QxGAMR0X7h7syHqzEY1ddDgaLDfAbvSobPdLNCQ3VHf4UM5VSpRRVK\n23JRFJhK7OTmBJfh7g9q4Aphw5lA6Btaufa6AeOBAoGAXmF6ImjDJcxTzN+f1hVa\nTBdE+QhdLPN8NHMzKK5xkurqBEc+nKx5RWBiVZ+EhnDO59jQ6Jgimkw4LUCuVNGG\nd/p1+ddTsZ88qby+iFbFnDljo/q29SOgXaySc9Hi723sQgmTiPPPKc5wXe/1mUY0\nrkSM+azcO0Wyc+OAAfX7u6A=\n-----END PRIVATE KEY-----" +SMART_KEY_ID=test-key-001 +SMART_CLIENT_ID=orchestration-service diff --git a/aidbox-features/aidbox-orchestration-service/.gitignore b/aidbox-features/aidbox-orchestration-service/.gitignore new file mode 100644 index 0000000..3664b4b --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/.gitignore @@ -0,0 +1,32 @@ +# Dependencies +node_modules/ + +# Environment +.env +.env.local +.env.*.local + +# Build +dist/ +*.tsbuildinfo + +# IDE +.idea/ +.vscode/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db + +# Logs +*.log +npm-debug.log* + +# Bun +bun.lock + +# Codegen +.codegen-cache/ diff --git a/aidbox-features/aidbox-orchestration-service/CLAUDE.md b/aidbox-features/aidbox-orchestration-service/CLAUDE.md new file mode 100644 index 0000000..e6abf4c --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/CLAUDE.md @@ -0,0 +1,41 @@ +# CLAUDE.md + +## Project Overview + +FHIR Orchestration Service POC implementing `$getstructuredrecord` (GP Connect). Fetches patient data from 2 FHIR sources (SMART Backend Services + Basic Auth), deduplicates via ConceptMap/$translate, stores with Provenance, and returns merged Bundle. + +## FHIR Type Generation + +FHIR TypeScript types are generated using `@atomic-ehr/codegen`. The config is at `scripts/generate-types.ts`. + +Generated types are output to `src/fhir-types/` — do not edit these files manually. + +```ts +import type { Patient, Bundle, Provenance } from "./fhir-types/hl7-fhir-r4-core"; +import type { UKCoreAllergyIntolerance } from "./fhir-types/fhir-r4-ukcore-stu2/profiles/UkcoreAllergyIntolerance"; +import { UKCorePatientProfile } from "./fhir-types/fhir-r4-ukcore-stu2/profiles"; +``` + +To regenerate types: `bun run generate-types`. + +## Commands + +| Command | Description | +|---------|-------------| +| `bun run start` | Start orchestration service | +| `bun run typecheck` | TypeScript type check | +| `bun run generate-types` | Regenerate FHIR TypeScript types | +| `docker compose up -d --build` | Start all services | + +## Project Structure + +- `src/index.ts` — HTTP server (Bun.serve), routing, error handling +- `src/orchestration.ts` — Main orchestration flow (fetch, deduplicate, store) +- `src/deduplication.ts` — Per-resource deduplication logic (Patient merge, AllergyIntolerance code match, Observation time/value match) +- `src/provenance.ts` — Provenance resource creation for audit trail +- `src/fhir-clients.ts` — Auth providers (SMART + Basic), source fetching +- `src/fhir-types/` — Auto-generated FHIR types (do not edit) +- `scripts/generate-types.ts` — Codegen configuration +- `aidbox-config/init.json` — ConceptMap for LOINC->SNOMED CT translation +- `general-practice-config/init.json` — GP test data (SNOMED CT) +- `hospital-config/init.json` — Hospital test data (LOINC) diff --git a/aidbox-features/aidbox-orchestration-service/Dockerfile b/aidbox-features/aidbox-orchestration-service/Dockerfile new file mode 100644 index 0000000..15416f0 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/Dockerfile @@ -0,0 +1,25 @@ +FROM oven/bun:1 AS base +WORKDIR /app + +# Install dependencies +FROM base AS install +RUN apt-get update && apt-get install -y curl +COPY package.json bun.lock* ./ +RUN bun install --frozen-lockfile || bun install + +# Production stage +FROM base AS release +RUN apt-get update && apt-get install -y curl +COPY --from=install /app/node_modules node_modules +COPY src ./src +COPY package.json . +COPY tsconfig.json . + +USER bun + +EXPOSE 3000 + +HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \ + CMD curl -f http://localhost:3000/health || exit 1 + +CMD ["bun", "run", "src/index.ts"] diff --git a/aidbox-features/aidbox-orchestration-service/README.md b/aidbox-features/aidbox-orchestration-service/README.md new file mode 100644 index 0000000..a3cad04 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/README.md @@ -0,0 +1,252 @@ +--- +features: [FHIR Orchestration, FHIR Facade, Deduplication, ConceptMap, Provenance, SMART on FHIR] +languages: [TypeScript] +--- + +# FHIR Orchestration Service + +Implements [`$getstructuredrecord`](https://simplifier.net/guide/gpconnect-data-model/Home/FHIR-Assets/All-assets/OperationDefinitions/OperationDefinition-GPConnect-GetStructuredRecord-Operation-1?version=current) operation that fetches patient data from multiple FHIR sources, deduplicates resources using terminology translation, and returns a merged Bundle with Provenance tracking. + +## Problem + +Patient data is often spread across multiple healthcare systems that use different terminologies (SNOMED CT, LOINC) and authentication methods (SMART Backend Services, Basic Auth). A client application needs a single, deduplicated view of the patient record. + +### Requirements + +1. **Multi-source aggregation**: Fetch data from General Practice (SMART on FHIR) and Hospital (Basic Auth) in parallel +2. **Cross-terminology deduplication**: Match resources coded in different systems (LOINC vs SNOMED CT) using [ConceptMap/$translate](https://hl7.org/fhir/R4/conceptmap-operation-translate.html) +3. **Audit trail**: Store source bundles and merged results with [Provenance](https://hl7.org/fhir/R4/provenance.html) + +## Architecture + +```mermaid +flowchart LR + CA(Client Application):::blue + OL(Orchestration Service):::green + FS[(Aidbox)]:::green + GP[(Aidbox
General Practice
SMART on FHIR)]:::orange + HOSP[(Aidbox
Hospital
Basic Auth)]:::orange + + CA -->|"$getstructuredrecord"| OL + OL -->|"Bundle"| CA + OL <-->|"Store + Deduplicate"| FS + OL -->|"GET Bundle"| GP + OL -->|"GET Bundle"| HOSP + + classDef blue fill:#e1f5fe,stroke:#01579b + classDef green fill:#e8f5e9,stroke:#2e7d32 + classDef orange fill:#fff3e0,stroke:#ef6c00 +``` + +For the POC, all three FHIR servers are Aidbox instances. In production, the external sources would be real GP and Hospital FHIR servers. + +## Sequence Diagram + +```mermaid +sequenceDiagram + participant Client + participant FS as FHIR Server + participant Orch as Orchestration + participant GP as General Practice + participant Hospital + + Client->>Orch: $getstructuredrecord (NHS Number) + + par Fetch from sources + Orch->>GP: POST /auth/token (JWT) + GP-->>Orch: access_token + Orch->>GP: GET /fhir/Bundle (Bearer) + GP-->>Orch: Bundle + and + Orch->>Hospital: GET /fhir/Bundle (Basic auth) + Hospital-->>Orch: Bundle + end + + Orch->>FS: Store 2 source Bundles + Orch->>FS: ConceptMap/$translate + FS-->>Orch: Translated code + Note over Orch: Deduplicate & Merge + Orch->>FS: Store merged Bundle + Provenance + + Orch-->>Client: Merged Bundle +``` + +### Flow + +1. **Client request** - Client calls `$getstructuredrecord` with patient's NHS Number +2. **Parallel fetch** - Orchestration fetches bundles from both sources simultaneously: + - General Practice: SMART Backend Services auth (JWT client assertion -> Bearer token) + - Hospital: Basic authentication +3. **Store for audit** - Source bundles, merged bundle, and Provenance stored in main FHIR Server +4. **Terminology normalization** - `ConceptMap/$translate` converts LOINC codes to SNOMED CT for cross-system matching +5. **Deduplication** - Resources with matching normalized codes are deduplicated +6. **Response** - Merged bundle with deduplicated resources returned to client + +## Deduplication Algorithms + +| Resource | Key | Algorithm | Why? | +| ---------------------- | ----------------------- | ------------------------ | ---------------------------------------------------------------- | +| **Patient** | NHS Number | Merge | One person = one patient, combine data from sources | +| **AllergyIntolerance** | code (normalized) | Match + select by status | Same allergy in different terminologies -> ConceptMap translation | +| **Observation** | code + time +/-1h + value | Match if all equal | Same measurement, but different values = clinically significant | +| **Encounter** | - | No deduplication | Each visit is unique, even on the same day | + +### Patient + +``` +1. Group by NHS Number +2. Merge: keep most complete name (more given names wins) +3. Merge: take first non-null telecom, address +4. Result: single Patient with merged data +``` + +### AllergyIntolerance + +``` +1. Translate LOINC codes to SNOMED CT via ConceptMap/$translate +2. Group by normalized SNOMED code +3. Select canonical: prefer confirmed verificationStatus +``` + +Example: + +``` +General Practice: SNOMED 91936005 (confirmed) -+ +Hospital: LOINC LA30099-6 (unconfirmed) -+-> translate -> match -> keep GP (confirmed) +``` + +### Observation + +``` +1. Group by: code + effectiveDateTime (+/-1h) +2. Compare values: + - Same value -> deduplicate + - Different value -> keep both (clinical significance) +3. Select canonical: prefer has interpretation, has referenceRange +``` + +Example: + +``` +GP: HbA1c = 7.2% @ 10:00 -+-> same code, +/-1h, same value -> deduplicate +Hospital: HbA1c = 7.2% @ 10:30 -+ + +GP: HbA1c = 7.2% @ 10:00 -> keep +Hospital: HbA1c = 6.8% @ 10:30 -> keep (different value = clinically significant) +``` + +## Quick Start + +### 1. Configure environment + +```bash +cp .env.example .env +``` + +The `.env.example` includes a test RSA private key for SMART Backend Services authentication. The matching public key is already configured in `general-practice-config/init.json`. + +### 2. Start services + +```bash +docker compose up -d --build +``` + +Wait for all services to become healthy: + +```bash +docker compose ps +``` + +All 4 services should show "healthy" status: +- http://localhost:8080 - Main FHIR server (Aidbox UI) +- http://localhost:8081 - General Practice FHIR server +- http://localhost:8082 - Hospital FHIR server +- http://localhost:3000 - Orchestration service + +Each Aidbox instance loads its init bundle on startup: + +- **fhir_server**: ConceptMap for LOINC->SNOMED CT translation (`aidbox-config/`) +- **general_practice**: Test patient bundle with SNOMED CT codes (`general-practice-config/`) +- **hospital**: Test patient bundle with LOINC codes (`hospital-config/`) + +### 3. Test the orchestration + +```bash +curl -X POST http://localhost:3000/fhir/Patient/\$getstructuredrecord \ + -H "Content-Type: application/fhir+json" \ + -d '{ + "resourceType": "Parameters", + "parameter": [{ + "name": "patientNHSNumber", + "valueIdentifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9876543210" + } + }] + }' +``` + +Expected response: Merged bundle with 1 Patient, 1 AllergyIntolerance (2->1 deduplicated via ConceptMap), 2 Observations (3->2 deduplicated), 2 Encounters. + +### 4. Verify Provenance + +Provenance resources are stored for audit but not included in response: + +```bash +curl -u root:secret http://localhost:8080/fhir/Provenance +``` + +## Test Data + +All resources conform to [UK Core STU2](https://simplifier.net/hl7fhirukcorer4) profiles. + +**General Practice (SNOMED CT):** + +- [UKCore-Patient](https://simplifier.net/hl7fhirukcorer4/ukcorepatient): NHS 9876543210, Smith John William, address + telecom +- [UKCore-AllergyIntolerance](https://simplifier.net/hl7fhirukcorer4/ukcoreallergyintolerance): SNOMED `91936005` (Allergy to penicillin), confirmed, high criticality +- [UKCore-Observation](https://simplifier.net/hl7fhirukcorer4/ukcoreobservation): HbA1c = 7.2% @ 2024-01-15T10:00 (with interpretation + referenceRange) +- [UKCore-Encounter](https://simplifier.net/hl7fhirukcorer4/ukcoreencounter): ENC-SMART-001 + +**Hospital (LOINC):** + +- [UKCore-Patient](https://simplifier.net/hl7fhirukcorer4/ukcorepatient): NHS 9876543210, Smith John, local ID H12345 +- [UKCore-AllergyIntolerance](https://simplifier.net/hl7fhirukcorer4/ukcoreallergyintolerance): LOINC `LA30099-6` (Penicillin allergy), unconfirmed +- [UKCore-Observation](https://simplifier.net/hl7fhirukcorer4/ukcoreobservation): HbA1c = 7.2% @ 2024-01-15T10:30 (duplicate) +- [UKCore-Observation](https://simplifier.net/hl7fhirukcorer4/ukcoreobservation): HbA1c = 6.8% @ 2024-02-20T14:00 (unique) +- [UKCore-Encounter](https://simplifier.net/hl7fhirukcorer4/ukcoreencounter): ENC-BASIC-001 + +**Result after orchestration:** + +| Resource | Source | Result | Reason | +| ------------------ | ------------------ | ------ | ------------------------------------------------------------------------- | +| Patient | 2 (GP + Hospital) | 1 | Merged by NHS Number, kept "John William" (more given names) | +| AllergyIntolerance | 2 (SNOMED + LOINC) | 1 | LOINC->SNOMED translation matched, kept GP's (confirmed > unconfirmed) | +| Observation (Jan) | 2 (GP + Hospital) | 1 | Same code, +/-30min, same value -> duplicate, kept GP's (has interpretation) | +| Observation (Feb) | 1 (Hospital only) | 1 | Unique date, no match | +| Encounter | 2 (GP + Hospital) | 2 | No deduplication (different identifiers) | + +## Services + +| Service | URL | Auth | Description | +| ------------------ | --------------------- | ---------------------- | ---------------------------- | +| `fhir_server` | http://localhost:8080 | Basic (root:secret) | Main FHIR server (storage) | +| `general_practice` | http://localhost:8081 | SMART Backend Services | General Practice (SNOMED CT) | +| `hospital` | http://localhost:8082 | Basic Auth | Hospital (LOINC) | +| `orchestration` | http://localhost:3000 | - | Orchestration service | + +## FHIR Implementation Guides + +| Package | Version | Description | +| ------------------------------------------------------------- | ------- | -------------------------------------------------------------------------------------- | +| [hl7.fhir.r4.core](https://hl7.org/fhir/R4/) | 4.0.1 | FHIR R4 base types | +| [fhir.r4.ukcore.stu2](https://simplifier.net/hl7fhirukcorer4) | 2.0.2 | UK Core R4 profiles (UKCorePatient, UKCoreAllergyIntolerance, UKCoreObservation, etc.) | + +TypeScript types for both packages are generated into `src/fhir-types/` using `@atomic-ehr/codegen`. + +## Local Development + +```bash +bun install +bun run src/index.ts +bun run tsc --noEmit +``` diff --git a/aidbox-features/aidbox-orchestration-service/aidbox-config/init.json b/aidbox-features/aidbox-orchestration-service/aidbox-config/init.json new file mode 100644 index 0000000..c97fe63 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/aidbox-config/init.json @@ -0,0 +1,38 @@ +{ + "type": "transaction", + "entry": [ + { + "resource": { + "resourceType": "ConceptMap", + "id": "allergy-loinc-to-snomed", + "url": "http://example.org/ConceptMap/allergy-loinc-to-snomed", + "name": "AllergyLoincToSnomed", + "title": "Allergy LOINC to SNOMED CT Mapping", + "status": "active", + "description": "Maps LOINC answer codes to SNOMED CT for NHS deduplication", + "sourceUri": "http://loinc.org", + "targetUri": "http://snomed.info/sct", + "group": [ + { + "source": "http://loinc.org", + "target": "http://snomed.info/sct", + "element": [ + { + "code": "LA30099-6", + "display": "Penicillin allergy", + "target": [ + { + "code": "91936005", + "display": "Allergy to penicillin", + "equivalence": "equivalent" + } + ] + } + ] + } + ] + }, + "request": {"method": "POST", "url": "/ConceptMap"} + } + ] +} diff --git a/aidbox-features/aidbox-orchestration-service/docker-compose.yaml b/aidbox-features/aidbox-orchestration-service/docker-compose.yaml new file mode 100644 index 0000000..b076c2e --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/docker-compose.yaml @@ -0,0 +1,234 @@ +volumes: + aidbox_data: {} + general_practice_data: {} + hospital_data: {} + +services: + # ============ Main FHIR Server (storage + ConceptMap) ============ + + fhir_server_db: + image: docker.io/library/postgres:18 + volumes: + - aidbox_data:/var/lib/postgresql/18/docker:delegated + command: + - postgres + - -c + - shared_preload_libraries=pg_stat_statements + environment: + POSTGRES_USER: aidbox + POSTGRES_PORT: "5432" + POSTGRES_DB: aidbox + POSTGRES_PASSWORD: aidbox_secret + healthcheck: + test: ["CMD-SHELL", "pg_isready -U aidbox"] + interval: 5s + timeout: 3s + retries: 5 + + fhir_server: + image: docker.io/healthsamurai/aidboxone:edge + pull_policy: always + depends_on: + fhir_server_db: + condition: service_healthy + ports: + - "8080:8080" + environment: + BOX_ADMIN_PASSWORD: admin + BOX_ROOT_CLIENT_SECRET: secret + BOX_DB_HOST: fhir_server_db + BOX_DB_PORT: "5432" + BOX_DB_DATABASE: aidbox + BOX_DB_USER: aidbox + BOX_DB_PASSWORD: aidbox_secret + BOX_WEB_BASE_URL: http://fhir_server:8080 + BOX_WEB_PORT: 8080 + BOX_BOOTSTRAP_FHIR_PACKAGES: hl7.fhir.r4.core#4.0.1 + BOX_COMPATIBILITY_VALIDATION_JSON__SCHEMA_REGEX: "#{:fhir-datetime}" + BOX_FHIR_BUNDLE_EXECUTION_VALIDATION_MODE: limited + BOX_FHIR_COMPLIANT_MODE: "true" + BOX_FHIR_CORRECT_AIDBOX_FORMAT: "true" + BOX_FHIR_CREATEDAT_URL: https://aidbox.app/ex/createdAt + BOX_FHIR_SCHEMA_VALIDATION: "true" + BOX_FHIR_SEARCH_AUTHORIZE_INLINE_REQUESTS: "true" + BOX_FHIR_SEARCH_CHAIN_SUBSELECT: "true" + BOX_FHIR_SEARCH_COMPARISONS: "true" + BOX_FHIR_TERMINOLOGY_ENGINE: hybrid + BOX_FHIR_TERMINOLOGY_ENGINE_HYBRID_EXTERNAL_TX_SERVER: https://tx.health-samurai.io/fhir + BOX_FHIR_TERMINOLOGY_SERVICE_BASE_URL: https://tx.health-samurai.io/fhir + BOX_MODULE_SDC_STRICT_ACCESS_CONTROL: "true" + BOX_SEARCH_INCLUDE_CONFORMANT: "true" + BOX_SECURITY_AUDIT_LOG_ENABLED: "true" + BOX_SECURITY_DEV_MODE: "true" + BOX_SETTINGS_MODE: read-write + BOX_INIT_BUNDLE: file:///aidbox-config/init.json + volumes: + - ./aidbox-config:/aidbox-config:cached + healthcheck: + test: curl -f http://localhost:8080/health || exit 1 + interval: 5s + timeout: 5s + retries: 90 + start_period: 30s + + # ============ General Practice (SMART Backend Services) ============ + + general_practice_db: + image: docker.io/library/postgres:18 + volumes: + - general_practice_data:/var/lib/postgresql/18/docker:delegated + command: + - postgres + - -c + - shared_preload_libraries=pg_stat_statements + environment: + POSTGRES_USER: aidbox + POSTGRES_PORT: "5432" + POSTGRES_DB: aidbox + POSTGRES_PASSWORD: gp_secret + healthcheck: + test: ["CMD-SHELL", "pg_isready -U aidbox"] + interval: 5s + timeout: 3s + retries: 5 + + general_practice: + image: docker.io/healthsamurai/aidboxone:edge + pull_policy: always + depends_on: + general_practice_db: + condition: service_healthy + ports: + - "8081:8081" + environment: + BOX_ADMIN_PASSWORD: admin + BOX_ROOT_CLIENT_SECRET: secret + BOX_DB_HOST: general_practice_db + BOX_DB_PORT: "5432" + BOX_DB_DATABASE: aidbox + BOX_DB_USER: aidbox + BOX_DB_PASSWORD: gp_secret + BOX_WEB_BASE_URL: http://general_practice:8081 + BOX_WEB_PORT: 8081 + BOX_BOOTSTRAP_FHIR_PACKAGES: hl7.fhir.r4.core#4.0.1 + BOX_COMPATIBILITY_VALIDATION_JSON__SCHEMA_REGEX: "#{:fhir-datetime}" + BOX_FHIR_BUNDLE_EXECUTION_VALIDATION_MODE: limited + BOX_FHIR_COMPLIANT_MODE: "true" + BOX_FHIR_CORRECT_AIDBOX_FORMAT: "true" + BOX_FHIR_CREATEDAT_URL: https://aidbox.app/ex/createdAt + BOX_FHIR_SCHEMA_VALIDATION: "true" + BOX_FHIR_SEARCH_AUTHORIZE_INLINE_REQUESTS: "true" + BOX_FHIR_SEARCH_CHAIN_SUBSELECT: "true" + BOX_FHIR_SEARCH_COMPARISONS: "true" + BOX_FHIR_TERMINOLOGY_ENGINE: hybrid + BOX_FHIR_TERMINOLOGY_ENGINE_HYBRID_EXTERNAL_TX_SERVER: https://tx.health-samurai.io/fhir + BOX_FHIR_TERMINOLOGY_SERVICE_BASE_URL: https://tx.health-samurai.io/fhir + BOX_MODULE_SDC_STRICT_ACCESS_CONTROL: "true" + BOX_SEARCH_INCLUDE_CONFORMANT: "true" + BOX_SECURITY_AUDIT_LOG_ENABLED: "true" + BOX_SECURITY_DEV_MODE: "true" + BOX_SETTINGS_MODE: read-write + BOX_INIT_BUNDLE: file:///aidbox-config/init.json + volumes: + - ./general-practice-config:/aidbox-config:cached + healthcheck: + test: curl -f http://localhost:8081/health || exit 1 + interval: 5s + timeout: 5s + retries: 90 + start_period: 30s + + # ============ Hospital (Basic Auth) ============ + + hospital_db: + image: docker.io/library/postgres:18 + volumes: + - hospital_data:/var/lib/postgresql/18/docker:delegated + command: + - postgres + - -c + - shared_preload_libraries=pg_stat_statements + environment: + POSTGRES_USER: aidbox + POSTGRES_PORT: "5432" + POSTGRES_DB: aidbox + POSTGRES_PASSWORD: hospital_secret + healthcheck: + test: ["CMD-SHELL", "pg_isready -U aidbox"] + interval: 5s + timeout: 3s + retries: 5 + + hospital: + image: docker.io/healthsamurai/aidboxone:edge + pull_policy: always + depends_on: + hospital_db: + condition: service_healthy + ports: + - "8082:8082" + environment: + BOX_ADMIN_PASSWORD: admin + BOX_ROOT_CLIENT_SECRET: secret + BOX_DB_HOST: hospital_db + BOX_DB_PORT: "5432" + BOX_DB_DATABASE: aidbox + BOX_DB_USER: aidbox + BOX_DB_PASSWORD: hospital_secret + BOX_WEB_BASE_URL: http://hospital:8082 + BOX_WEB_PORT: 8082 + BOX_BOOTSTRAP_FHIR_PACKAGES: hl7.fhir.r4.core#4.0.1 + BOX_COMPATIBILITY_VALIDATION_JSON__SCHEMA_REGEX: "#{:fhir-datetime}" + BOX_FHIR_BUNDLE_EXECUTION_VALIDATION_MODE: limited + BOX_FHIR_COMPLIANT_MODE: "true" + BOX_FHIR_CORRECT_AIDBOX_FORMAT: "true" + BOX_FHIR_CREATEDAT_URL: https://aidbox.app/ex/createdAt + BOX_FHIR_SCHEMA_VALIDATION: "true" + BOX_FHIR_SEARCH_AUTHORIZE_INLINE_REQUESTS: "true" + BOX_FHIR_SEARCH_CHAIN_SUBSELECT: "true" + BOX_FHIR_SEARCH_COMPARISONS: "true" + BOX_FHIR_TERMINOLOGY_ENGINE: hybrid + BOX_FHIR_TERMINOLOGY_ENGINE_HYBRID_EXTERNAL_TX_SERVER: https://tx.health-samurai.io/fhir + BOX_FHIR_TERMINOLOGY_SERVICE_BASE_URL: https://tx.health-samurai.io/fhir + BOX_MODULE_SDC_STRICT_ACCESS_CONTROL: "true" + BOX_SEARCH_INCLUDE_CONFORMANT: "true" + BOX_SECURITY_AUDIT_LOG_ENABLED: "true" + BOX_SECURITY_DEV_MODE: "true" + BOX_SETTINGS_MODE: read-write + BOX_INIT_BUNDLE: file:///aidbox-config/init.json + volumes: + - ./hospital-config:/aidbox-config:cached + healthcheck: + test: curl -f http://localhost:8082/health || exit 1 + interval: 5s + timeout: 5s + retries: 90 + start_period: 30s + + # ============ Orchestration Service ============ + + orchestration: + build: . + depends_on: + fhir_server: + condition: service_healthy + general_practice: + condition: service_healthy + hospital: + condition: service_healthy + ports: + - "3000:3000" + environment: + PORT: "3000" + FHIR_SERVER_URL: http://fhir_server:8080 + GENERAL_PRACTICE_URL: http://general_practice:8081 + HOSPITAL_URL: http://hospital:8082 + SMART_PRIVATE_KEY: ${SMART_PRIVATE_KEY} + SMART_KEY_ID: ${SMART_KEY_ID:-test-key-001} + SMART_CLIENT_ID: ${SMART_CLIENT_ID:-orchestration-service} + healthcheck: + test: curl -f http://127.0.0.1:3000/health || exit 1 + interval: 10s + timeout: 5s + retries: 10 + start_period: 10s diff --git a/aidbox-features/aidbox-orchestration-service/general-practice-config/init.json b/aidbox-features/aidbox-orchestration-service/general-practice-config/init.json new file mode 100644 index 0000000..a7f79c6 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/general-practice-config/init.json @@ -0,0 +1,197 @@ +{ + "type": "transaction", + "entry": [ + { + "resource": { + "resourceType": "Client", + "id": "orchestration-service", + "type": "bulk-api-client", + "active": true, + "auth": { + "client_credentials": { + "client_assertion_types": ["urn:ietf:params:oauth:client-assertion-type:jwt-bearer"], + "access_token_expiration": 300 + } + }, + "scope": ["system/*.read", "system/*.write"], + "grant_types": ["client_credentials"], + "jwks": [ + { + "kty": "RSA", + "n": "vhH2HBgg0xkYfGrcgXDED-XobRN279OlWkAi5Prg1dPgj47C8TvuV0YgFDoPXmthrn8O9gyzaVHd9HaO3edImqpg3wv4sQstFF09FB4x0DX6lIs4SWNfwFY-B2sbmxpKSvxVXiM6QRBvC67g6hgmX5T5IwzGFU3m-hpOGZ50iyCVmROmQsFrxU_XxSPsdrH_yYacj07KJoTzeuqo2v_zFY88NB0cuDW-kjoaaxmyueX4SpHt6M_IVtmPdJ6wRJ_x1AnalfSEL2gHiiCxE8ZhGWJ54tPvSK3n4A-AMiHxUeCgjX6jxuyssSbwtaO8K3f8rlwss9N_rGY1l4ug1zO5sQ", + "e": "AQAB", + "kid": "test-key-001", + "alg": "RS384", + "use": "sig" + } + ] + }, + "request": {"method": "PUT", "url": "/Client/orchestration-service"} + }, + { + "resource": { + "resourceType": "AccessPolicy", + "id": "orchestration-service-policy", + "engine": "allow", + "link": [ + {"resourceType": "Client", "id": "orchestration-service"} + ] + }, + "request": {"method": "PUT", "url": "/AccessPolicy/orchestration-service-policy"} + }, + { + "resource": { + "resourceType": "Bundle", + "id": "test-bundle", + "meta": { + "profile": ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle"] + }, + "type": "collection", + "entry": [ + { + "resource": { + "resourceType": "Patient", + "id": "patient-smart-1", + "meta": { + "profile": ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient"] + }, + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9876543210", + "extension": [ + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatusEngland", + "code": "01", + "display": "Number present and verified" + } + ] + } + } + ] + } + ], + "name": [ + {"use": "official", "family": "Smith", "given": ["John", "William"]} + ], + "gender": "male", + "birthDate": "1990-05-15", + "address": [ + { + "use": "home", + "line": ["123 High Street"], + "city": "Leeds", + "postalCode": "LS1 1AA" + } + ], + "telecom": [ + {"system": "phone", "value": "07700900123", "use": "mobile"} + ] + } + }, + { + "resource": { + "resourceType": "AllergyIntolerance", + "id": "allergy-gp-penicillin", + "meta": { + "profile": ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-AllergyIntolerance"] + }, + "clinicalStatus": { + "coding": [ + {"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active"} + ] + }, + "verificationStatus": { + "coding": [ + {"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed"} + ] + }, + "category": ["medication"], + "criticality": "high", + "code": { + "coding": [ + {"system": "http://snomed.info/sct", "code": "91936005", "display": "Allergy to penicillin"} + ] + }, + "patient": {"reference": "Patient/patient-smart-1"}, + "recordedDate": "2023-01-15", + "reaction": [ + { + "manifestation": [ + { + "coding": [ + {"system": "http://snomed.info/sct", "code": "271807003", "display": "Eruption of skin"} + ] + } + ], + "severity": "moderate" + } + ] + } + }, + { + "resource": { + "resourceType": "Observation", + "id": "obs-gp-hba1c", + "meta": { + "profile": ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation"] + }, + "status": "final", + "code": { + "coding": [ + {"system": "http://loinc.org", "code": "4548-4", "display": "Hemoglobin A1c/Hemoglobin.total in Blood"} + ] + }, + "subject": {"reference": "Patient/patient-smart-1"}, + "effectiveDateTime": "2024-01-15T10:00:00Z", + "valueQuantity": { + "value": 7.2, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + }, + "interpretation": [ + { + "coding": [ + {"system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", "code": "H", "display": "High"} + ] + } + ], + "referenceRange": [ + {"high": {"value": 5.7, "unit": "%"}, "text": "Normal: <5.7%"} + ] + } + }, + { + "resource": { + "resourceType": "Encounter", + "id": "encounter-smart-1", + "meta": { + "profile": ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Encounter"] + }, + "identifier": [ + {"system": "https://fhir.nhs.uk/Id/encounter", "value": "ENC-SMART-001"} + ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "subject": {"reference": "Patient/patient-smart-1"}, + "period": { + "start": "2024-01-15T10:00:00Z", + "end": "2024-01-15T11:00:00Z" + } + } + } + ] + }, + "request": {"method": "PUT", "url": "/Bundle/test-bundle"} + } + ] +} diff --git a/aidbox-features/aidbox-orchestration-service/hospital-config/init.json b/aidbox-features/aidbox-orchestration-service/hospital-config/init.json new file mode 100644 index 0000000..7e9d11c --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/hospital-config/init.json @@ -0,0 +1,176 @@ +{ + "type": "transaction", + "entry": [ + { + "resource": { + "resourceType": "Client", + "id": "orchestration-service", + "secret": "basic-auth-secret", + "grant_types": ["basic"] + }, + "request": {"method": "PUT", "url": "/Client/orchestration-service"} + }, + { + "resource": { + "resourceType": "AccessPolicy", + "id": "orchestration-service-policy", + "engine": "allow", + "link": [ + {"resourceType": "Client", "id": "orchestration-service"} + ] + }, + "request": {"method": "PUT", "url": "/AccessPolicy/orchestration-service-policy"} + }, + { + "resource": { + "resourceType": "Bundle", + "id": "test-bundle", + "meta": { + "profile": ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle"] + }, + "type": "collection", + "entry": [ + { + "resource": { + "resourceType": "Patient", + "id": "patient-basic-1", + "meta": { + "profile": ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient"] + }, + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9876543210", + "extension": [ + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatusEngland", + "code": "01", + "display": "Number present and verified" + } + ] + } + } + ] + }, + { + "system": "https://fhir.nhs.uk/Id/local-patient-identifier", + "value": "H12345", + "assigner": {"display": "Leeds Teaching Hospitals NHS Trust"} + } + ], + "name": [ + {"use": "official", "family": "Smith", "given": ["John"]} + ], + "gender": "male", + "birthDate": "1990-05-15" + } + }, + { + "resource": { + "resourceType": "AllergyIntolerance", + "id": "allergy-hospital-penicillin", + "meta": { + "profile": ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-AllergyIntolerance"] + }, + "clinicalStatus": { + "coding": [ + {"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active"} + ] + }, + "verificationStatus": { + "coding": [ + {"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "unconfirmed"} + ] + }, + "category": ["medication"], + "code": { + "coding": [ + {"system": "http://loinc.org", "code": "LA30099-6", "display": "Penicillin allergy"} + ] + }, + "patient": {"reference": "Patient/patient-basic-1"}, + "recordedDate": "2024-02-20", + "note": [ + {"text": "Patient reported during admission"} + ] + } + }, + { + "resource": { + "resourceType": "Observation", + "id": "obs-hospital-hba1c-jan", + "meta": { + "profile": ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation"] + }, + "status": "final", + "code": { + "coding": [ + {"system": "http://loinc.org", "code": "4548-4", "display": "Hemoglobin A1c/Hemoglobin.total in Blood"} + ] + }, + "subject": {"reference": "Patient/patient-basic-1"}, + "effectiveDateTime": "2024-01-15T10:30:00Z", + "valueQuantity": { + "value": 7.2, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + } + }, + { + "resource": { + "resourceType": "Observation", + "id": "obs-hospital-hba1c-feb", + "meta": { + "profile": ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation"] + }, + "status": "final", + "code": { + "coding": [ + {"system": "http://loinc.org", "code": "4548-4", "display": "Hemoglobin A1c/Hemoglobin.total in Blood"} + ] + }, + "subject": {"reference": "Patient/patient-basic-1"}, + "effectiveDateTime": "2024-02-20T14:00:00Z", + "valueQuantity": { + "value": 6.8, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + } + }, + { + "resource": { + "resourceType": "Encounter", + "id": "encounter-basic-1", + "meta": { + "profile": ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Encounter"] + }, + "identifier": [ + {"system": "https://fhir.nhs.uk/Id/encounter", "value": "ENC-BASIC-001"} + ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "subject": {"reference": "Patient/patient-basic-1"}, + "period": { + "start": "2024-02-20T14:00:00Z", + "end": "2024-02-20T15:00:00Z" + } + } + } + ] + }, + "request": {"method": "PUT", "url": "/Bundle/test-bundle"} + } + ] +} diff --git a/aidbox-features/aidbox-orchestration-service/package.json b/aidbox-features/aidbox-orchestration-service/package.json new file mode 100644 index 0000000..9fd2e0e --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/package.json @@ -0,0 +1,19 @@ +{ + "name": "aidbox-orchestration-service", + "module": "src/index.ts", + "type": "module", + "private": true, + "scripts": { + "start": "bun run src/index.ts", + "typecheck": "tsc --noEmit", + "generate-types": "bun run scripts/generate-types.ts" + }, + "devDependencies": { + "@atomic-ehr/codegen": "^0.0.10", + "@types/bun": "latest", + "typescript": "^5.7.0" + }, + "dependencies": { + "@health-samurai/aidbox-client": "^0.0.0-alpha.4" + } +} diff --git a/aidbox-features/aidbox-orchestration-service/scripts/generate-types.ts b/aidbox-features/aidbox-orchestration-service/scripts/generate-types.ts new file mode 100644 index 0000000..2db132c --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/scripts/generate-types.ts @@ -0,0 +1,38 @@ +import { APIBuilder, prettyReport } from "@atomic-ehr/codegen"; + +const builder = new APIBuilder() + .throwException() + .fromPackage("hl7.fhir.r4.core", "4.0.1") + .fromPackageRef("https://fs.get-ig.org/-/fhir.r4.ukcore.stu2-2.0.2.tgz") + .typescript({ + withDebugComment: false, + generateProfile: true, + openResourceTypeSet: false, + }) + .typeSchema({ + treeShake: { + "hl7.fhir.r4.core": { + "http://hl7.org/fhir/StructureDefinition/Patient": {}, + "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance": {}, + "http://hl7.org/fhir/StructureDefinition/Observation": {}, + "http://hl7.org/fhir/StructureDefinition/Encounter": {}, + "http://hl7.org/fhir/StructureDefinition/Bundle": {}, + "http://hl7.org/fhir/StructureDefinition/Parameters": {}, + "http://hl7.org/fhir/StructureDefinition/OperationOutcome": {}, + "http://hl7.org/fhir/StructureDefinition/Provenance": {}, + }, + "fhir.r4.ukcore.stu2": { + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient": {}, + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-AllergyIntolerance": {}, + // UKCore-Observation and UKCore-Encounter are excluded due to a known assertion + // bug in @atomic-ehr/codegen tree-shaking for profiles with polymorphic fields. + // Base R4 Observation and Encounter types are used instead. + }, + }, + }) + .outputTo("./src/fhir-types") + .cleanOutput(true); + +const report = await builder.generate(); +console.log(prettyReport(report)); +if (!report.success) process.exit(1); diff --git a/aidbox-features/aidbox-orchestration-service/src/deduplication.ts b/aidbox-features/aidbox-orchestration-service/src/deduplication.ts new file mode 100644 index 0000000..96f63b6 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/deduplication.ts @@ -0,0 +1,454 @@ +/** + * Deduplication logic for FHIR resources using UK Core profiles + * - Patient: merge by NHS Number + * - AllergyIntolerance: deduplicate by code using ConceptMap/$translate + * - Observation: deduplicate by code + datetime + value + * - Encounter: no deduplication (keep all) + */ + +import type { + Patient, + AllergyIntolerance, + Observation, + Encounter, + Coding, + ParametersParameter, +} from "./fhir-types/hl7-fhir-r4-core"; +import { + UKCorePatientProfile, + UKCoreAllergyIntoleranceProfile, +} from "./fhir-types/fhir-r4-ukcore-stu2/profiles"; +import type { AuthProvider } from "./fhir-clients"; + +const NHS_NUMBER_SYSTEM = "https://fhir.nhs.uk/Id/nhs-number"; + +// UK Core profile URLs +const UK_CORE_PATIENT_PROFILE = "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient"; +const UK_CORE_ALLERGY_PROFILE = "https://fhir.hl7.org.uk/StructureDefinition/UKCore-AllergyIntolerance"; +const UK_CORE_OBSERVATION_PROFILE = "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation"; +const UK_CORE_ENCOUNTER_PROFILE = "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Encounter"; + +// ============ Helper: Ensure UK Core Profile ============ + +function ensureProfile( + resource: T, + profileUrl: string +): T { + const meta = resource.meta ?? {}; + const profiles = meta.profile ?? []; + if (!profiles.includes(profileUrl)) { + profiles.push(profileUrl); + } + return { + ...resource, + meta: { ...meta, profile: profiles }, + }; +} + +// ============ Patient Deduplication ============ + +export function getNhsNumber(patient: Patient): string | undefined { + const profile = new UKCorePatientProfile(patient); + return profile.getNhsNumber()?.value; +} + +export function mergePatients(patients: Patient[]): Patient | null { + if (patients.length === 0) return null; + if (patients.length === 1) { + return ensureProfile(patients[0]!, UK_CORE_PATIENT_PROFILE); + } + + // Take first patient as base, merge additional info from others + const merged = { ...patients[0]! }; + + for (let i = 1; i < patients.length; i++) { + const other = patients[i]!; + + // Merge names - keep the one with more given names + if (other.name && other.name.length > 0) { + const otherName = other.name[0]!; + const currentName = merged.name?.[0]; + + if (!currentName) { + merged.name = other.name; + } else { + const otherGivenCount = otherName.given?.length ?? 0; + const currentGivenCount = currentName.given?.length ?? 0; + if (otherGivenCount > currentGivenCount) { + merged.name = other.name; + } + } + } + + // Merge telecom if not present + if (!merged.telecom && other.telecom) { + merged.telecom = other.telecom; + } + + // Merge address if not present + if (!merged.address && other.address) { + merged.address = other.address; + } + } + + // Generate new ID for merged patient + const nhsNumber = getNhsNumber(merged); + merged.id = `merged-${nhsNumber ?? "unknown"}`; + + // Ensure UK Core profile + return ensureProfile(merged, UK_CORE_PATIENT_PROFILE); +} + +// ============ AllergyIntolerance Deduplication ============ + +interface TranslateResult { + resourceType: "Parameters"; + parameter?: ParametersParameter[]; +} + +export async function translateCode( + mainFhirAuth: AuthProvider, + sourceSystem: string, + code: string, + _targetSystem: string +): Promise { + const url = new URL(`${mainFhirAuth.baseUrl}/fhir/ConceptMap/allergy-loinc-to-snomed/$translate`); + url.searchParams.set("system", sourceSystem); + url.searchParams.set("code", code); + + try { + const response = await mainFhirAuth.fetch(url.toString()); + if (!response.ok) return null; + + const result = (await response.json()) as TranslateResult; + const matchParam = result.parameter?.find(p => p.name === "match"); + const conceptParam = matchParam?.part?.find(p => p.name === "concept"); + return conceptParam?.valueCoding?.code ?? null; + } catch { + return null; + } +} + +function getAllergyCodes(allergy: AllergyIntolerance): Coding[] { + const profile = new UKCoreAllergyIntoleranceProfile(allergy); + const resource = profile.toResource(); + return resource.code?.coding ?? []; +} + +/** + * Get verificationStatus priority for canonical selection. + * Higher priority = better candidate for canonical. + */ +function getVerificationStatusPriority(allergy: AllergyIntolerance): number { + const status = allergy.verificationStatus?.coding?.[0]?.code; + switch (status) { + case "confirmed": return 4; + case "unconfirmed": return 3; + case "refuted": return 2; + case "entered-in-error": return 1; + default: return 0; + } +} + +function sortAllergiesByPriority(allergies: AllergyIntolerance[]): AllergyIntolerance[] { + return [...allergies].sort( + (a, b) => getVerificationStatusPriority(b) - getVerificationStatusPriority(a) + ); +} + +export interface AllergyDeduplicationResult { + allergies: AllergyIntolerance[]; + deduplicationGroups: AllergyIntolerance[][]; +} + +export async function deduplicateAllergies( + allergies: AllergyIntolerance[], + mainFhirAuth: AuthProvider +): Promise { + if (allergies.length === 0) { + return { allergies: [], deduplicationGroups: [] }; + } + if (allergies.length === 1) { + const withProfile = ensureProfile(allergies[0]!, UK_CORE_ALLERGY_PROFILE) as AllergyIntolerance; + return { allergies: [withProfile], deduplicationGroups: [[allergies[0]!]] }; + } + + const sorted = sortAllergiesByPriority(allergies); + const result: AllergyIntolerance[] = []; + const deduplicationGroups: AllergyIntolerance[][] = []; + const processedCodes = new Map(); + + for (const allergy of sorted) { + const codes = getAllergyCodes(allergy); + let matchedGroupIndex: number | null = null; + + for (const coding of codes) { + const codeKey = `${coding.system}|${coding.code}`; + + if (processedCodes.has(codeKey)) { + matchedGroupIndex = processedCodes.get(codeKey)!; + break; + } + + if (coding.system === "http://loinc.org" && coding.code) { + const translatedCode = await translateCode( + mainFhirAuth, + coding.system, + coding.code, + "http://snomed.info/sct" + ); + + if (translatedCode) { + const translatedKey = `http://snomed.info/sct|${translatedCode}`; + if (processedCodes.has(translatedKey)) { + matchedGroupIndex = processedCodes.get(translatedKey)!; + break; + } + } + } + } + + if (matchedGroupIndex !== null) { + deduplicationGroups[matchedGroupIndex]!.push(allergy); + } else { + const groupIndex = deduplicationGroups.length; + const withProfile = ensureProfile(allergy, UK_CORE_ALLERGY_PROFILE) as AllergyIntolerance; + result.push(withProfile); + deduplicationGroups.push([allergy]); + + for (const coding of codes) { + const codeKey = `${coding.system}|${coding.code}`; + processedCodes.set(codeKey, groupIndex); + + if (coding.system === "http://loinc.org" && coding.code) { + const translatedCode = await translateCode( + mainFhirAuth, + coding.system, + coding.code, + "http://snomed.info/sct" + ); + if (translatedCode) { + processedCodes.set(`http://snomed.info/sct|${translatedCode}`, groupIndex); + } + } + } + } + } + + return { allergies: result, deduplicationGroups }; +} + +export function deduplicateAllergiesByExactCode( + allergies: AllergyIntolerance[] +): AllergyIntolerance[] { + const seen = new Set(); + const result: AllergyIntolerance[] = []; + + for (const allergy of allergies) { + const codes = getAllergyCodes(allergy); + const codeKeys = codes.map(c => `${c.system}|${c.code}`); + const isDuplicate = codeKeys.some(key => seen.has(key)); + + if (!isDuplicate) { + codeKeys.forEach(key => seen.add(key)); + const withProfile = ensureProfile(allergy, UK_CORE_ALLERGY_PROFILE) as AllergyIntolerance; + result.push(withProfile); + } + } + + return result; +} + +// ============ Observation Deduplication ============ + +function getObservationCode(obs: Observation): Coding | null { + return obs.code?.coding?.[0] ?? null; +} + +function getObservationDateTime(obs: Observation): Date | null { + if (obs.effectiveDateTime) { + return new Date(obs.effectiveDateTime); + } + return null; +} + +function getObservationValue(obs: Observation): number | null { + if (obs.valueQuantity?.value !== undefined) { + return obs.valueQuantity.value; + } + return null; +} + +function datesWithinTolerance(date1: Date | null, date2: Date | null, toleranceMs: number): boolean { + if (!date1 || !date2) return false; + return Math.abs(date1.getTime() - date2.getTime()) <= toleranceMs; +} + +function observationsMatch(obs1: Observation, obs2: Observation): boolean { + const code1 = getObservationCode(obs1); + const code2 = getObservationCode(obs2); + + if (!code1 || !code2) return false; + if (code1.system !== code2.system || code1.code !== code2.code) return false; + + const date1 = getObservationDateTime(obs1); + const date2 = getObservationDateTime(obs2); + const ONE_HOUR_MS = 60 * 60 * 1000; + if (!datesWithinTolerance(date1, date2, ONE_HOUR_MS)) return false; + + const value1 = getObservationValue(obs1); + const value2 = getObservationValue(obs2); + if (value1 !== null && value2 !== null && value1 !== value2) { + return false; + } + + return true; +} + +function getObservationPriority(obs: Observation): number { + let priority = 0; + if (obs.interpretation && obs.interpretation.length > 0) priority += 2; + if (obs.referenceRange && obs.referenceRange.length > 0) priority += 1; + return priority; +} + +export interface ObservationDeduplicationResult { + observations: Observation[]; + deduplicationGroups: Observation[][]; +} + +export function deduplicateObservations(observations: Observation[]): ObservationDeduplicationResult { + if (observations.length === 0) { + return { observations: [], deduplicationGroups: [] }; + } + if (observations.length === 1) { + const withProfile = ensureProfile(observations[0]!, UK_CORE_OBSERVATION_PROFILE); + return { observations: [withProfile], deduplicationGroups: [[observations[0]!]] }; + } + + const sorted = [...observations].sort( + (a, b) => getObservationPriority(b) - getObservationPriority(a) + ); + + const result: Observation[] = []; + const deduplicationGroups: Observation[][] = []; + const processed = new Set(); + + for (let i = 0; i < sorted.length; i++) { + if (processed.has(i)) continue; + + const obs = sorted[i]!; + const group: Observation[] = [obs]; + processed.add(i); + + for (let j = i + 1; j < sorted.length; j++) { + if (processed.has(j)) continue; + + if (observationsMatch(obs, sorted[j]!)) { + group.push(sorted[j]!); + processed.add(j); + } + } + + const withProfile = ensureProfile(obs, UK_CORE_OBSERVATION_PROFILE); + result.push(withProfile); + deduplicationGroups.push(group); + } + + return { observations: result, deduplicationGroups }; +} + +// ============ Encounter - No Deduplication ============ + +export function collectEncounters(encounterLists: Encounter[][]): Encounter[] { + return encounterLists.flat().map(enc => ensureProfile(enc, UK_CORE_ENCOUNTER_PROFILE)); +} + +// ============ Main Deduplication Function ============ + +export interface DeduplicationInput { + patients: Patient[]; + allergies: AllergyIntolerance[]; + observations: Observation[]; + encounters: Encounter[]; +} + +export interface DeduplicationResult { + patient: Patient | null; + allergies: AllergyIntolerance[]; + observations: Observation[]; + encounters: Encounter[]; + allergyDeduplicationGroups: AllergyIntolerance[][]; + observationDeduplicationGroups: Observation[][]; +} + +// ============ Reference Update ============ + +function updatePatientReferences( + resources: T[], + oldPatientIds: string[], + newPatientId: string +): T[] { + const oldRefs = new Set(oldPatientIds.map(id => `Patient/${id}`)); + const newRef = `Patient/${newPatientId}`; + + return resources.map(resource => { + const updated = { ...resource }; + + if (updated.patient?.reference && oldRefs.has(updated.patient.reference)) { + updated.patient = { ...updated.patient, reference: newRef }; + } + + if (updated.subject?.reference && oldRefs.has(updated.subject.reference)) { + updated.subject = { ...updated.subject, reference: newRef }; + } + + return updated; + }); +} + +export async function deduplicateResources( + input: DeduplicationInput, + mainFhirAuth: AuthProvider +): Promise { + const patient = mergePatients(input.patients); + + const oldPatientIds = input.patients + .map(p => p.id) + .filter((id): id is string => id !== undefined); + + let allergyResult: AllergyDeduplicationResult; + try { + allergyResult = await deduplicateAllergies(input.allergies, mainFhirAuth); + } catch (error) { + console.warn("ConceptMap translation failed, using exact code match:", error); + const exactMatch = deduplicateAllergiesByExactCode(input.allergies); + allergyResult = { + allergies: exactMatch, + deduplicationGroups: exactMatch.map((a) => [a]), + }; + } + + const observationResult = deduplicateObservations(input.observations); + const encounters = collectEncounters([input.encounters]); + + const mergedPatientId = patient?.id; + let allergies = allergyResult.allergies; + let observations = observationResult.observations; + let updatedEncounters = encounters; + + if (mergedPatientId && oldPatientIds.length > 0) { + allergies = updatePatientReferences(allergies, oldPatientIds, mergedPatientId) as AllergyIntolerance[]; + observations = updatePatientReferences(observations, oldPatientIds, mergedPatientId); + updatedEncounters = updatePatientReferences(encounters, oldPatientIds, mergedPatientId); + } + + return { + patient, + allergies, + observations, + encounters: updatedEncounters, + allergyDeduplicationGroups: allergyResult.deduplicationGroups, + observationDeduplicationGroups: observationResult.deduplicationGroups, + }; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-clients.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-clients.ts new file mode 100644 index 0000000..f10040a --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-clients.ts @@ -0,0 +1,106 @@ +/** + * FHIR Client Setup -- re-exports auth providers from aidbox-ts-sdk + * and adds FHIR source fetching logic. + */ + +export { SmartBackendServicesAuthProvider, BasicAuthProvider } from "@health-samurai/aidbox-client"; + +import type { SmartBackendServicesAuthProvider, BasicAuthProvider } from "@health-samurai/aidbox-client"; + +// Simplified AuthProvider type that works with actual implementations +export type AuthProvider = SmartBackendServicesAuthProvider | BasicAuthProvider; + +/** + * Import a PEM-encoded PKCS#8 private key as a CryptoKey for use with SMART Backend Services. + */ +export async function importPrivateKey(pemKey: string): Promise { + // Remove PEM headers and whitespace + const pemContents = pemKey + .replace(/-----BEGIN PRIVATE KEY-----/, "") + .replace(/-----END PRIVATE KEY-----/, "") + .replace(/\s/g, ""); + + // Decode base64 to binary + const binaryDer = Uint8Array.from(atob(pemContents), (c) => c.charCodeAt(0)); + + // Import as CryptoKey + return crypto.subtle.importKey( + "pkcs8", + binaryDer, + { + name: "RSASSA-PKCS1-v1_5", + hash: "SHA-384", + }, + false, + ["sign"] + ); +} +import type { Bundle, Patient, AllergyIntolerance, Encounter, Observation } from "./fhir-types/hl7-fhir-r4-core"; + +// ============ FHIR Client ============ + +export interface FhirSource { + name: string; + auth: AuthProvider; +} + +export interface SourceBundle { + source: string; + bundle: Bundle; + patient: Patient | null; + allergies: AllergyIntolerance[]; + observations: Observation[]; + encounters: Encounter[]; +} + +export async function fetchPatientData( + source: FhirSource, + _nhsNumber: string +): Promise { + const { name, auth } = source; + const baseUrl = auth.baseUrl; + + // Fetch test bundle from external source + const bundleUrl = `${baseUrl}/fhir/Bundle/test-bundle`; + + console.log(`[${name}] Fetching Bundle from ${bundleUrl}`); + + const response = await auth.fetch(bundleUrl); + + if (!response.ok) { + const error = await response.text(); + throw new Error(`[${name}] Failed to fetch bundle: ${response.status} - ${error}`); + } + + const bundle = await response.json() as Bundle; + + // Extract resources from the bundle + const entries = bundle.entry ?? []; + + const patient = entries + .map(e => e.resource) + .find((r): r is Patient => r?.resourceType === "Patient") ?? null; + + const allergies = entries + .map(e => e.resource) + .filter((r): r is AllergyIntolerance => r?.resourceType === "AllergyIntolerance"); + + const observations = entries + .map(e => e.resource) + .filter((r): r is Observation => r?.resourceType === "Observation"); + + const encounters = entries + .map(e => e.resource) + .filter((r): r is Encounter => r?.resourceType === "Encounter"); + + console.log(`[${name}] Received: ${patient ? 1 : 0} Patient, ${allergies.length} Allergy, ${observations.length} Observation, ${encounters.length} Encounter`); + + return { + source: name, + bundle, + patient, + allergies, + observations, + encounters, + }; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/README.md b/aidbox-features/aidbox-orchestration-service/src/fhir-types/README.md new file mode 100644 index 0000000..59582f4 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/README.md @@ -0,0 +1,2758 @@ +# IR Report + +## Package: `fhir.r4.ukcore.stu2` + +### Skipped Canonicals + +- `http://hl7.org/fhir/5.0/StructureDefinition/extension-DiagnosticReport.composition` +- `http://hl7.org/fhir/5.0/StructureDefinition/extension-DiagnosticReport.note` +- `http://hl7.org/fhir/5.0/StructureDefinition/extension-DiagnosticReport.supportingInfo` +- `http://hl7.org/fhir/5.0/StructureDefinition/extension-FamilyMemberHistory.participant` +- `http://hl7.org/fhir/5.0/StructureDefinition/extension-Observation.bodyStructure` +- `http://hl7.org/fhir/5.0/StructureDefinition/extension-Observation.triggeredBy` +- `http://hl7.org/fhir/5.0/StructureDefinition/extension-Specimen.collection.collector` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AdditionalContact` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AdmissionMethod` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AssociatedEncounter` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BodySiteReference` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BookingOrganization` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-CareSettingType` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-CodingSCTDescDisplay` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ConditionEpisode` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-Coverage` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeliveryChannel` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeviceReference` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DischargeMethod` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EmergencyCareDischargeStatus` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-LegalStatus` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ListWarningCode` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-MainLocation` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-MedicationPrescribingOrganizationType` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-MedicationRepeatInformation` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-MedicationStatementLastIssueDate` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-MedicationTradeFamily` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-OutcomeOfAttendance` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ParentPresent` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-PharmacistVerifiedIndicator` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-PriorityReason` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-SampleCategory` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-SourceOfServiceRequest` +- `https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-VaccinationProcedure` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-AllergyIntolerance` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Appointment` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Appointment#appointmentType_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Appointment#specialty_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Composition` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Composition#category_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Composition#section.code_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Composition#type_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Condition` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Condition#category_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Condition#code_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-DiagnosticReport` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-DiagnosticReport#code_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-DiagnosticReport-Lab` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-DiagnosticReport-Lab#code_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Encounter` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Encounter#hospitalization.admitSource_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Encounter#hospitalization.dischargeDisposition_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Encounter#location.physicalType_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Encounter#serviceType_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Encounter#type_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-FamilyMemberHistory` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-FamilyMemberHistory#relationship_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-HealthcareService` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-HealthcareService#communication_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-HealthcareService#specialty_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Immunization` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Immunization#reasonCode_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Immunization#route_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Immunization#site_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Immunization#statusReason_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Immunization#vaccineCode_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-List` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-List#code_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-List#emptyReason_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Location` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Medication` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Medication#code_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Medication#form_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationAdministration` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationAdministration#category_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationAdministration#dosage.method_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationAdministration#dosage.route_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationAdministration#dosage.site_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationDispense` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationDispense#dosageInstruction.method_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationDispense#dosageInstruction.route_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationDispense#dosageInstruction.site_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationDispense#type_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationRequest` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationRequest#category_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationRequest#courseOfTherapyType_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationRequest#dosageInstruction.method_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationRequest#dosageInstruction.route_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationRequest#dosageInstruction.site_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationStatement` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationStatement#category_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationStatement#dosage.method_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationStatement#dosage.route_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationStatement#dosage.site_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation#code_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation#component.code_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation-Group-Lab` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation-Group-Lab#code_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation-Lab` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation-Lab#code_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization#type_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Practitioner` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Practitioner#communication_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-PractitionerRole` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-PractitionerRole#specialty_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Procedure` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Procedure#code_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Procedure#complication_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-RelatedPerson` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-RelatedPerson#communication.language_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-RelatedPerson#relationship_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Schedule` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Schedule#specialty_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest#code_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest#orderDetail_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest#reasonCode_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest-Lab` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest-Lab#code_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest-Lab#orderDetail_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest-Lab#reasonCode_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Slot` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Slot#specialty_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Specimen` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Specimen#collection.bodySite_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Specimen#condition_binding` +- `https://fhir.hl7.org.uk/StructureDefinition/UKCore-Specimen#type_binding` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-AddressKeyType` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-AdmissionMethod` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-AllergyCode` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-AllergyManifestation` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-AllergySubstance` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-AppointmentReasonCode` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-BiopsyState` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-BirthSex` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-BodySite` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-CareSettingType` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-CompositionCategory` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-CompositionSectionCode` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-ConditionCategory` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-ConditionCode` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-ConditionEpisodicity` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-DeathNotificationStatus` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-DeliveryChannel` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-DischargeDestination` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-DischargeMethod` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-DocumentType` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-EmergencyCareDischargeStatus` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-EncounterLocationType` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-EncounterType` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-EthnicCategory` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-FundingCategory` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-GenomeSequencingCategory` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-ImmunizationAdministrationBodySite` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-ImmunizationExplanationReason` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-LegalStatusClassification` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-LegalStatusContext` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-ListCode` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-ListEmptyReasonCode` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-ListWarningCode` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-MedicationAdministrationCategory` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-MedicationCode` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-MedicationDosageMethod` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-MedicationForm` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-MedicationPrescribingOrganizationType` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-MedicationRequestCategory` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-MedicationRequestCourseOfTherapy` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-MedicationStatementCategory` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-MedicationSupplyType` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-MedicationTradeFamily` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-NHSNumberUnavailableReason` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-NHSNumberVerificationStatus` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-ObservationType` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-OrganizationType` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-OtherContactSystem` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-OutcomeOfAttendance` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-PathologyAndLaboratoryMedicineObservables` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-PathologyAndLaboratoryMedicineProcedures` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-PersonMaritalStatusCode` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-PersonRelationshipType` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-PracticeSettingCode` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-PreferredContactMethod` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-PreferredWrittenCommunicationFormat` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-ProcedureCode` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-ReasonImmunizationNotAdministered` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-ReportCode` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-ResidentialStatus` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-SampleCategory` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-ServiceRequestReasonCode` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-SourceOfAdmission` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-SourceOfServiceRequest` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-SpecimenBodySite` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-SpecimenType` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-SubstanceOrProductAdministrationRoute` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-VaccinationProcedure` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-VaccinationProcedureSupplementary` +- `https://fhir.hl7.org.uk/ValueSet/UKCore-VaccineCode` + +## Package: `hl7.fhir.r4.core` + +### Skipped Canonicals + +- `http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities` +- `http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris` +- `http://hl7.org/fhir/StructureDefinition/11179-objectClass` +- `http://hl7.org/fhir/StructureDefinition/11179-objectClassProperty` +- `http://hl7.org/fhir/StructureDefinition/11179-permitted-value-conceptmap` +- `http://hl7.org/fhir/StructureDefinition/11179-permitted-value-valueset` +- `http://hl7.org/fhir/StructureDefinition/Account` +- `http://hl7.org/fhir/StructureDefinition/ActivityDefinition` +- `http://hl7.org/fhir/StructureDefinition/AdverseEvent` +- `http://hl7.org/fhir/StructureDefinition/AllergyIntolerance` +- `http://hl7.org/fhir/StructureDefinition/Appointment` +- `http://hl7.org/fhir/StructureDefinition/AppointmentResponse` +- `http://hl7.org/fhir/StructureDefinition/AuditEvent` +- `http://hl7.org/fhir/StructureDefinition/Basic` +- `http://hl7.org/fhir/StructureDefinition/Binary` +- `http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProduct` +- `http://hl7.org/fhir/StructureDefinition/BodyStructure` +- `http://hl7.org/fhir/StructureDefinition/Bundle` +- `http://hl7.org/fhir/StructureDefinition/CapabilityStatement` +- `http://hl7.org/fhir/StructureDefinition/CarePlan` +- `http://hl7.org/fhir/StructureDefinition/CareTeam` +- `http://hl7.org/fhir/StructureDefinition/CatalogEntry` +- `http://hl7.org/fhir/StructureDefinition/ChargeItem` +- `http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition` +- `http://hl7.org/fhir/StructureDefinition/Claim` +- `http://hl7.org/fhir/StructureDefinition/ClaimResponse` +- `http://hl7.org/fhir/StructureDefinition/ClinicalImpression` +- `http://hl7.org/fhir/StructureDefinition/CodeSystem` +- `http://hl7.org/fhir/StructureDefinition/Communication` +- `http://hl7.org/fhir/StructureDefinition/CommunicationRequest` +- `http://hl7.org/fhir/StructureDefinition/CompartmentDefinition` +- `http://hl7.org/fhir/StructureDefinition/Composition` +- `http://hl7.org/fhir/StructureDefinition/ConceptMap` +- `http://hl7.org/fhir/StructureDefinition/Condition` +- `http://hl7.org/fhir/StructureDefinition/Consent` +- `http://hl7.org/fhir/StructureDefinition/Contract` +- `http://hl7.org/fhir/StructureDefinition/Coverage` +- `http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest` +- `http://hl7.org/fhir/StructureDefinition/CoverageEligibilityResponse` +- `http://hl7.org/fhir/StructureDefinition/Definition` +- `http://hl7.org/fhir/StructureDefinition/DetectedIssue` +- `http://hl7.org/fhir/StructureDefinition/Device` +- `http://hl7.org/fhir/StructureDefinition/DeviceDefinition` +- `http://hl7.org/fhir/StructureDefinition/DeviceMetric` +- `http://hl7.org/fhir/StructureDefinition/DeviceRequest` +- `http://hl7.org/fhir/StructureDefinition/DeviceUseStatement` +- `http://hl7.org/fhir/StructureDefinition/DiagnosticReport` +- `http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsAnalysis` +- `http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsAssessedCondition` +- `http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsFamilyMemberHistory` +- `http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsReferences` +- `http://hl7.org/fhir/StructureDefinition/DocumentManifest` +- `http://hl7.org/fhir/StructureDefinition/DocumentReference` +- `http://hl7.org/fhir/StructureDefinition/EffectEvidenceSynthesis` +- `http://hl7.org/fhir/StructureDefinition/ElementDefinition` +- `http://hl7.org/fhir/StructureDefinition/Encounter` +- `http://hl7.org/fhir/StructureDefinition/Endpoint` +- `http://hl7.org/fhir/StructureDefinition/EnrollmentRequest` +- `http://hl7.org/fhir/StructureDefinition/EnrollmentResponse` +- `http://hl7.org/fhir/StructureDefinition/EpisodeOfCare` +- `http://hl7.org/fhir/StructureDefinition/Event` +- `http://hl7.org/fhir/StructureDefinition/EventDefinition` +- `http://hl7.org/fhir/StructureDefinition/Evidence` +- `http://hl7.org/fhir/StructureDefinition/EvidenceVariable` +- `http://hl7.org/fhir/StructureDefinition/ExampleScenario` +- `http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit` +- `http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory` +- `http://hl7.org/fhir/StructureDefinition/FiveWs` +- `http://hl7.org/fhir/StructureDefinition/Flag` +- `http://hl7.org/fhir/StructureDefinition/Goal` +- `http://hl7.org/fhir/StructureDefinition/GraphDefinition` +- `http://hl7.org/fhir/StructureDefinition/Group` +- `http://hl7.org/fhir/StructureDefinition/GuidanceResponse` +- `http://hl7.org/fhir/StructureDefinition/HealthcareService` +- `http://hl7.org/fhir/StructureDefinition/ImagingStudy` +- `http://hl7.org/fhir/StructureDefinition/Immunization` +- `http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation` +- `http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation` +- `http://hl7.org/fhir/StructureDefinition/ImplementationGuide` +- `http://hl7.org/fhir/StructureDefinition/InsurancePlan` +- `http://hl7.org/fhir/StructureDefinition/Invoice` +- `http://hl7.org/fhir/StructureDefinition/Library` +- `http://hl7.org/fhir/StructureDefinition/Linkage` +- `http://hl7.org/fhir/StructureDefinition/List` +- `http://hl7.org/fhir/StructureDefinition/Location` +- `http://hl7.org/fhir/StructureDefinition/MarketingStatus` +- `http://hl7.org/fhir/StructureDefinition/Measure` +- `http://hl7.org/fhir/StructureDefinition/MeasureReport` +- `http://hl7.org/fhir/StructureDefinition/Media` +- `http://hl7.org/fhir/StructureDefinition/Medication` +- `http://hl7.org/fhir/StructureDefinition/MedicationAdministration` +- `http://hl7.org/fhir/StructureDefinition/MedicationDispense` +- `http://hl7.org/fhir/StructureDefinition/MedicationKnowledge` +- `http://hl7.org/fhir/StructureDefinition/MedicationRequest` +- `http://hl7.org/fhir/StructureDefinition/MedicationStatement` +- `http://hl7.org/fhir/StructureDefinition/MedicinalProduct` +- `http://hl7.org/fhir/StructureDefinition/MedicinalProductAuthorization` +- `http://hl7.org/fhir/StructureDefinition/MedicinalProductContraindication` +- `http://hl7.org/fhir/StructureDefinition/MedicinalProductIndication` +- `http://hl7.org/fhir/StructureDefinition/MedicinalProductIngredient` +- `http://hl7.org/fhir/StructureDefinition/MedicinalProductInteraction` +- `http://hl7.org/fhir/StructureDefinition/MedicinalProductManufactured` +- `http://hl7.org/fhir/StructureDefinition/MedicinalProductPackaged` +- `http://hl7.org/fhir/StructureDefinition/MedicinalProductPharmaceutical` +- `http://hl7.org/fhir/StructureDefinition/MedicinalProductUndesirableEffect` +- `http://hl7.org/fhir/StructureDefinition/MessageDefinition` +- `http://hl7.org/fhir/StructureDefinition/MessageHeader` +- `http://hl7.org/fhir/StructureDefinition/MetadataResource` +- `http://hl7.org/fhir/StructureDefinition/MolecularSequence` +- `http://hl7.org/fhir/StructureDefinition/MoneyQuantity` +- `http://hl7.org/fhir/StructureDefinition/NamingSystem` +- `http://hl7.org/fhir/StructureDefinition/NutritionOrder` +- `http://hl7.org/fhir/StructureDefinition/Observation` +- `http://hl7.org/fhir/StructureDefinition/ObservationDefinition` +- `http://hl7.org/fhir/StructureDefinition/OperationDefinition` +- `http://hl7.org/fhir/StructureDefinition/OperationOutcome` +- `http://hl7.org/fhir/StructureDefinition/Organization` +- `http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation` +- `http://hl7.org/fhir/StructureDefinition/Parameters` +- `http://hl7.org/fhir/StructureDefinition/Patient` +- `http://hl7.org/fhir/StructureDefinition/PaymentNotice` +- `http://hl7.org/fhir/StructureDefinition/PaymentReconciliation` +- `http://hl7.org/fhir/StructureDefinition/Person` +- `http://hl7.org/fhir/StructureDefinition/PlanDefinition` +- `http://hl7.org/fhir/StructureDefinition/Population` +- `http://hl7.org/fhir/StructureDefinition/Practitioner` +- `http://hl7.org/fhir/StructureDefinition/PractitionerRole` +- `http://hl7.org/fhir/StructureDefinition/Procedure` +- `http://hl7.org/fhir/StructureDefinition/ProdCharacteristic` +- `http://hl7.org/fhir/StructureDefinition/ProductShelfLife` +- `http://hl7.org/fhir/StructureDefinition/Provenance` +- `http://hl7.org/fhir/StructureDefinition/Questionnaire` +- `http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse` +- `http://hl7.org/fhir/StructureDefinition/RelatedPerson` +- `http://hl7.org/fhir/StructureDefinition/Request` +- `http://hl7.org/fhir/StructureDefinition/RequestGroup` +- `http://hl7.org/fhir/StructureDefinition/ResearchDefinition` +- `http://hl7.org/fhir/StructureDefinition/ResearchElementDefinition` +- `http://hl7.org/fhir/StructureDefinition/ResearchStudy` +- `http://hl7.org/fhir/StructureDefinition/ResearchSubject` +- `http://hl7.org/fhir/StructureDefinition/RiskAssessment` +- `http://hl7.org/fhir/StructureDefinition/RiskEvidenceSynthesis` +- `http://hl7.org/fhir/StructureDefinition/Schedule` +- `http://hl7.org/fhir/StructureDefinition/SearchParameter` +- `http://hl7.org/fhir/StructureDefinition/ServiceRequest` +- `http://hl7.org/fhir/StructureDefinition/SimpleQuantity` +- `http://hl7.org/fhir/StructureDefinition/Slot` +- `http://hl7.org/fhir/StructureDefinition/Specimen` +- `http://hl7.org/fhir/StructureDefinition/SpecimenDefinition` +- `http://hl7.org/fhir/StructureDefinition/StructureDefinition` +- `http://hl7.org/fhir/StructureDefinition/StructureMap` +- `http://hl7.org/fhir/StructureDefinition/Subscription` +- `http://hl7.org/fhir/StructureDefinition/Substance` +- `http://hl7.org/fhir/StructureDefinition/SubstanceAmount` +- `http://hl7.org/fhir/StructureDefinition/SubstanceNucleicAcid` +- `http://hl7.org/fhir/StructureDefinition/SubstancePolymer` +- `http://hl7.org/fhir/StructureDefinition/SubstanceProtein` +- `http://hl7.org/fhir/StructureDefinition/SubstanceReferenceInformation` +- `http://hl7.org/fhir/StructureDefinition/SubstanceSourceMaterial` +- `http://hl7.org/fhir/StructureDefinition/SubstanceSpecification` +- `http://hl7.org/fhir/StructureDefinition/SupplyDelivery` +- `http://hl7.org/fhir/StructureDefinition/SupplyRequest` +- `http://hl7.org/fhir/StructureDefinition/Task` +- `http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities` +- `http://hl7.org/fhir/StructureDefinition/TestReport` +- `http://hl7.org/fhir/StructureDefinition/TestScript` +- `http://hl7.org/fhir/StructureDefinition/ValueSet` +- `http://hl7.org/fhir/StructureDefinition/VerificationResult` +- `http://hl7.org/fhir/StructureDefinition/VisionPrescription` +- `http://hl7.org/fhir/StructureDefinition/actualgroup` +- `http://hl7.org/fhir/StructureDefinition/allergyintolerance-assertedDate` +- `http://hl7.org/fhir/StructureDefinition/allergyintolerance-certainty` +- `http://hl7.org/fhir/StructureDefinition/allergyintolerance-duration` +- `http://hl7.org/fhir/StructureDefinition/allergyintolerance-reasonRefuted` +- `http://hl7.org/fhir/StructureDefinition/allergyintolerance-resolutionAge` +- `http://hl7.org/fhir/StructureDefinition/allergyintolerance-substanceExposureRisk` +- `http://hl7.org/fhir/StructureDefinition/auditevent-Accession` +- `http://hl7.org/fhir/StructureDefinition/auditevent-Anonymized` +- `http://hl7.org/fhir/StructureDefinition/auditevent-Encrypted` +- `http://hl7.org/fhir/StructureDefinition/auditevent-Instance` +- `http://hl7.org/fhir/StructureDefinition/auditevent-MPPS` +- `http://hl7.org/fhir/StructureDefinition/auditevent-NumberOfInstances` +- `http://hl7.org/fhir/StructureDefinition/auditevent-ParticipantObjectContainsStudy` +- `http://hl7.org/fhir/StructureDefinition/auditevent-SOPClass` +- `http://hl7.org/fhir/StructureDefinition/bmi` +- `http://hl7.org/fhir/StructureDefinition/bodySite` +- `http://hl7.org/fhir/StructureDefinition/bodyheight` +- `http://hl7.org/fhir/StructureDefinition/bodytemp` +- `http://hl7.org/fhir/StructureDefinition/bodyweight` +- `http://hl7.org/fhir/StructureDefinition/bp` +- `http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation` +- `http://hl7.org/fhir/StructureDefinition/capabilitystatement-prohibited` +- `http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination` +- `http://hl7.org/fhir/StructureDefinition/capabilitystatement-supported-system` +- `http://hl7.org/fhir/StructureDefinition/capabilitystatement-websocket` +- `http://hl7.org/fhir/StructureDefinition/careplan-activity-title` +- `http://hl7.org/fhir/StructureDefinition/catalog` +- `http://hl7.org/fhir/StructureDefinition/cdshooksguidanceresponse` +- `http://hl7.org/fhir/StructureDefinition/cdshooksrequestgroup` +- `http://hl7.org/fhir/StructureDefinition/cdshooksserviceplandefinition` +- `http://hl7.org/fhir/StructureDefinition/cholesterol` +- `http://hl7.org/fhir/StructureDefinition/clinicaldocument` +- `http://hl7.org/fhir/StructureDefinition/codesystem-alternate` +- `http://hl7.org/fhir/StructureDefinition/codesystem-author` +- `http://hl7.org/fhir/StructureDefinition/codesystem-concept-comments` +- `http://hl7.org/fhir/StructureDefinition/codesystem-conceptOrder` +- `http://hl7.org/fhir/StructureDefinition/codesystem-effectiveDate` +- `http://hl7.org/fhir/StructureDefinition/codesystem-expirationDate` +- `http://hl7.org/fhir/StructureDefinition/codesystem-history` +- `http://hl7.org/fhir/StructureDefinition/codesystem-keyWord` +- `http://hl7.org/fhir/StructureDefinition/codesystem-label` +- `http://hl7.org/fhir/StructureDefinition/codesystem-map` +- `http://hl7.org/fhir/StructureDefinition/codesystem-otherName` +- `http://hl7.org/fhir/StructureDefinition/codesystem-replacedby` +- `http://hl7.org/fhir/StructureDefinition/codesystem-sourceReference` +- `http://hl7.org/fhir/StructureDefinition/codesystem-trusted-expansion` +- `http://hl7.org/fhir/StructureDefinition/codesystem-usage` +- `http://hl7.org/fhir/StructureDefinition/codesystem-warning` +- `http://hl7.org/fhir/StructureDefinition/codesystem-workflowStatus` +- `http://hl7.org/fhir/StructureDefinition/coding-sctdescid` +- `http://hl7.org/fhir/StructureDefinition/communication-media` +- `http://hl7.org/fhir/StructureDefinition/communicationrequest-initiatingLocation` +- `http://hl7.org/fhir/StructureDefinition/composition-clinicaldocument-otherConfidentiality` +- `http://hl7.org/fhir/StructureDefinition/composition-clinicaldocument-versionNumber` +- `http://hl7.org/fhir/StructureDefinition/composition-section-subject` +- `http://hl7.org/fhir/StructureDefinition/computableplandefinition` +- `http://hl7.org/fhir/StructureDefinition/concept-bidirectional` +- `http://hl7.org/fhir/StructureDefinition/condition-assertedDate` +- `http://hl7.org/fhir/StructureDefinition/condition-dueTo` +- `http://hl7.org/fhir/StructureDefinition/condition-occurredFollowing` +- `http://hl7.org/fhir/StructureDefinition/condition-outcome` +- `http://hl7.org/fhir/StructureDefinition/condition-related` +- `http://hl7.org/fhir/StructureDefinition/condition-ruledOut` +- `http://hl7.org/fhir/StructureDefinition/consent-NotificationEndpoint` +- `http://hl7.org/fhir/StructureDefinition/consent-Transcriber` +- `http://hl7.org/fhir/StructureDefinition/consent-Witness` +- `http://hl7.org/fhir/StructureDefinition/consent-location` +- `http://hl7.org/fhir/StructureDefinition/contactpoint-area` +- `http://hl7.org/fhir/StructureDefinition/contactpoint-country` +- `http://hl7.org/fhir/StructureDefinition/contactpoint-extension` +- `http://hl7.org/fhir/StructureDefinition/contactpoint-local` +- `http://hl7.org/fhir/StructureDefinition/cqf-calculatedValue` +- `http://hl7.org/fhir/StructureDefinition/cqf-cdsHooksEndpoint` +- `http://hl7.org/fhir/StructureDefinition/cqf-citation` +- `http://hl7.org/fhir/StructureDefinition/cqf-encounterClass` +- `http://hl7.org/fhir/StructureDefinition/cqf-encounterType` +- `http://hl7.org/fhir/StructureDefinition/cqf-expression` +- `http://hl7.org/fhir/StructureDefinition/cqf-initialValue` +- `http://hl7.org/fhir/StructureDefinition/cqf-initiatingOrganization` +- `http://hl7.org/fhir/StructureDefinition/cqf-initiatingPerson` +- `http://hl7.org/fhir/StructureDefinition/cqf-library` +- `http://hl7.org/fhir/StructureDefinition/cqf-measureInfo` +- `http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence` +- `http://hl7.org/fhir/StructureDefinition/cqf-questionnaire` +- `http://hl7.org/fhir/StructureDefinition/cqf-receivingOrganization` +- `http://hl7.org/fhir/StructureDefinition/cqf-receivingPerson` +- `http://hl7.org/fhir/StructureDefinition/cqf-recipientLanguage` +- `http://hl7.org/fhir/StructureDefinition/cqf-recipientType` +- `http://hl7.org/fhir/StructureDefinition/cqf-relativeDateTime` +- `http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation` +- `http://hl7.org/fhir/StructureDefinition/cqf-systemUserLanguage` +- `http://hl7.org/fhir/StructureDefinition/cqf-systemUserTaskContext` +- `http://hl7.org/fhir/StructureDefinition/cqf-systemUserType` +- `http://hl7.org/fhir/StructureDefinition/cqllibrary` +- `http://hl7.org/fhir/StructureDefinition/cqm-ValidityPeriod` +- `http://hl7.org/fhir/StructureDefinition/data-absent-reason` +- `http://hl7.org/fhir/StructureDefinition/designNote` +- `http://hl7.org/fhir/StructureDefinition/device-implantStatus` +- `http://hl7.org/fhir/StructureDefinition/devicemetricobservation` +- `http://hl7.org/fhir/StructureDefinition/devicerequest-patientInstruction` +- `http://hl7.org/fhir/StructureDefinition/diagnosticReport-addendumOf` +- `http://hl7.org/fhir/StructureDefinition/diagnosticReport-extends` +- `http://hl7.org/fhir/StructureDefinition/diagnosticReport-locationPerformed` +- `http://hl7.org/fhir/StructureDefinition/diagnosticReport-replaces` +- `http://hl7.org/fhir/StructureDefinition/diagnosticReport-risk` +- `http://hl7.org/fhir/StructureDefinition/diagnosticReport-summaryOf` +- `http://hl7.org/fhir/StructureDefinition/diagnosticreport-genetics` +- `http://hl7.org/fhir/StructureDefinition/display` +- `http://hl7.org/fhir/StructureDefinition/ehrsrle-auditevent` +- `http://hl7.org/fhir/StructureDefinition/ehrsrle-provenance` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-allowedUnits` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-de` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-equivalence` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-identifier` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-inheritedExtensibleValueSet` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-minValueSet` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-profile-element` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-question` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-selector` +- `http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable` +- `http://hl7.org/fhir/StructureDefinition/encounter-associatedEncounter` +- `http://hl7.org/fhir/StructureDefinition/encounter-modeOfArrival` +- `http://hl7.org/fhir/StructureDefinition/encounter-reasonCancelled` +- `http://hl7.org/fhir/StructureDefinition/entryFormat` +- `http://hl7.org/fhir/StructureDefinition/event-basedOn` +- `http://hl7.org/fhir/StructureDefinition/event-eventHistory` +- `http://hl7.org/fhir/StructureDefinition/event-location` +- `http://hl7.org/fhir/StructureDefinition/event-partOf` +- `http://hl7.org/fhir/StructureDefinition/event-performerFunction` +- `http://hl7.org/fhir/StructureDefinition/event-statusReason` +- `http://hl7.org/fhir/StructureDefinition/example-composition` +- `http://hl7.org/fhir/StructureDefinition/example-section-library` +- `http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-observation` +- `http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-parent` +- `http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-sibling` +- `http://hl7.org/fhir/StructureDefinition/familymemberhistory-abatement` +- `http://hl7.org/fhir/StructureDefinition/familymemberhistory-genetic` +- `http://hl7.org/fhir/StructureDefinition/familymemberhistory-patient-record` +- `http://hl7.org/fhir/StructureDefinition/familymemberhistory-severity` +- `http://hl7.org/fhir/StructureDefinition/familymemberhistory-type` +- `http://hl7.org/fhir/StructureDefinition/flag-detail` +- `http://hl7.org/fhir/StructureDefinition/flag-priority` +- `http://hl7.org/fhir/StructureDefinition/geolocation` +- `http://hl7.org/fhir/StructureDefinition/goal-acceptance` +- `http://hl7.org/fhir/StructureDefinition/goal-reasonRejected` +- `http://hl7.org/fhir/StructureDefinition/goal-relationship` +- `http://hl7.org/fhir/StructureDefinition/groupdefinition` +- `http://hl7.org/fhir/StructureDefinition/hdlcholesterol` +- `http://hl7.org/fhir/StructureDefinition/headcircum` +- `http://hl7.org/fhir/StructureDefinition/heartrate` +- `http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-allele-database` +- `http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-glstring` +- `http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-haploid` +- `http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-method` +- `http://hl7.org/fhir/StructureDefinition/hlaresult` +- `http://hl7.org/fhir/StructureDefinition/http-response-header` +- `http://hl7.org/fhir/StructureDefinition/humanname-assembly-order` +- `http://hl7.org/fhir/StructureDefinition/humanname-fathers-family` +- `http://hl7.org/fhir/StructureDefinition/humanname-mothers-family` +- `http://hl7.org/fhir/StructureDefinition/humanname-own-name` +- `http://hl7.org/fhir/StructureDefinition/humanname-own-prefix` +- `http://hl7.org/fhir/StructureDefinition/humanname-partner-name` +- `http://hl7.org/fhir/StructureDefinition/humanname-partner-prefix` +- `http://hl7.org/fhir/StructureDefinition/identifier-validDate` +- `http://hl7.org/fhir/StructureDefinition/iso21090-AD-use` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-additionalLocator` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-buildingNumberSuffix` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-careOf` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-censusTract` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-delimiter` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryAddressLine` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryInstallationArea` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryInstallationQualifier` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryInstallationType` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryMode` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryModeIdentifier` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-direction` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumberNumeric` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-postBox` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-precinct` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetAddressLine` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetName` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetNameBase` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetNameType` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-unitID` +- `http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-unitType` +- `http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier` +- `http://hl7.org/fhir/StructureDefinition/iso21090-EN-representation` +- `http://hl7.org/fhir/StructureDefinition/iso21090-EN-use` +- `http://hl7.org/fhir/StructureDefinition/iso21090-PQ-translation` +- `http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding` +- `http://hl7.org/fhir/StructureDefinition/iso21090-TEL-address` +- `http://hl7.org/fhir/StructureDefinition/iso21090-nullFlavor` +- `http://hl7.org/fhir/StructureDefinition/iso21090-preferred` +- `http://hl7.org/fhir/StructureDefinition/iso21090-uncertainty` +- `http://hl7.org/fhir/StructureDefinition/iso21090-uncertaintyType` +- `http://hl7.org/fhir/StructureDefinition/language` +- `http://hl7.org/fhir/StructureDefinition/ldlcholesterol` +- `http://hl7.org/fhir/StructureDefinition/lipidprofile` +- `http://hl7.org/fhir/StructureDefinition/list-changeBase` +- `http://hl7.org/fhir/StructureDefinition/location-boundary-geojson` +- `http://hl7.org/fhir/StructureDefinition/location-distance` +- `http://hl7.org/fhir/StructureDefinition/match-grade` +- `http://hl7.org/fhir/StructureDefinition/maxDecimalPlaces` +- `http://hl7.org/fhir/StructureDefinition/maxSize` +- `http://hl7.org/fhir/StructureDefinition/maxValue` +- `http://hl7.org/fhir/StructureDefinition/messageheader-response-request` +- `http://hl7.org/fhir/StructureDefinition/mimeType` +- `http://hl7.org/fhir/StructureDefinition/minLength` +- `http://hl7.org/fhir/StructureDefinition/minValue` +- `http://hl7.org/fhir/StructureDefinition/narrativeLink` +- `http://hl7.org/fhir/StructureDefinition/nutritionorder-adaptiveFeedingDevice` +- `http://hl7.org/fhir/StructureDefinition/observation-bodyPosition` +- `http://hl7.org/fhir/StructureDefinition/observation-delta` +- `http://hl7.org/fhir/StructureDefinition/observation-deviceCode` +- `http://hl7.org/fhir/StructureDefinition/observation-focusCode` +- `http://hl7.org/fhir/StructureDefinition/observation-gatewayDevice` +- `http://hl7.org/fhir/StructureDefinition/observation-genetics` +- `http://hl7.org/fhir/StructureDefinition/observation-geneticsAllele` +- `http://hl7.org/fhir/StructureDefinition/observation-geneticsAminoAcidChange` +- `http://hl7.org/fhir/StructureDefinition/observation-geneticsAncestry` +- `http://hl7.org/fhir/StructureDefinition/observation-geneticsCopyNumberEvent` +- `http://hl7.org/fhir/StructureDefinition/observation-geneticsDNARegionName` +- `http://hl7.org/fhir/StructureDefinition/observation-geneticsGene` +- `http://hl7.org/fhir/StructureDefinition/observation-geneticsGenomicSourceClass` +- `http://hl7.org/fhir/StructureDefinition/observation-geneticsInterpretation` +- `http://hl7.org/fhir/StructureDefinition/observation-geneticsPhaseSet` +- `http://hl7.org/fhir/StructureDefinition/observation-geneticsVariant` +- `http://hl7.org/fhir/StructureDefinition/observation-precondition` +- `http://hl7.org/fhir/StructureDefinition/observation-reagent` +- `http://hl7.org/fhir/StructureDefinition/observation-replaces` +- `http://hl7.org/fhir/StructureDefinition/observation-secondaryFinding` +- `http://hl7.org/fhir/StructureDefinition/observation-sequelTo` +- `http://hl7.org/fhir/StructureDefinition/observation-specimenCode` +- `http://hl7.org/fhir/StructureDefinition/observation-timeOffset` +- `http://hl7.org/fhir/StructureDefinition/openEHR-administration` +- `http://hl7.org/fhir/StructureDefinition/openEHR-careplan` +- `http://hl7.org/fhir/StructureDefinition/openEHR-exposureDate` +- `http://hl7.org/fhir/StructureDefinition/openEHR-exposureDescription` +- `http://hl7.org/fhir/StructureDefinition/openEHR-exposureDuration` +- `http://hl7.org/fhir/StructureDefinition/openEHR-location` +- `http://hl7.org/fhir/StructureDefinition/openEHR-management` +- `http://hl7.org/fhir/StructureDefinition/openEHR-test` +- `http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type` +- `http://hl7.org/fhir/StructureDefinition/operationdefinition-profile` +- `http://hl7.org/fhir/StructureDefinition/operationoutcome-authority` +- `http://hl7.org/fhir/StructureDefinition/operationoutcome-detectedIssue` +- `http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-source` +- `http://hl7.org/fhir/StructureDefinition/ordinalValue` +- `http://hl7.org/fhir/StructureDefinition/organization-period` +- `http://hl7.org/fhir/StructureDefinition/organization-preferredContact` +- `http://hl7.org/fhir/StructureDefinition/organizationaffiliation-primaryInd` +- `http://hl7.org/fhir/StructureDefinition/originalText` +- `http://hl7.org/fhir/StructureDefinition/oxygensat` +- `http://hl7.org/fhir/StructureDefinition/parameters-fullUrl` +- `http://hl7.org/fhir/StructureDefinition/patient-adoptionInfo` +- `http://hl7.org/fhir/StructureDefinition/patient-animal` +- `http://hl7.org/fhir/StructureDefinition/patient-citizenship` +- `http://hl7.org/fhir/StructureDefinition/patient-congregation` +- `http://hl7.org/fhir/StructureDefinition/patient-disability` +- `http://hl7.org/fhir/StructureDefinition/patient-genderIdentity` +- `http://hl7.org/fhir/StructureDefinition/patient-importance` +- `http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName` +- `http://hl7.org/fhir/StructureDefinition/patient-nationality` +- `http://hl7.org/fhir/StructureDefinition/patient-preferenceType` +- `http://hl7.org/fhir/StructureDefinition/patient-relatedPerson` +- `http://hl7.org/fhir/StructureDefinition/patient-religion` +- `http://hl7.org/fhir/StructureDefinition/picoelement` +- `http://hl7.org/fhir/StructureDefinition/practitioner-animalSpecies` +- `http://hl7.org/fhir/StructureDefinition/practitionerrole-primaryInd` +- `http://hl7.org/fhir/StructureDefinition/procedure-approachBodyStructure` +- `http://hl7.org/fhir/StructureDefinition/procedure-causedBy` +- `http://hl7.org/fhir/StructureDefinition/procedure-directedBy` +- `http://hl7.org/fhir/StructureDefinition/procedure-incisionDateTime` +- `http://hl7.org/fhir/StructureDefinition/procedure-method` +- `http://hl7.org/fhir/StructureDefinition/procedure-progressStatus` +- `http://hl7.org/fhir/StructureDefinition/procedure-schedule` +- `http://hl7.org/fhir/StructureDefinition/procedure-targetBodyStructure` +- `http://hl7.org/fhir/StructureDefinition/provenance-relevant-history` +- `http://hl7.org/fhir/StructureDefinition/quantity-precision` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-baseType` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-constraint` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-displayCategory` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-hidden` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-optionExclusive` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-optionPrefix` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-referenceProfile` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-signatureRequired` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-sliderStepValue` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-unit` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-unitValueSet` +- `http://hl7.org/fhir/StructureDefinition/questionnaire-usageMode` +- `http://hl7.org/fhir/StructureDefinition/questionnaireresponse-author` +- `http://hl7.org/fhir/StructureDefinition/questionnaireresponse-completionMode` +- `http://hl7.org/fhir/StructureDefinition/questionnaireresponse-reason` +- `http://hl7.org/fhir/StructureDefinition/questionnaireresponse-reviewer` +- `http://hl7.org/fhir/StructureDefinition/questionnaireresponse-signature` +- `http://hl7.org/fhir/StructureDefinition/regex` +- `http://hl7.org/fhir/StructureDefinition/relative-date` +- `http://hl7.org/fhir/StructureDefinition/rendered-value` +- `http://hl7.org/fhir/StructureDefinition/rendering-markdown` +- `http://hl7.org/fhir/StructureDefinition/rendering-style` +- `http://hl7.org/fhir/StructureDefinition/rendering-styleSensitive` +- `http://hl7.org/fhir/StructureDefinition/rendering-xhtml` +- `http://hl7.org/fhir/StructureDefinition/replaces` +- `http://hl7.org/fhir/StructureDefinition/request-doNotPerform` +- `http://hl7.org/fhir/StructureDefinition/request-insurance` +- `http://hl7.org/fhir/StructureDefinition/request-performerOrder` +- `http://hl7.org/fhir/StructureDefinition/request-relevantHistory` +- `http://hl7.org/fhir/StructureDefinition/request-replaces` +- `http://hl7.org/fhir/StructureDefinition/request-statusReason` +- `http://hl7.org/fhir/StructureDefinition/resource-approvalDate` +- `http://hl7.org/fhir/StructureDefinition/resource-effectivePeriod` +- `http://hl7.org/fhir/StructureDefinition/resource-lastReviewDate` +- `http://hl7.org/fhir/StructureDefinition/resource-pertainsToGoal` +- `http://hl7.org/fhir/StructureDefinition/resprate` +- `http://hl7.org/fhir/StructureDefinition/servicerequest-genetics` +- `http://hl7.org/fhir/StructureDefinition/servicerequest-geneticsItem` +- `http://hl7.org/fhir/StructureDefinition/servicerequest-precondition` +- `http://hl7.org/fhir/StructureDefinition/servicerequest-questionnaireRequest` +- `http://hl7.org/fhir/StructureDefinition/shareableactivitydefinition` +- `http://hl7.org/fhir/StructureDefinition/shareablecodesystem` +- `http://hl7.org/fhir/StructureDefinition/shareablelibrary` +- `http://hl7.org/fhir/StructureDefinition/shareablemeasure` +- `http://hl7.org/fhir/StructureDefinition/shareableplandefinition` +- `http://hl7.org/fhir/StructureDefinition/shareablevalueset` +- `http://hl7.org/fhir/StructureDefinition/specimen-collectionPriority` +- `http://hl7.org/fhir/StructureDefinition/specimen-isDryWeight` +- `http://hl7.org/fhir/StructureDefinition/specimen-processingTime` +- `http://hl7.org/fhir/StructureDefinition/specimen-sequenceNumber` +- `http://hl7.org/fhir/StructureDefinition/specimen-specialHandling` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-ancestor` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-applicable-version` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-category` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-codegen-super` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-dependencies` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm-no-warnings` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-summary` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-table-name` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-template-status` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-wg` +- `http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-no-order` +- `http://hl7.org/fhir/StructureDefinition/synthesis` +- `http://hl7.org/fhir/StructureDefinition/task-candidateList` +- `http://hl7.org/fhir/StructureDefinition/task-replaces` +- `http://hl7.org/fhir/StructureDefinition/timing-dayOfMonth` +- `http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle` +- `http://hl7.org/fhir/StructureDefinition/timing-exact` +- `http://hl7.org/fhir/StructureDefinition/translation` +- `http://hl7.org/fhir/StructureDefinition/triglyceride` +- `http://hl7.org/fhir/StructureDefinition/tz-code` +- `http://hl7.org/fhir/StructureDefinition/tz-offset` +- `http://hl7.org/fhir/StructureDefinition/usagecontext-group` +- `http://hl7.org/fhir/StructureDefinition/valueset-activityStatusDate` +- `http://hl7.org/fhir/StructureDefinition/valueset-author` +- `http://hl7.org/fhir/StructureDefinition/valueset-authoritativeSource` +- `http://hl7.org/fhir/StructureDefinition/valueset-caseSensitive` +- `http://hl7.org/fhir/StructureDefinition/valueset-concept-comments` +- `http://hl7.org/fhir/StructureDefinition/valueset-concept-definition` +- `http://hl7.org/fhir/StructureDefinition/valueset-conceptOrder` +- `http://hl7.org/fhir/StructureDefinition/valueset-deprecated` +- `http://hl7.org/fhir/StructureDefinition/valueset-effectiveDate` +- `http://hl7.org/fhir/StructureDefinition/valueset-expand-group` +- `http://hl7.org/fhir/StructureDefinition/valueset-expand-rules` +- `http://hl7.org/fhir/StructureDefinition/valueset-expansionSource` +- `http://hl7.org/fhir/StructureDefinition/valueset-expirationDate` +- `http://hl7.org/fhir/StructureDefinition/valueset-expression` +- `http://hl7.org/fhir/StructureDefinition/valueset-extensible` +- `http://hl7.org/fhir/StructureDefinition/valueset-keyWord` +- `http://hl7.org/fhir/StructureDefinition/valueset-label` +- `http://hl7.org/fhir/StructureDefinition/valueset-map` +- `http://hl7.org/fhir/StructureDefinition/valueset-otherName` +- `http://hl7.org/fhir/StructureDefinition/valueset-parameterSource` +- `http://hl7.org/fhir/StructureDefinition/valueset-reference` +- `http://hl7.org/fhir/StructureDefinition/valueset-rules-text` +- `http://hl7.org/fhir/StructureDefinition/valueset-sourceReference` +- `http://hl7.org/fhir/StructureDefinition/valueset-special-status` +- `http://hl7.org/fhir/StructureDefinition/valueset-steward` +- `http://hl7.org/fhir/StructureDefinition/valueset-supplement` +- `http://hl7.org/fhir/StructureDefinition/valueset-system` +- `http://hl7.org/fhir/StructureDefinition/valueset-systemName` +- `http://hl7.org/fhir/StructureDefinition/valueset-systemRef` +- `http://hl7.org/fhir/StructureDefinition/valueset-toocostly` +- `http://hl7.org/fhir/StructureDefinition/valueset-trusted-expansion` +- `http://hl7.org/fhir/StructureDefinition/valueset-unclosed` +- `http://hl7.org/fhir/StructureDefinition/valueset-usage` +- `http://hl7.org/fhir/StructureDefinition/valueset-warning` +- `http://hl7.org/fhir/StructureDefinition/valueset-workflowStatus` +- `http://hl7.org/fhir/StructureDefinition/variable` +- `http://hl7.org/fhir/StructureDefinition/vitalsigns` +- `http://hl7.org/fhir/StructureDefinition/vitalspanel` +- `http://hl7.org/fhir/StructureDefinition/workflow-episodeOfCare` +- `http://hl7.org/fhir/StructureDefinition/workflow-instantiatesCanonical` +- `http://hl7.org/fhir/StructureDefinition/workflow-instantiatesUri` +- `http://hl7.org/fhir/StructureDefinition/workflow-reasonCode` +- `http://hl7.org/fhir/StructureDefinition/workflow-reasonReference` +- `http://hl7.org/fhir/StructureDefinition/workflow-relatedArtifact` +- `http://hl7.org/fhir/StructureDefinition/workflow-researchStudy` +- `http://hl7.org/fhir/StructureDefinition/workflow-supportingInfo` +- `http://hl7.org/fhir/ValueSet/FHIR-version` +- `http://hl7.org/fhir/ValueSet/abstract-types` +- `http://hl7.org/fhir/ValueSet/account-status` +- `http://hl7.org/fhir/ValueSet/account-type` +- `http://hl7.org/fhir/ValueSet/action-cardinality-behavior` +- `http://hl7.org/fhir/ValueSet/action-condition-kind` +- `http://hl7.org/fhir/ValueSet/action-grouping-behavior` +- `http://hl7.org/fhir/ValueSet/action-participant-role` +- `http://hl7.org/fhir/ValueSet/action-participant-type` +- `http://hl7.org/fhir/ValueSet/action-precheck-behavior` +- `http://hl7.org/fhir/ValueSet/action-relationship-type` +- `http://hl7.org/fhir/ValueSet/action-required-behavior` +- `http://hl7.org/fhir/ValueSet/action-selection-behavior` +- `http://hl7.org/fhir/ValueSet/action-type` +- `http://hl7.org/fhir/ValueSet/activity-definition-category` +- `http://hl7.org/fhir/ValueSet/additional-instruction-codes` +- `http://hl7.org/fhir/ValueSet/additionalmaterials` +- `http://hl7.org/fhir/ValueSet/address-type` +- `http://hl7.org/fhir/ValueSet/address-use` +- `http://hl7.org/fhir/ValueSet/adjudication` +- `http://hl7.org/fhir/ValueSet/adjudication-error` +- `http://hl7.org/fhir/ValueSet/adjudication-reason` +- `http://hl7.org/fhir/ValueSet/administration-method-codes` +- `http://hl7.org/fhir/ValueSet/administrative-gender` +- `http://hl7.org/fhir/ValueSet/adverse-event-actuality` +- `http://hl7.org/fhir/ValueSet/adverse-event-category` +- `http://hl7.org/fhir/ValueSet/adverse-event-causality-assess` +- `http://hl7.org/fhir/ValueSet/adverse-event-causality-method` +- `http://hl7.org/fhir/ValueSet/adverse-event-outcome` +- `http://hl7.org/fhir/ValueSet/adverse-event-seriousness` +- `http://hl7.org/fhir/ValueSet/adverse-event-severity` +- `http://hl7.org/fhir/ValueSet/adverse-event-type` +- `http://hl7.org/fhir/ValueSet/age-units` +- `http://hl7.org/fhir/ValueSet/all-distance-units` +- `http://hl7.org/fhir/ValueSet/all-languages` +- `http://hl7.org/fhir/ValueSet/all-time-units` +- `http://hl7.org/fhir/ValueSet/all-types` +- `http://hl7.org/fhir/ValueSet/allelename` +- `http://hl7.org/fhir/ValueSet/allerg-intol-substance-exp-risk` +- `http://hl7.org/fhir/ValueSet/allergy-intolerance-category` +- `http://hl7.org/fhir/ValueSet/allergy-intolerance-criticality` +- `http://hl7.org/fhir/ValueSet/allergy-intolerance-type` +- `http://hl7.org/fhir/ValueSet/allergyintolerance-clinical` +- `http://hl7.org/fhir/ValueSet/allergyintolerance-code` +- `http://hl7.org/fhir/ValueSet/allergyintolerance-verification` +- `http://hl7.org/fhir/ValueSet/animal-breeds` +- `http://hl7.org/fhir/ValueSet/animal-genderstatus` +- `http://hl7.org/fhir/ValueSet/animal-species` +- `http://hl7.org/fhir/ValueSet/appointment-cancellation-reason` +- `http://hl7.org/fhir/ValueSet/appointmentstatus` +- `http://hl7.org/fhir/ValueSet/approach-site-codes` +- `http://hl7.org/fhir/ValueSet/assert-direction-codes` +- `http://hl7.org/fhir/ValueSet/assert-operator-codes` +- `http://hl7.org/fhir/ValueSet/assert-response-code-types` +- `http://hl7.org/fhir/ValueSet/asset-availability` +- `http://hl7.org/fhir/ValueSet/audit-entity-type` +- `http://hl7.org/fhir/ValueSet/audit-event-action` +- `http://hl7.org/fhir/ValueSet/audit-event-outcome` +- `http://hl7.org/fhir/ValueSet/audit-event-sub-type` +- `http://hl7.org/fhir/ValueSet/audit-event-type` +- `http://hl7.org/fhir/ValueSet/audit-source-type` +- `http://hl7.org/fhir/ValueSet/basic-resource-type` +- `http://hl7.org/fhir/ValueSet/benefit-network` +- `http://hl7.org/fhir/ValueSet/benefit-term` +- `http://hl7.org/fhir/ValueSet/benefit-type` +- `http://hl7.org/fhir/ValueSet/benefit-unit` +- `http://hl7.org/fhir/ValueSet/binding-strength` +- `http://hl7.org/fhir/ValueSet/body-site` +- `http://hl7.org/fhir/ValueSet/bodysite-laterality` +- `http://hl7.org/fhir/ValueSet/bodystructure-code` +- `http://hl7.org/fhir/ValueSet/bodystructure-relative-location` +- `http://hl7.org/fhir/ValueSet/bundle-type` +- `http://hl7.org/fhir/ValueSet/c80-doc-typecodes` +- `http://hl7.org/fhir/ValueSet/c80-facilitycodes` +- `http://hl7.org/fhir/ValueSet/c80-practice-codes` +- `http://hl7.org/fhir/ValueSet/capability-statement-kind` +- `http://hl7.org/fhir/ValueSet/care-plan-activity-kind` +- `http://hl7.org/fhir/ValueSet/care-plan-activity-outcome` +- `http://hl7.org/fhir/ValueSet/care-plan-activity-status` +- `http://hl7.org/fhir/ValueSet/care-plan-category` +- `http://hl7.org/fhir/ValueSet/care-plan-intent` +- `http://hl7.org/fhir/ValueSet/care-team-category` +- `http://hl7.org/fhir/ValueSet/care-team-status` +- `http://hl7.org/fhir/ValueSet/catalogType` +- `http://hl7.org/fhir/ValueSet/cdshooks-indicator` +- `http://hl7.org/fhir/ValueSet/certainty-subcomponent-rating` +- `http://hl7.org/fhir/ValueSet/certainty-subcomponent-type` +- `http://hl7.org/fhir/ValueSet/chargeitem-billingcodes` +- `http://hl7.org/fhir/ValueSet/chargeitem-status` +- `http://hl7.org/fhir/ValueSet/choice-list-orientation` +- `http://hl7.org/fhir/ValueSet/chromosome-human` +- `http://hl7.org/fhir/ValueSet/claim-careteamrole` +- `http://hl7.org/fhir/ValueSet/claim-exception` +- `http://hl7.org/fhir/ValueSet/claim-informationcategory` +- `http://hl7.org/fhir/ValueSet/claim-modifiers` +- `http://hl7.org/fhir/ValueSet/claim-subtype` +- `http://hl7.org/fhir/ValueSet/claim-type` +- `http://hl7.org/fhir/ValueSet/claim-use` +- `http://hl7.org/fhir/ValueSet/clinical-findings` +- `http://hl7.org/fhir/ValueSet/clinicalimpression-prognosis` +- `http://hl7.org/fhir/ValueSet/clinicalimpression-status` +- `http://hl7.org/fhir/ValueSet/clinvar` +- `http://hl7.org/fhir/ValueSet/code-search-support` +- `http://hl7.org/fhir/ValueSet/codesystem-altcode-kind` +- `http://hl7.org/fhir/ValueSet/codesystem-content-mode` +- `http://hl7.org/fhir/ValueSet/codesystem-hierarchy-meaning` +- `http://hl7.org/fhir/ValueSet/common-tags` +- `http://hl7.org/fhir/ValueSet/communication-category` +- `http://hl7.org/fhir/ValueSet/communication-not-done-reason` +- `http://hl7.org/fhir/ValueSet/communication-topic` +- `http://hl7.org/fhir/ValueSet/compartment-type` +- `http://hl7.org/fhir/ValueSet/composite-measure-scoring` +- `http://hl7.org/fhir/ValueSet/composition-altcode-kind` +- `http://hl7.org/fhir/ValueSet/composition-attestation-mode` +- `http://hl7.org/fhir/ValueSet/composition-status` +- `http://hl7.org/fhir/ValueSet/concept-map-equivalence` +- `http://hl7.org/fhir/ValueSet/concept-property-type` +- `http://hl7.org/fhir/ValueSet/concept-subsumption-outcome` +- `http://hl7.org/fhir/ValueSet/conceptmap-unmapped-mode` +- `http://hl7.org/fhir/ValueSet/condition-category` +- `http://hl7.org/fhir/ValueSet/condition-cause` +- `http://hl7.org/fhir/ValueSet/condition-clinical` +- `http://hl7.org/fhir/ValueSet/condition-code` +- `http://hl7.org/fhir/ValueSet/condition-outcome` +- `http://hl7.org/fhir/ValueSet/condition-predecessor` +- `http://hl7.org/fhir/ValueSet/condition-severity` +- `http://hl7.org/fhir/ValueSet/condition-stage` +- `http://hl7.org/fhir/ValueSet/condition-stage-type` +- `http://hl7.org/fhir/ValueSet/condition-state` +- `http://hl7.org/fhir/ValueSet/condition-ver-status` +- `http://hl7.org/fhir/ValueSet/conditional-delete-status` +- `http://hl7.org/fhir/ValueSet/conditional-read-status` +- `http://hl7.org/fhir/ValueSet/conformance-expectation` +- `http://hl7.org/fhir/ValueSet/consent-action` +- `http://hl7.org/fhir/ValueSet/consent-category` +- `http://hl7.org/fhir/ValueSet/consent-content-class` +- `http://hl7.org/fhir/ValueSet/consent-content-code` +- `http://hl7.org/fhir/ValueSet/consent-data-meaning` +- `http://hl7.org/fhir/ValueSet/consent-performer` +- `http://hl7.org/fhir/ValueSet/consent-policy` +- `http://hl7.org/fhir/ValueSet/consent-provision-type` +- `http://hl7.org/fhir/ValueSet/consent-scope` +- `http://hl7.org/fhir/ValueSet/consent-state-codes` +- `http://hl7.org/fhir/ValueSet/consistency-type` +- `http://hl7.org/fhir/ValueSet/constraint-severity` +- `http://hl7.org/fhir/ValueSet/contact-point-system` +- `http://hl7.org/fhir/ValueSet/contact-point-use` +- `http://hl7.org/fhir/ValueSet/contactentity-type` +- `http://hl7.org/fhir/ValueSet/container-cap` +- `http://hl7.org/fhir/ValueSet/container-material` +- `http://hl7.org/fhir/ValueSet/contract-action` +- `http://hl7.org/fhir/ValueSet/contract-actionstatus` +- `http://hl7.org/fhir/ValueSet/contract-actorrole` +- `http://hl7.org/fhir/ValueSet/contract-assetcontext` +- `http://hl7.org/fhir/ValueSet/contract-assetscope` +- `http://hl7.org/fhir/ValueSet/contract-assetsubtype` +- `http://hl7.org/fhir/ValueSet/contract-assettype` +- `http://hl7.org/fhir/ValueSet/contract-content-derivative` +- `http://hl7.org/fhir/ValueSet/contract-data-meaning` +- `http://hl7.org/fhir/ValueSet/contract-decision-mode` +- `http://hl7.org/fhir/ValueSet/contract-definition-subtype` +- `http://hl7.org/fhir/ValueSet/contract-definition-type` +- `http://hl7.org/fhir/ValueSet/contract-expiration-type` +- `http://hl7.org/fhir/ValueSet/contract-legalstate` +- `http://hl7.org/fhir/ValueSet/contract-party-role` +- `http://hl7.org/fhir/ValueSet/contract-publicationstatus` +- `http://hl7.org/fhir/ValueSet/contract-scope` +- `http://hl7.org/fhir/ValueSet/contract-security-category` +- `http://hl7.org/fhir/ValueSet/contract-security-classification` +- `http://hl7.org/fhir/ValueSet/contract-security-control` +- `http://hl7.org/fhir/ValueSet/contract-signer-type` +- `http://hl7.org/fhir/ValueSet/contract-status` +- `http://hl7.org/fhir/ValueSet/contract-subtype` +- `http://hl7.org/fhir/ValueSet/contract-term-subtype` +- `http://hl7.org/fhir/ValueSet/contract-term-type` +- `http://hl7.org/fhir/ValueSet/contract-type` +- `http://hl7.org/fhir/ValueSet/contributor-type` +- `http://hl7.org/fhir/ValueSet/copy-number-event` +- `http://hl7.org/fhir/ValueSet/cosmic` +- `http://hl7.org/fhir/ValueSet/coverage-class` +- `http://hl7.org/fhir/ValueSet/coverage-copay-type` +- `http://hl7.org/fhir/ValueSet/coverage-financial-exception` +- `http://hl7.org/fhir/ValueSet/coverage-selfpay` +- `http://hl7.org/fhir/ValueSet/coverage-type` +- `http://hl7.org/fhir/ValueSet/coverageeligibilityresponse-ex-auth-support` +- `http://hl7.org/fhir/ValueSet/cpt-all` +- `http://hl7.org/fhir/ValueSet/currencies` +- `http://hl7.org/fhir/ValueSet/data-absent-reason` +- `http://hl7.org/fhir/ValueSet/data-types` +- `http://hl7.org/fhir/ValueSet/dataelement-sdcobjectclass` +- `http://hl7.org/fhir/ValueSet/dataelement-sdcobjectclassproperty` +- `http://hl7.org/fhir/ValueSet/days-of-week` +- `http://hl7.org/fhir/ValueSet/dbsnp` +- `http://hl7.org/fhir/ValueSet/defined-types` +- `http://hl7.org/fhir/ValueSet/definition-resource-types` +- `http://hl7.org/fhir/ValueSet/definition-status` +- `http://hl7.org/fhir/ValueSet/definition-topic` +- `http://hl7.org/fhir/ValueSet/definition-use` +- `http://hl7.org/fhir/ValueSet/designation-use` +- `http://hl7.org/fhir/ValueSet/detectedissue-category` +- `http://hl7.org/fhir/ValueSet/detectedissue-mitigation-action` +- `http://hl7.org/fhir/ValueSet/detectedissue-severity` +- `http://hl7.org/fhir/ValueSet/device-action` +- `http://hl7.org/fhir/ValueSet/device-component-property` +- `http://hl7.org/fhir/ValueSet/device-definition-status` +- `http://hl7.org/fhir/ValueSet/device-kind` +- `http://hl7.org/fhir/ValueSet/device-nametype` +- `http://hl7.org/fhir/ValueSet/device-safety` +- `http://hl7.org/fhir/ValueSet/device-statement-status` +- `http://hl7.org/fhir/ValueSet/device-status` +- `http://hl7.org/fhir/ValueSet/device-status-reason` +- `http://hl7.org/fhir/ValueSet/device-type` +- `http://hl7.org/fhir/ValueSet/devicemetric-type` +- `http://hl7.org/fhir/ValueSet/diagnosis-role` +- `http://hl7.org/fhir/ValueSet/diagnostic-based-on-snomed` +- `http://hl7.org/fhir/ValueSet/diagnostic-report-status` +- `http://hl7.org/fhir/ValueSet/diagnostic-service-sections` +- `http://hl7.org/fhir/ValueSet/dicm-405-mediatype` +- `http://hl7.org/fhir/ValueSet/diet-type` +- `http://hl7.org/fhir/ValueSet/discriminator-type` +- `http://hl7.org/fhir/ValueSet/distance-units` +- `http://hl7.org/fhir/ValueSet/doc-section-codes` +- `http://hl7.org/fhir/ValueSet/doc-typecodes` +- `http://hl7.org/fhir/ValueSet/document-classcodes` +- `http://hl7.org/fhir/ValueSet/document-mode` +- `http://hl7.org/fhir/ValueSet/document-reference-status` +- `http://hl7.org/fhir/ValueSet/document-relationship-type` +- `http://hl7.org/fhir/ValueSet/dose-rate-type` +- `http://hl7.org/fhir/ValueSet/duration-units` +- `http://hl7.org/fhir/ValueSet/effect-estimate-type` +- `http://hl7.org/fhir/ValueSet/eligibilityrequest-purpose` +- `http://hl7.org/fhir/ValueSet/eligibilityresponse-purpose` +- `http://hl7.org/fhir/ValueSet/encounter-admit-source` +- `http://hl7.org/fhir/ValueSet/encounter-diet` +- `http://hl7.org/fhir/ValueSet/encounter-discharge-disposition` +- `http://hl7.org/fhir/ValueSet/encounter-location-status` +- `http://hl7.org/fhir/ValueSet/encounter-participant-type` +- `http://hl7.org/fhir/ValueSet/encounter-reason` +- `http://hl7.org/fhir/ValueSet/encounter-special-arrangements` +- `http://hl7.org/fhir/ValueSet/encounter-special-courtesy` +- `http://hl7.org/fhir/ValueSet/encounter-status` +- `http://hl7.org/fhir/ValueSet/encounter-type` +- `http://hl7.org/fhir/ValueSet/endpoint-connection-type` +- `http://hl7.org/fhir/ValueSet/endpoint-payload-type` +- `http://hl7.org/fhir/ValueSet/endpoint-status` +- `http://hl7.org/fhir/ValueSet/ensembl` +- `http://hl7.org/fhir/ValueSet/enteral-route` +- `http://hl7.org/fhir/ValueSet/entformula-additive` +- `http://hl7.org/fhir/ValueSet/entformula-type` +- `http://hl7.org/fhir/ValueSet/episode-of-care-status` +- `http://hl7.org/fhir/ValueSet/episodeofcare-type` +- `http://hl7.org/fhir/ValueSet/event-capability-mode` +- `http://hl7.org/fhir/ValueSet/event-or-request-resource-types` +- `http://hl7.org/fhir/ValueSet/event-resource-types` +- `http://hl7.org/fhir/ValueSet/event-status` +- `http://hl7.org/fhir/ValueSet/event-timing` +- `http://hl7.org/fhir/ValueSet/evidence-quality` +- `http://hl7.org/fhir/ValueSet/evidence-variant-state` +- `http://hl7.org/fhir/ValueSet/ex-benefitcategory` +- `http://hl7.org/fhir/ValueSet/ex-diagnosis-on-admission` +- `http://hl7.org/fhir/ValueSet/ex-diagnosisrelatedgroup` +- `http://hl7.org/fhir/ValueSet/ex-diagnosistype` +- `http://hl7.org/fhir/ValueSet/ex-onsettype` +- `http://hl7.org/fhir/ValueSet/ex-payee-resource-type` +- `http://hl7.org/fhir/ValueSet/ex-paymenttype` +- `http://hl7.org/fhir/ValueSet/ex-procedure-type` +- `http://hl7.org/fhir/ValueSet/ex-program-code` +- `http://hl7.org/fhir/ValueSet/ex-revenue-center` +- `http://hl7.org/fhir/ValueSet/example-expansion` +- `http://hl7.org/fhir/ValueSet/example-extensional` +- `http://hl7.org/fhir/ValueSet/example-filter` +- `http://hl7.org/fhir/ValueSet/example-hierarchical` +- `http://hl7.org/fhir/ValueSet/example-intensional` +- `http://hl7.org/fhir/ValueSet/examplescenario-actor-type` +- `http://hl7.org/fhir/ValueSet/expansion-parameter-source` +- `http://hl7.org/fhir/ValueSet/expansion-processing-rule` +- `http://hl7.org/fhir/ValueSet/explanationofbenefit-status` +- `http://hl7.org/fhir/ValueSet/exposure-state` +- `http://hl7.org/fhir/ValueSet/expression-language` +- `http://hl7.org/fhir/ValueSet/extension-context-type` +- `http://hl7.org/fhir/ValueSet/feeding-device` +- `http://hl7.org/fhir/ValueSet/filter-operator` +- `http://hl7.org/fhir/ValueSet/financial-taskcode` +- `http://hl7.org/fhir/ValueSet/financial-taskinputtype` +- `http://hl7.org/fhir/ValueSet/flag-category` +- `http://hl7.org/fhir/ValueSet/flag-code` +- `http://hl7.org/fhir/ValueSet/flag-priority` +- `http://hl7.org/fhir/ValueSet/flag-status` +- `http://hl7.org/fhir/ValueSet/fm-conditions` +- `http://hl7.org/fhir/ValueSet/fm-itemtype` +- `http://hl7.org/fhir/ValueSet/fm-status` +- `http://hl7.org/fhir/ValueSet/focal-subject` +- `http://hl7.org/fhir/ValueSet/food-type` +- `http://hl7.org/fhir/ValueSet/formatcodes` +- `http://hl7.org/fhir/ValueSet/forms` +- `http://hl7.org/fhir/ValueSet/fundsreserve` +- `http://hl7.org/fhir/ValueSet/gender-identity` +- `http://hl7.org/fhir/ValueSet/genenames` +- `http://hl7.org/fhir/ValueSet/goal-acceptance-status` +- `http://hl7.org/fhir/ValueSet/goal-achievement` +- `http://hl7.org/fhir/ValueSet/goal-category` +- `http://hl7.org/fhir/ValueSet/goal-priority` +- `http://hl7.org/fhir/ValueSet/goal-relationship-type` +- `http://hl7.org/fhir/ValueSet/goal-start-event` +- `http://hl7.org/fhir/ValueSet/goal-status` +- `http://hl7.org/fhir/ValueSet/goal-status-reason` +- `http://hl7.org/fhir/ValueSet/graph-compartment-rule` +- `http://hl7.org/fhir/ValueSet/graph-compartment-use` +- `http://hl7.org/fhir/ValueSet/group-measure` +- `http://hl7.org/fhir/ValueSet/group-type` +- `http://hl7.org/fhir/ValueSet/guidance-response-status` +- `http://hl7.org/fhir/ValueSet/guide-page-generation` +- `http://hl7.org/fhir/ValueSet/guide-parameter-code` +- `http://hl7.org/fhir/ValueSet/handling-condition` +- `http://hl7.org/fhir/ValueSet/history-absent-reason` +- `http://hl7.org/fhir/ValueSet/history-status` +- `http://hl7.org/fhir/ValueSet/hl7-work-group` +- `http://hl7.org/fhir/ValueSet/http-operations` +- `http://hl7.org/fhir/ValueSet/http-verb` +- `http://hl7.org/fhir/ValueSet/icd-10` +- `http://hl7.org/fhir/ValueSet/icd-10-procedures` +- `http://hl7.org/fhir/ValueSet/identifier-type` +- `http://hl7.org/fhir/ValueSet/identifier-use` +- `http://hl7.org/fhir/ValueSet/identity-assuranceLevel` +- `http://hl7.org/fhir/ValueSet/imagingstudy-status` +- `http://hl7.org/fhir/ValueSet/immunization-evaluation-dose-status` +- `http://hl7.org/fhir/ValueSet/immunization-evaluation-dose-status-reason` +- `http://hl7.org/fhir/ValueSet/immunization-evaluation-status` +- `http://hl7.org/fhir/ValueSet/immunization-evaluation-target-disease` +- `http://hl7.org/fhir/ValueSet/immunization-function` +- `http://hl7.org/fhir/ValueSet/immunization-funding-source` +- `http://hl7.org/fhir/ValueSet/immunization-origin` +- `http://hl7.org/fhir/ValueSet/immunization-program-eligibility` +- `http://hl7.org/fhir/ValueSet/immunization-reason` +- `http://hl7.org/fhir/ValueSet/immunization-recommendation-date-criterion` +- `http://hl7.org/fhir/ValueSet/immunization-recommendation-reason` +- `http://hl7.org/fhir/ValueSet/immunization-recommendation-status` +- `http://hl7.org/fhir/ValueSet/immunization-recommendation-target-disease` +- `http://hl7.org/fhir/ValueSet/immunization-route` +- `http://hl7.org/fhir/ValueSet/immunization-site` +- `http://hl7.org/fhir/ValueSet/immunization-status` +- `http://hl7.org/fhir/ValueSet/immunization-status-reason` +- `http://hl7.org/fhir/ValueSet/immunization-subpotent-reason` +- `http://hl7.org/fhir/ValueSet/immunization-target-disease` +- `http://hl7.org/fhir/ValueSet/implantStatus` +- `http://hl7.org/fhir/ValueSet/inactive` +- `http://hl7.org/fhir/ValueSet/instance-availability` +- `http://hl7.org/fhir/ValueSet/insuranceplan-applicability` +- `http://hl7.org/fhir/ValueSet/insuranceplan-type` +- `http://hl7.org/fhir/ValueSet/intervention` +- `http://hl7.org/fhir/ValueSet/investigation-sets` +- `http://hl7.org/fhir/ValueSet/invoice-priceComponentType` +- `http://hl7.org/fhir/ValueSet/invoice-status` +- `http://hl7.org/fhir/ValueSet/iso3166-1-2` +- `http://hl7.org/fhir/ValueSet/iso3166-1-3` +- `http://hl7.org/fhir/ValueSet/iso3166-1-N` +- `http://hl7.org/fhir/ValueSet/issue-severity` +- `http://hl7.org/fhir/ValueSet/issue-type` +- `http://hl7.org/fhir/ValueSet/item-type` +- `http://hl7.org/fhir/ValueSet/jurisdiction` +- `http://hl7.org/fhir/ValueSet/knowledge-resource-types` +- `http://hl7.org/fhir/ValueSet/language-preference-type` +- `http://hl7.org/fhir/ValueSet/languages` +- `http://hl7.org/fhir/ValueSet/ldlcholesterol-codes` +- `http://hl7.org/fhir/ValueSet/library-type` +- `http://hl7.org/fhir/ValueSet/link-type` +- `http://hl7.org/fhir/ValueSet/linkage-type` +- `http://hl7.org/fhir/ValueSet/list-empty-reason` +- `http://hl7.org/fhir/ValueSet/list-example-codes` +- `http://hl7.org/fhir/ValueSet/list-item-flag` +- `http://hl7.org/fhir/ValueSet/list-mode` +- `http://hl7.org/fhir/ValueSet/list-order` +- `http://hl7.org/fhir/ValueSet/list-status` +- `http://hl7.org/fhir/ValueSet/location-mode` +- `http://hl7.org/fhir/ValueSet/location-physical-type` +- `http://hl7.org/fhir/ValueSet/location-status` +- `http://hl7.org/fhir/ValueSet/manifestation-or-symptom` +- `http://hl7.org/fhir/ValueSet/map-context-type` +- `http://hl7.org/fhir/ValueSet/map-group-type-mode` +- `http://hl7.org/fhir/ValueSet/map-input-mode` +- `http://hl7.org/fhir/ValueSet/map-model-mode` +- `http://hl7.org/fhir/ValueSet/map-source-list-mode` +- `http://hl7.org/fhir/ValueSet/map-target-list-mode` +- `http://hl7.org/fhir/ValueSet/map-transform` +- `http://hl7.org/fhir/ValueSet/marital-status` +- `http://hl7.org/fhir/ValueSet/match-grade` +- `http://hl7.org/fhir/ValueSet/measure-data-usage` +- `http://hl7.org/fhir/ValueSet/measure-improvement-notation` +- `http://hl7.org/fhir/ValueSet/measure-population` +- `http://hl7.org/fhir/ValueSet/measure-report-status` +- `http://hl7.org/fhir/ValueSet/measure-report-type` +- `http://hl7.org/fhir/ValueSet/measure-scoring` +- `http://hl7.org/fhir/ValueSet/measure-type` +- `http://hl7.org/fhir/ValueSet/med-admin-perform-function` +- `http://hl7.org/fhir/ValueSet/media-modality` +- `http://hl7.org/fhir/ValueSet/media-type` +- `http://hl7.org/fhir/ValueSet/media-view` +- `http://hl7.org/fhir/ValueSet/medication-admin-category` +- `http://hl7.org/fhir/ValueSet/medication-admin-status` +- `http://hl7.org/fhir/ValueSet/medication-as-needed-reason` +- `http://hl7.org/fhir/ValueSet/medication-codes` +- `http://hl7.org/fhir/ValueSet/medication-form-codes` +- `http://hl7.org/fhir/ValueSet/medication-statement-category` +- `http://hl7.org/fhir/ValueSet/medication-statement-status` +- `http://hl7.org/fhir/ValueSet/medication-status` +- `http://hl7.org/fhir/ValueSet/medicationdispense-category` +- `http://hl7.org/fhir/ValueSet/medicationdispense-performer-function` +- `http://hl7.org/fhir/ValueSet/medicationdispense-status` +- `http://hl7.org/fhir/ValueSet/medicationdispense-status-reason` +- `http://hl7.org/fhir/ValueSet/medicationknowledge-characteristic` +- `http://hl7.org/fhir/ValueSet/medicationknowledge-package-type` +- `http://hl7.org/fhir/ValueSet/medicationknowledge-status` +- `http://hl7.org/fhir/ValueSet/medicationrequest-category` +- `http://hl7.org/fhir/ValueSet/medicationrequest-course-of-therapy` +- `http://hl7.org/fhir/ValueSet/medicationrequest-intent` +- `http://hl7.org/fhir/ValueSet/medicationrequest-status` +- `http://hl7.org/fhir/ValueSet/medicationrequest-status-reason` +- `http://hl7.org/fhir/ValueSet/message-events` +- `http://hl7.org/fhir/ValueSet/message-reason-encounter` +- `http://hl7.org/fhir/ValueSet/message-significance-category` +- `http://hl7.org/fhir/ValueSet/message-transport` +- `http://hl7.org/fhir/ValueSet/messageheader-response-request` +- `http://hl7.org/fhir/ValueSet/metric-calibration-state` +- `http://hl7.org/fhir/ValueSet/metric-calibration-type` +- `http://hl7.org/fhir/ValueSet/metric-category` +- `http://hl7.org/fhir/ValueSet/metric-color` +- `http://hl7.org/fhir/ValueSet/metric-operational-status` +- `http://hl7.org/fhir/ValueSet/mimetypes` +- `http://hl7.org/fhir/ValueSet/missing-tooth-reason` +- `http://hl7.org/fhir/ValueSet/modified-foodtype` +- `http://hl7.org/fhir/ValueSet/name-assembly-order` +- `http://hl7.org/fhir/ValueSet/name-part-qualifier` +- `http://hl7.org/fhir/ValueSet/name-use` +- `http://hl7.org/fhir/ValueSet/name-v3-representation` +- `http://hl7.org/fhir/ValueSet/namingsystem-identifier-type` +- `http://hl7.org/fhir/ValueSet/namingsystem-type` +- `http://hl7.org/fhir/ValueSet/narrative-status` +- `http://hl7.org/fhir/ValueSet/network-type` +- `http://hl7.org/fhir/ValueSet/nhin-purposeofuse` +- `http://hl7.org/fhir/ValueSet/note-type` +- `http://hl7.org/fhir/ValueSet/nutrient-code` +- `http://hl7.org/fhir/ValueSet/object-lifecycle-events` +- `http://hl7.org/fhir/ValueSet/object-role` +- `http://hl7.org/fhir/ValueSet/observation-category` +- `http://hl7.org/fhir/ValueSet/observation-codes` +- `http://hl7.org/fhir/ValueSet/observation-interpretation` +- `http://hl7.org/fhir/ValueSet/observation-methods` +- `http://hl7.org/fhir/ValueSet/observation-range-category` +- `http://hl7.org/fhir/ValueSet/observation-statistics` +- `http://hl7.org/fhir/ValueSet/observation-status` +- `http://hl7.org/fhir/ValueSet/observation-vitalsignresult` +- `http://hl7.org/fhir/ValueSet/operation-kind` +- `http://hl7.org/fhir/ValueSet/operation-outcome` +- `http://hl7.org/fhir/ValueSet/operation-parameter-use` +- `http://hl7.org/fhir/ValueSet/oral-prosthodontic-material` +- `http://hl7.org/fhir/ValueSet/organization-role` +- `http://hl7.org/fhir/ValueSet/organization-type` +- `http://hl7.org/fhir/ValueSet/orientation-type` +- `http://hl7.org/fhir/ValueSet/parameter-group` +- `http://hl7.org/fhir/ValueSet/parent-relationship-codes` +- `http://hl7.org/fhir/ValueSet/participant-role` +- `http://hl7.org/fhir/ValueSet/participantrequired` +- `http://hl7.org/fhir/ValueSet/participation-role-type` +- `http://hl7.org/fhir/ValueSet/participationstatus` +- `http://hl7.org/fhir/ValueSet/patient-contactrelationship` +- `http://hl7.org/fhir/ValueSet/payeetype` +- `http://hl7.org/fhir/ValueSet/payment-adjustment-reason` +- `http://hl7.org/fhir/ValueSet/payment-status` +- `http://hl7.org/fhir/ValueSet/payment-type` +- `http://hl7.org/fhir/ValueSet/performer-function` +- `http://hl7.org/fhir/ValueSet/performer-role` +- `http://hl7.org/fhir/ValueSet/permitted-data-type` +- `http://hl7.org/fhir/ValueSet/plan-definition-type` +- `http://hl7.org/fhir/ValueSet/postal-address-use` +- `http://hl7.org/fhir/ValueSet/practitioner-role` +- `http://hl7.org/fhir/ValueSet/practitioner-specialty` +- `http://hl7.org/fhir/ValueSet/precision-estimate-type` +- `http://hl7.org/fhir/ValueSet/prepare-patient-prior-specimen-collection` +- `http://hl7.org/fhir/ValueSet/probability-distribution-type` +- `http://hl7.org/fhir/ValueSet/procedure-category` +- `http://hl7.org/fhir/ValueSet/procedure-code` +- `http://hl7.org/fhir/ValueSet/procedure-followup` +- `http://hl7.org/fhir/ValueSet/procedure-not-performed-reason` +- `http://hl7.org/fhir/ValueSet/procedure-outcome` +- `http://hl7.org/fhir/ValueSet/procedure-progress-status-codes` +- `http://hl7.org/fhir/ValueSet/procedure-reason` +- `http://hl7.org/fhir/ValueSet/process-priority` +- `http://hl7.org/fhir/ValueSet/product-category` +- `http://hl7.org/fhir/ValueSet/product-status` +- `http://hl7.org/fhir/ValueSet/product-storage-scale` +- `http://hl7.org/fhir/ValueSet/program` +- `http://hl7.org/fhir/ValueSet/property-representation` +- `http://hl7.org/fhir/ValueSet/provenance-activity-type` +- `http://hl7.org/fhir/ValueSet/provenance-agent-role` +- `http://hl7.org/fhir/ValueSet/provenance-agent-type` +- `http://hl7.org/fhir/ValueSet/provenance-entity-role` +- `http://hl7.org/fhir/ValueSet/provenance-history-agent-type` +- `http://hl7.org/fhir/ValueSet/provenance-history-record-activity` +- `http://hl7.org/fhir/ValueSet/provider-qualification` +- `http://hl7.org/fhir/ValueSet/provider-taxonomy` +- `http://hl7.org/fhir/ValueSet/publication-status` +- `http://hl7.org/fhir/ValueSet/quality-type` +- `http://hl7.org/fhir/ValueSet/quantity-comparator` +- `http://hl7.org/fhir/ValueSet/question-max-occurs` +- `http://hl7.org/fhir/ValueSet/questionnaire-answers` +- `http://hl7.org/fhir/ValueSet/questionnaire-answers-status` +- `http://hl7.org/fhir/ValueSet/questionnaire-category` +- `http://hl7.org/fhir/ValueSet/questionnaire-display-category` +- `http://hl7.org/fhir/ValueSet/questionnaire-enable-behavior` +- `http://hl7.org/fhir/ValueSet/questionnaire-enable-operator` +- `http://hl7.org/fhir/ValueSet/questionnaire-item-control` +- `http://hl7.org/fhir/ValueSet/questionnaire-questions` +- `http://hl7.org/fhir/ValueSet/questionnaire-usage-mode` +- `http://hl7.org/fhir/ValueSet/questionnaireresponse-mode` +- `http://hl7.org/fhir/ValueSet/reaction-event-certainty` +- `http://hl7.org/fhir/ValueSet/reaction-event-severity` +- `http://hl7.org/fhir/ValueSet/reason-medication-given-codes` +- `http://hl7.org/fhir/ValueSet/reason-medication-not-given-codes` +- `http://hl7.org/fhir/ValueSet/reason-medication-status-codes` +- `http://hl7.org/fhir/ValueSet/recommendation-strength` +- `http://hl7.org/fhir/ValueSet/ref-sequences` +- `http://hl7.org/fhir/ValueSet/reference-handling-policy` +- `http://hl7.org/fhir/ValueSet/reference-version-rules` +- `http://hl7.org/fhir/ValueSet/referencerange-appliesto` +- `http://hl7.org/fhir/ValueSet/referencerange-meaning` +- `http://hl7.org/fhir/ValueSet/rejection-criteria` +- `http://hl7.org/fhir/ValueSet/related-artifact-type` +- `http://hl7.org/fhir/ValueSet/related-claim-relationship` +- `http://hl7.org/fhir/ValueSet/relatedperson-relationshiptype` +- `http://hl7.org/fhir/ValueSet/relation-type` +- `http://hl7.org/fhir/ValueSet/relationship` +- `http://hl7.org/fhir/ValueSet/remittance-outcome` +- `http://hl7.org/fhir/ValueSet/report-action-result-codes` +- `http://hl7.org/fhir/ValueSet/report-codes` +- `http://hl7.org/fhir/ValueSet/report-participant-type` +- `http://hl7.org/fhir/ValueSet/report-result-codes` +- `http://hl7.org/fhir/ValueSet/report-status-codes` +- `http://hl7.org/fhir/ValueSet/repository-type` +- `http://hl7.org/fhir/ValueSet/request-intent` +- `http://hl7.org/fhir/ValueSet/request-priority` +- `http://hl7.org/fhir/ValueSet/request-resource-types` +- `http://hl7.org/fhir/ValueSet/request-status` +- `http://hl7.org/fhir/ValueSet/research-element-type` +- `http://hl7.org/fhir/ValueSet/research-study-objective-type` +- `http://hl7.org/fhir/ValueSet/research-study-phase` +- `http://hl7.org/fhir/ValueSet/research-study-prim-purp-type` +- `http://hl7.org/fhir/ValueSet/research-study-reason-stopped` +- `http://hl7.org/fhir/ValueSet/research-study-status` +- `http://hl7.org/fhir/ValueSet/research-subject-status` +- `http://hl7.org/fhir/ValueSet/resource-aggregation-mode` +- `http://hl7.org/fhir/ValueSet/resource-security-category` +- `http://hl7.org/fhir/ValueSet/resource-slicing-rules` +- `http://hl7.org/fhir/ValueSet/resource-status` +- `http://hl7.org/fhir/ValueSet/resource-type-link` +- `http://hl7.org/fhir/ValueSet/resource-types` +- `http://hl7.org/fhir/ValueSet/resource-validation-mode` +- `http://hl7.org/fhir/ValueSet/response-code` +- `http://hl7.org/fhir/ValueSet/restful-capability-mode` +- `http://hl7.org/fhir/ValueSet/restful-security-service` +- `http://hl7.org/fhir/ValueSet/risk-estimate-type` +- `http://hl7.org/fhir/ValueSet/risk-probability` +- `http://hl7.org/fhir/ValueSet/route-codes` +- `http://hl7.org/fhir/ValueSet/search-comparator` +- `http://hl7.org/fhir/ValueSet/search-entry-mode` +- `http://hl7.org/fhir/ValueSet/search-modifier-code` +- `http://hl7.org/fhir/ValueSet/search-param-type` +- `http://hl7.org/fhir/ValueSet/search-xpath-usage` +- `http://hl7.org/fhir/ValueSet/secondary-finding` +- `http://hl7.org/fhir/ValueSet/security-labels` +- `http://hl7.org/fhir/ValueSet/security-role-type` +- `http://hl7.org/fhir/ValueSet/sequence-quality-method` +- `http://hl7.org/fhir/ValueSet/sequence-quality-standardSequence` +- `http://hl7.org/fhir/ValueSet/sequence-referenceSeq` +- `http://hl7.org/fhir/ValueSet/sequence-species` +- `http://hl7.org/fhir/ValueSet/sequence-type` +- `http://hl7.org/fhir/ValueSet/sequenceontology` +- `http://hl7.org/fhir/ValueSet/series-performer-function` +- `http://hl7.org/fhir/ValueSet/service-category` +- `http://hl7.org/fhir/ValueSet/service-modifiers` +- `http://hl7.org/fhir/ValueSet/service-pharmacy` +- `http://hl7.org/fhir/ValueSet/service-place` +- `http://hl7.org/fhir/ValueSet/service-product` +- `http://hl7.org/fhir/ValueSet/service-provision-conditions` +- `http://hl7.org/fhir/ValueSet/service-referral-method` +- `http://hl7.org/fhir/ValueSet/service-type` +- `http://hl7.org/fhir/ValueSet/service-uscls` +- `http://hl7.org/fhir/ValueSet/servicerequest-category` +- `http://hl7.org/fhir/ValueSet/servicerequest-orderdetail` +- `http://hl7.org/fhir/ValueSet/sibling-relationship-codes` +- `http://hl7.org/fhir/ValueSet/signature-type` +- `http://hl7.org/fhir/ValueSet/slotstatus` +- `http://hl7.org/fhir/ValueSet/smart-capabilities` +- `http://hl7.org/fhir/ValueSet/sort-direction` +- `http://hl7.org/fhir/ValueSet/spdx-license` +- `http://hl7.org/fhir/ValueSet/special-values` +- `http://hl7.org/fhir/ValueSet/specimen-collection` +- `http://hl7.org/fhir/ValueSet/specimen-collection-method` +- `http://hl7.org/fhir/ValueSet/specimen-collection-priority` +- `http://hl7.org/fhir/ValueSet/specimen-contained-preference` +- `http://hl7.org/fhir/ValueSet/specimen-container-type` +- `http://hl7.org/fhir/ValueSet/specimen-processing-procedure` +- `http://hl7.org/fhir/ValueSet/specimen-status` +- `http://hl7.org/fhir/ValueSet/standards-status` +- `http://hl7.org/fhir/ValueSet/strand-type` +- `http://hl7.org/fhir/ValueSet/structure-definition-kind` +- `http://hl7.org/fhir/ValueSet/study-type` +- `http://hl7.org/fhir/ValueSet/subject-type` +- `http://hl7.org/fhir/ValueSet/subscriber-relationship` +- `http://hl7.org/fhir/ValueSet/subscription-channel-type` +- `http://hl7.org/fhir/ValueSet/subscription-status` +- `http://hl7.org/fhir/ValueSet/subscription-tag` +- `http://hl7.org/fhir/ValueSet/substance-category` +- `http://hl7.org/fhir/ValueSet/substance-code` +- `http://hl7.org/fhir/ValueSet/substance-status` +- `http://hl7.org/fhir/ValueSet/supplement-type` +- `http://hl7.org/fhir/ValueSet/supply-item` +- `http://hl7.org/fhir/ValueSet/supplydelivery-status` +- `http://hl7.org/fhir/ValueSet/supplydelivery-type` +- `http://hl7.org/fhir/ValueSet/supplyrequest-kind` +- `http://hl7.org/fhir/ValueSet/supplyrequest-reason` +- `http://hl7.org/fhir/ValueSet/supplyrequest-status` +- `http://hl7.org/fhir/ValueSet/surface` +- `http://hl7.org/fhir/ValueSet/synthesis-type` +- `http://hl7.org/fhir/ValueSet/system-restful-interaction` +- `http://hl7.org/fhir/ValueSet/task-code` +- `http://hl7.org/fhir/ValueSet/task-intent` +- `http://hl7.org/fhir/ValueSet/task-status` +- `http://hl7.org/fhir/ValueSet/teeth` +- `http://hl7.org/fhir/ValueSet/template-status-code` +- `http://hl7.org/fhir/ValueSet/testscript-operation-codes` +- `http://hl7.org/fhir/ValueSet/testscript-profile-destination-types` +- `http://hl7.org/fhir/ValueSet/testscript-profile-origin-types` +- `http://hl7.org/fhir/ValueSet/texture-code` +- `http://hl7.org/fhir/ValueSet/timezones` +- `http://hl7.org/fhir/ValueSet/timing-abbreviation` +- `http://hl7.org/fhir/ValueSet/tooth` +- `http://hl7.org/fhir/ValueSet/transaction-mode` +- `http://hl7.org/fhir/ValueSet/trigger-type` +- `http://hl7.org/fhir/ValueSet/type-derivation-rule` +- `http://hl7.org/fhir/ValueSet/type-restful-interaction` +- `http://hl7.org/fhir/ValueSet/ucum-bodylength` +- `http://hl7.org/fhir/ValueSet/ucum-bodytemp` +- `http://hl7.org/fhir/ValueSet/ucum-bodyweight` +- `http://hl7.org/fhir/ValueSet/ucum-common` +- `http://hl7.org/fhir/ValueSet/ucum-units` +- `http://hl7.org/fhir/ValueSet/ucum-vitals-common` +- `http://hl7.org/fhir/ValueSet/udi` +- `http://hl7.org/fhir/ValueSet/udi-entry-type` +- `http://hl7.org/fhir/ValueSet/units-of-time` +- `http://hl7.org/fhir/ValueSet/unknown-content-code` +- `http://hl7.org/fhir/ValueSet/usage-context-type` +- `http://hl7.org/fhir/ValueSet/use-context` +- `http://hl7.org/fhir/ValueSet/vaccine-code` +- `http://hl7.org/fhir/ValueSet/variable-type` +- `http://hl7.org/fhir/ValueSet/variant-state` +- `http://hl7.org/fhir/ValueSet/variants` +- `http://hl7.org/fhir/ValueSet/verificationresult-can-push-updates` +- `http://hl7.org/fhir/ValueSet/verificationresult-communication-method` +- `http://hl7.org/fhir/ValueSet/verificationresult-failure-action` +- `http://hl7.org/fhir/ValueSet/verificationresult-need` +- `http://hl7.org/fhir/ValueSet/verificationresult-primary-source-type` +- `http://hl7.org/fhir/ValueSet/verificationresult-push-type-available` +- `http://hl7.org/fhir/ValueSet/verificationresult-status` +- `http://hl7.org/fhir/ValueSet/verificationresult-validation-process` +- `http://hl7.org/fhir/ValueSet/verificationresult-validation-status` +- `http://hl7.org/fhir/ValueSet/verificationresult-validation-type` +- `http://hl7.org/fhir/ValueSet/versioning-policy` +- `http://hl7.org/fhir/ValueSet/vision-base-codes` +- `http://hl7.org/fhir/ValueSet/vision-eye-codes` +- `http://hl7.org/fhir/ValueSet/vision-product` +- `http://hl7.org/fhir/ValueSet/written-language` +- `http://hl7.org/fhir/ValueSet/yesnodontknow` +- `http://terminology.hl7.org/ValueSet/v2-0001` +- `http://terminology.hl7.org/ValueSet/v2-0002` +- `http://terminology.hl7.org/ValueSet/v2-0003` +- `http://terminology.hl7.org/ValueSet/v2-0004` +- `http://terminology.hl7.org/ValueSet/v2-0005` +- `http://terminology.hl7.org/ValueSet/v2-0007` +- `http://terminology.hl7.org/ValueSet/v2-0008` +- `http://terminology.hl7.org/ValueSet/v2-0009` +- `http://terminology.hl7.org/ValueSet/v2-0012` +- `http://terminology.hl7.org/ValueSet/v2-0017` +- `http://terminology.hl7.org/ValueSet/v2-0023` +- `http://terminology.hl7.org/ValueSet/v2-0027` +- `http://terminology.hl7.org/ValueSet/v2-0033` +- `http://terminology.hl7.org/ValueSet/v2-0034` +- `http://terminology.hl7.org/ValueSet/v2-0038` +- `http://terminology.hl7.org/ValueSet/v2-0043` +- `http://terminology.hl7.org/ValueSet/v2-0048` +- `http://terminology.hl7.org/ValueSet/v2-0052` +- `http://terminology.hl7.org/ValueSet/v2-0061` +- `http://terminology.hl7.org/ValueSet/v2-0062` +- `http://terminology.hl7.org/ValueSet/v2-0063` +- `http://terminology.hl7.org/ValueSet/v2-0065` +- `http://terminology.hl7.org/ValueSet/v2-0066` +- `http://terminology.hl7.org/ValueSet/v2-0069` +- `http://terminology.hl7.org/ValueSet/v2-0070` +- `http://terminology.hl7.org/ValueSet/v2-0074` +- `http://terminology.hl7.org/ValueSet/v2-0076` +- `http://terminology.hl7.org/ValueSet/v2-0078` +- `http://terminology.hl7.org/ValueSet/v2-0080` +- `http://terminology.hl7.org/ValueSet/v2-0083` +- `http://terminology.hl7.org/ValueSet/v2-0085` +- `http://terminology.hl7.org/ValueSet/v2-0091` +- `http://terminology.hl7.org/ValueSet/v2-0092` +- `http://terminology.hl7.org/ValueSet/v2-0098` +- `http://terminology.hl7.org/ValueSet/v2-0100` +- `http://terminology.hl7.org/ValueSet/v2-0102` +- `http://terminology.hl7.org/ValueSet/v2-0103` +- `http://terminology.hl7.org/ValueSet/v2-0104` +- `http://terminology.hl7.org/ValueSet/v2-0105` +- `http://terminology.hl7.org/ValueSet/v2-0106` +- `http://terminology.hl7.org/ValueSet/v2-0107` +- `http://terminology.hl7.org/ValueSet/v2-0108` +- `http://terminology.hl7.org/ValueSet/v2-0109` +- `http://terminology.hl7.org/ValueSet/v2-0116` +- `http://terminology.hl7.org/ValueSet/v2-0119` +- `http://terminology.hl7.org/ValueSet/v2-0121` +- `http://terminology.hl7.org/ValueSet/v2-0122` +- `http://terminology.hl7.org/ValueSet/v2-0123` +- `http://terminology.hl7.org/ValueSet/v2-0124` +- `http://terminology.hl7.org/ValueSet/v2-0125` +- `http://terminology.hl7.org/ValueSet/v2-0126` +- `http://terminology.hl7.org/ValueSet/v2-0127` +- `http://terminology.hl7.org/ValueSet/v2-0128` +- `http://terminology.hl7.org/ValueSet/v2-0130` +- `http://terminology.hl7.org/ValueSet/v2-0131` +- `http://terminology.hl7.org/ValueSet/v2-0133` +- `http://terminology.hl7.org/ValueSet/v2-0135` +- `http://terminology.hl7.org/ValueSet/v2-0136` +- `http://terminology.hl7.org/ValueSet/v2-0137` +- `http://terminology.hl7.org/ValueSet/v2-0140` +- `http://terminology.hl7.org/ValueSet/v2-0141` +- `http://terminology.hl7.org/ValueSet/v2-0142` +- `http://terminology.hl7.org/ValueSet/v2-0144` +- `http://terminology.hl7.org/ValueSet/v2-0145` +- `http://terminology.hl7.org/ValueSet/v2-0146` +- `http://terminology.hl7.org/ValueSet/v2-0147` +- `http://terminology.hl7.org/ValueSet/v2-0148` +- `http://terminology.hl7.org/ValueSet/v2-0149` +- `http://terminology.hl7.org/ValueSet/v2-0150` +- `http://terminology.hl7.org/ValueSet/v2-0153` +- `http://terminology.hl7.org/ValueSet/v2-0155` +- `http://terminology.hl7.org/ValueSet/v2-0156` +- `http://terminology.hl7.org/ValueSet/v2-0157` +- `http://terminology.hl7.org/ValueSet/v2-0158` +- `http://terminology.hl7.org/ValueSet/v2-0159` +- `http://terminology.hl7.org/ValueSet/v2-0160` +- `http://terminology.hl7.org/ValueSet/v2-0161` +- `http://terminology.hl7.org/ValueSet/v2-0162` +- `http://terminology.hl7.org/ValueSet/v2-0163` +- `http://terminology.hl7.org/ValueSet/v2-0164` +- `http://terminology.hl7.org/ValueSet/v2-0165` +- `http://terminology.hl7.org/ValueSet/v2-0166` +- `http://terminology.hl7.org/ValueSet/v2-0167` +- `http://terminology.hl7.org/ValueSet/v2-0168` +- `http://terminology.hl7.org/ValueSet/v2-0169` +- `http://terminology.hl7.org/ValueSet/v2-0170` +- `http://terminology.hl7.org/ValueSet/v2-0173` +- `http://terminology.hl7.org/ValueSet/v2-0174` +- `http://terminology.hl7.org/ValueSet/v2-0175` +- `http://terminology.hl7.org/ValueSet/v2-0177` +- `http://terminology.hl7.org/ValueSet/v2-0178` +- `http://terminology.hl7.org/ValueSet/v2-0179` +- `http://terminology.hl7.org/ValueSet/v2-0180` +- `http://terminology.hl7.org/ValueSet/v2-0181` +- `http://terminology.hl7.org/ValueSet/v2-0183` +- `http://terminology.hl7.org/ValueSet/v2-0185` +- `http://terminology.hl7.org/ValueSet/v2-0187` +- `http://terminology.hl7.org/ValueSet/v2-0189` +- `http://terminology.hl7.org/ValueSet/v2-0190` +- `http://terminology.hl7.org/ValueSet/v2-0191` +- `http://terminology.hl7.org/ValueSet/v2-0193` +- `http://terminology.hl7.org/ValueSet/v2-0200` +- `http://terminology.hl7.org/ValueSet/v2-0201` +- `http://terminology.hl7.org/ValueSet/v2-0202` +- `http://terminology.hl7.org/ValueSet/v2-0203` +- `http://terminology.hl7.org/ValueSet/v2-0204` +- `http://terminology.hl7.org/ValueSet/v2-0205` +- `http://terminology.hl7.org/ValueSet/v2-0206` +- `http://terminology.hl7.org/ValueSet/v2-0207` +- `http://terminology.hl7.org/ValueSet/v2-0208` +- `http://terminology.hl7.org/ValueSet/v2-0209` +- `http://terminology.hl7.org/ValueSet/v2-0210` +- `http://terminology.hl7.org/ValueSet/v2-0211` +- `http://terminology.hl7.org/ValueSet/v2-0213` +- `http://terminology.hl7.org/ValueSet/v2-0214` +- `http://terminology.hl7.org/ValueSet/v2-0215` +- `http://terminology.hl7.org/ValueSet/v2-0216` +- `http://terminology.hl7.org/ValueSet/v2-0217` +- `http://terminology.hl7.org/ValueSet/v2-0220` +- `http://terminology.hl7.org/ValueSet/v2-0223` +- `http://terminology.hl7.org/ValueSet/v2-0224` +- `http://terminology.hl7.org/ValueSet/v2-0225` +- `http://terminology.hl7.org/ValueSet/v2-0227` +- `http://terminology.hl7.org/ValueSet/v2-0228` +- `http://terminology.hl7.org/ValueSet/v2-0229` +- `http://terminology.hl7.org/ValueSet/v2-0230` +- `http://terminology.hl7.org/ValueSet/v2-0231` +- `http://terminology.hl7.org/ValueSet/v2-0232` +- `http://terminology.hl7.org/ValueSet/v2-0234` +- `http://terminology.hl7.org/ValueSet/v2-0235` +- `http://terminology.hl7.org/ValueSet/v2-0236` +- `http://terminology.hl7.org/ValueSet/v2-0237` +- `http://terminology.hl7.org/ValueSet/v2-0238` +- `http://terminology.hl7.org/ValueSet/v2-0239` +- `http://terminology.hl7.org/ValueSet/v2-0240` +- `http://terminology.hl7.org/ValueSet/v2-0241` +- `http://terminology.hl7.org/ValueSet/v2-0242` +- `http://terminology.hl7.org/ValueSet/v2-0243` +- `http://terminology.hl7.org/ValueSet/v2-0247` +- `http://terminology.hl7.org/ValueSet/v2-0248` +- `http://terminology.hl7.org/ValueSet/v2-0250` +- `http://terminology.hl7.org/ValueSet/v2-0251` +- `http://terminology.hl7.org/ValueSet/v2-0252` +- `http://terminology.hl7.org/ValueSet/v2-0253` +- `http://terminology.hl7.org/ValueSet/v2-0254` +- `http://terminology.hl7.org/ValueSet/v2-0255` +- `http://terminology.hl7.org/ValueSet/v2-0256` +- `http://terminology.hl7.org/ValueSet/v2-0257` +- `http://terminology.hl7.org/ValueSet/v2-0258` +- `http://terminology.hl7.org/ValueSet/v2-0259` +- `http://terminology.hl7.org/ValueSet/v2-0260` +- `http://terminology.hl7.org/ValueSet/v2-0261` +- `http://terminology.hl7.org/ValueSet/v2-0262` +- `http://terminology.hl7.org/ValueSet/v2-0263` +- `http://terminology.hl7.org/ValueSet/v2-0265` +- `http://terminology.hl7.org/ValueSet/v2-0267` +- `http://terminology.hl7.org/ValueSet/v2-0268` +- `http://terminology.hl7.org/ValueSet/v2-0269` +- `http://terminology.hl7.org/ValueSet/v2-0270` +- `http://terminology.hl7.org/ValueSet/v2-0271` +- `http://terminology.hl7.org/ValueSet/v2-0272` +- `http://terminology.hl7.org/ValueSet/v2-0273` +- `http://terminology.hl7.org/ValueSet/v2-0275` +- `http://terminology.hl7.org/ValueSet/v2-0276` +- `http://terminology.hl7.org/ValueSet/v2-0277` +- `http://terminology.hl7.org/ValueSet/v2-0278` +- `http://terminology.hl7.org/ValueSet/v2-0279` +- `http://terminology.hl7.org/ValueSet/v2-0280` +- `http://terminology.hl7.org/ValueSet/v2-0281` +- `http://terminology.hl7.org/ValueSet/v2-0282` +- `http://terminology.hl7.org/ValueSet/v2-0283` +- `http://terminology.hl7.org/ValueSet/v2-0284` +- `http://terminology.hl7.org/ValueSet/v2-0286` +- `http://terminology.hl7.org/ValueSet/v2-0287` +- `http://terminology.hl7.org/ValueSet/v2-0290` +- `http://terminology.hl7.org/ValueSet/v2-0291` +- `http://terminology.hl7.org/ValueSet/v2-0292` +- `http://terminology.hl7.org/ValueSet/v2-0294` +- `http://terminology.hl7.org/ValueSet/v2-0298` +- `http://terminology.hl7.org/ValueSet/v2-0299` +- `http://terminology.hl7.org/ValueSet/v2-0301` +- `http://terminology.hl7.org/ValueSet/v2-0305` +- `http://terminology.hl7.org/ValueSet/v2-0309` +- `http://terminology.hl7.org/ValueSet/v2-0311` +- `http://terminology.hl7.org/ValueSet/v2-0315` +- `http://terminology.hl7.org/ValueSet/v2-0316` +- `http://terminology.hl7.org/ValueSet/v2-0317` +- `http://terminology.hl7.org/ValueSet/v2-0321` +- `http://terminology.hl7.org/ValueSet/v2-0322` +- `http://terminology.hl7.org/ValueSet/v2-0323` +- `http://terminology.hl7.org/ValueSet/v2-0324` +- `http://terminology.hl7.org/ValueSet/v2-0325` +- `http://terminology.hl7.org/ValueSet/v2-0326` +- `http://terminology.hl7.org/ValueSet/v2-0329` +- `http://terminology.hl7.org/ValueSet/v2-0330` +- `http://terminology.hl7.org/ValueSet/v2-0331` +- `http://terminology.hl7.org/ValueSet/v2-0332` +- `http://terminology.hl7.org/ValueSet/v2-0334` +- `http://terminology.hl7.org/ValueSet/v2-0335` +- `http://terminology.hl7.org/ValueSet/v2-0336` +- `http://terminology.hl7.org/ValueSet/v2-0337` +- `http://terminology.hl7.org/ValueSet/v2-0338` +- `http://terminology.hl7.org/ValueSet/v2-0339` +- `http://terminology.hl7.org/ValueSet/v2-0344` +- `http://terminology.hl7.org/ValueSet/v2-0350` +- `http://terminology.hl7.org/ValueSet/v2-0351` +- `http://terminology.hl7.org/ValueSet/v2-0353` +- `http://terminology.hl7.org/ValueSet/v2-0354` +- `http://terminology.hl7.org/ValueSet/v2-0355` +- `http://terminology.hl7.org/ValueSet/v2-0356` +- `http://terminology.hl7.org/ValueSet/v2-0357` +- `http://terminology.hl7.org/ValueSet/v2-0359` +- `http://terminology.hl7.org/ValueSet/v2-0363` +- `http://terminology.hl7.org/ValueSet/v2-0364` +- `http://terminology.hl7.org/ValueSet/v2-0365` +- `http://terminology.hl7.org/ValueSet/v2-0366` +- `http://terminology.hl7.org/ValueSet/v2-0367` +- `http://terminology.hl7.org/ValueSet/v2-0368` +- `http://terminology.hl7.org/ValueSet/v2-0369` +- `http://terminology.hl7.org/ValueSet/v2-0370` +- `http://terminology.hl7.org/ValueSet/v2-0371` +- `http://terminology.hl7.org/ValueSet/v2-0372` +- `http://terminology.hl7.org/ValueSet/v2-0373` +- `http://terminology.hl7.org/ValueSet/v2-0374` +- `http://terminology.hl7.org/ValueSet/v2-0375` +- `http://terminology.hl7.org/ValueSet/v2-0376` +- `http://terminology.hl7.org/ValueSet/v2-0377` +- `http://terminology.hl7.org/ValueSet/v2-0383` +- `http://terminology.hl7.org/ValueSet/v2-0384` +- `http://terminology.hl7.org/ValueSet/v2-0387` +- `http://terminology.hl7.org/ValueSet/v2-0388` +- `http://terminology.hl7.org/ValueSet/v2-0389` +- `http://terminology.hl7.org/ValueSet/v2-0392` +- `http://terminology.hl7.org/ValueSet/v2-0393` +- `http://terminology.hl7.org/ValueSet/v2-0394` +- `http://terminology.hl7.org/ValueSet/v2-0395` +- `http://terminology.hl7.org/ValueSet/v2-0396` +- `http://terminology.hl7.org/ValueSet/v2-0397` +- `http://terminology.hl7.org/ValueSet/v2-0398` +- `http://terminology.hl7.org/ValueSet/v2-0401` +- `http://terminology.hl7.org/ValueSet/v2-0402` +- `http://terminology.hl7.org/ValueSet/v2-0403` +- `http://terminology.hl7.org/ValueSet/v2-0404` +- `http://terminology.hl7.org/ValueSet/v2-0406` +- `http://terminology.hl7.org/ValueSet/v2-0409` +- `http://terminology.hl7.org/ValueSet/v2-0411` +- `http://terminology.hl7.org/ValueSet/v2-0415` +- `http://terminology.hl7.org/ValueSet/v2-0416` +- `http://terminology.hl7.org/ValueSet/v2-0417` +- `http://terminology.hl7.org/ValueSet/v2-0418` +- `http://terminology.hl7.org/ValueSet/v2-0421` +- `http://terminology.hl7.org/ValueSet/v2-0422` +- `http://terminology.hl7.org/ValueSet/v2-0423` +- `http://terminology.hl7.org/ValueSet/v2-0424` +- `http://terminology.hl7.org/ValueSet/v2-0425` +- `http://terminology.hl7.org/ValueSet/v2-0426` +- `http://terminology.hl7.org/ValueSet/v2-0427` +- `http://terminology.hl7.org/ValueSet/v2-0428` +- `http://terminology.hl7.org/ValueSet/v2-0429` +- `http://terminology.hl7.org/ValueSet/v2-0430` +- `http://terminology.hl7.org/ValueSet/v2-0431` +- `http://terminology.hl7.org/ValueSet/v2-0432` +- `http://terminology.hl7.org/ValueSet/v2-0433` +- `http://terminology.hl7.org/ValueSet/v2-0434` +- `http://terminology.hl7.org/ValueSet/v2-0435` +- `http://terminology.hl7.org/ValueSet/v2-0436` +- `http://terminology.hl7.org/ValueSet/v2-0437` +- `http://terminology.hl7.org/ValueSet/v2-0438` +- `http://terminology.hl7.org/ValueSet/v2-0440` +- `http://terminology.hl7.org/ValueSet/v2-0441` +- `http://terminology.hl7.org/ValueSet/v2-0442` +- `http://terminology.hl7.org/ValueSet/v2-0443` +- `http://terminology.hl7.org/ValueSet/v2-0444` +- `http://terminology.hl7.org/ValueSet/v2-0445` +- `http://terminology.hl7.org/ValueSet/v2-0450` +- `http://terminology.hl7.org/ValueSet/v2-0455` +- `http://terminology.hl7.org/ValueSet/v2-0456` +- `http://terminology.hl7.org/ValueSet/v2-0457` +- `http://terminology.hl7.org/ValueSet/v2-0459` +- `http://terminology.hl7.org/ValueSet/v2-0460` +- `http://terminology.hl7.org/ValueSet/v2-0465` +- `http://terminology.hl7.org/ValueSet/v2-0466` +- `http://terminology.hl7.org/ValueSet/v2-0468` +- `http://terminology.hl7.org/ValueSet/v2-0469` +- `http://terminology.hl7.org/ValueSet/v2-0470` +- `http://terminology.hl7.org/ValueSet/v2-0472` +- `http://terminology.hl7.org/ValueSet/v2-0473` +- `http://terminology.hl7.org/ValueSet/v2-0474` +- `http://terminology.hl7.org/ValueSet/v2-0475` +- `http://terminology.hl7.org/ValueSet/v2-0477` +- `http://terminology.hl7.org/ValueSet/v2-0478` +- `http://terminology.hl7.org/ValueSet/v2-0480` +- `http://terminology.hl7.org/ValueSet/v2-0482` +- `http://terminology.hl7.org/ValueSet/v2-0483` +- `http://terminology.hl7.org/ValueSet/v2-0484` +- `http://terminology.hl7.org/ValueSet/v2-0485` +- `http://terminology.hl7.org/ValueSet/v2-0487` +- `http://terminology.hl7.org/ValueSet/v2-0488` +- `http://terminology.hl7.org/ValueSet/v2-0489` +- `http://terminology.hl7.org/ValueSet/v2-0490` +- `http://terminology.hl7.org/ValueSet/v2-0491` +- `http://terminology.hl7.org/ValueSet/v2-0492` +- `http://terminology.hl7.org/ValueSet/v2-0493` +- `http://terminology.hl7.org/ValueSet/v2-0494` +- `http://terminology.hl7.org/ValueSet/v2-0495` +- `http://terminology.hl7.org/ValueSet/v2-0496` +- `http://terminology.hl7.org/ValueSet/v2-0497` +- `http://terminology.hl7.org/ValueSet/v2-0498` +- `http://terminology.hl7.org/ValueSet/v2-0499` +- `http://terminology.hl7.org/ValueSet/v2-0500` +- `http://terminology.hl7.org/ValueSet/v2-0501` +- `http://terminology.hl7.org/ValueSet/v2-0502` +- `http://terminology.hl7.org/ValueSet/v2-0503` +- `http://terminology.hl7.org/ValueSet/v2-0504` +- `http://terminology.hl7.org/ValueSet/v2-0505` +- `http://terminology.hl7.org/ValueSet/v2-0506` +- `http://terminology.hl7.org/ValueSet/v2-0507` +- `http://terminology.hl7.org/ValueSet/v2-0508` +- `http://terminology.hl7.org/ValueSet/v2-0510` +- `http://terminology.hl7.org/ValueSet/v2-0511` +- `http://terminology.hl7.org/ValueSet/v2-0513` +- `http://terminology.hl7.org/ValueSet/v2-0514` +- `http://terminology.hl7.org/ValueSet/v2-0516` +- `http://terminology.hl7.org/ValueSet/v2-0517` +- `http://terminology.hl7.org/ValueSet/v2-0518` +- `http://terminology.hl7.org/ValueSet/v2-0520` +- `http://terminology.hl7.org/ValueSet/v2-0523` +- `http://terminology.hl7.org/ValueSet/v2-0524` +- `http://terminology.hl7.org/ValueSet/v2-0527` +- `http://terminology.hl7.org/ValueSet/v2-0528` +- `http://terminology.hl7.org/ValueSet/v2-0529` +- `http://terminology.hl7.org/ValueSet/v2-0530` +- `http://terminology.hl7.org/ValueSet/v2-0532` +- `http://terminology.hl7.org/ValueSet/v2-0534` +- `http://terminology.hl7.org/ValueSet/v2-0535` +- `http://terminology.hl7.org/ValueSet/v2-0536` +- `http://terminology.hl7.org/ValueSet/v2-0538` +- `http://terminology.hl7.org/ValueSet/v2-0540` +- `http://terminology.hl7.org/ValueSet/v2-0544` +- `http://terminology.hl7.org/ValueSet/v2-0547` +- `http://terminology.hl7.org/ValueSet/v2-0548` +- `http://terminology.hl7.org/ValueSet/v2-0550` +- `http://terminology.hl7.org/ValueSet/v2-0553` +- `http://terminology.hl7.org/ValueSet/v2-0554` +- `http://terminology.hl7.org/ValueSet/v2-0555` +- `http://terminology.hl7.org/ValueSet/v2-0556` +- `http://terminology.hl7.org/ValueSet/v2-0557` +- `http://terminology.hl7.org/ValueSet/v2-0558` +- `http://terminology.hl7.org/ValueSet/v2-0559` +- `http://terminology.hl7.org/ValueSet/v2-0561` +- `http://terminology.hl7.org/ValueSet/v2-0562` +- `http://terminology.hl7.org/ValueSet/v2-0564` +- `http://terminology.hl7.org/ValueSet/v2-0565` +- `http://terminology.hl7.org/ValueSet/v2-0566` +- `http://terminology.hl7.org/ValueSet/v2-0569` +- `http://terminology.hl7.org/ValueSet/v2-0570` +- `http://terminology.hl7.org/ValueSet/v2-0571` +- `http://terminology.hl7.org/ValueSet/v2-0572` +- `http://terminology.hl7.org/ValueSet/v2-0615` +- `http://terminology.hl7.org/ValueSet/v2-0616` +- `http://terminology.hl7.org/ValueSet/v2-0617` +- `http://terminology.hl7.org/ValueSet/v2-0618` +- `http://terminology.hl7.org/ValueSet/v2-0625` +- `http://terminology.hl7.org/ValueSet/v2-0634` +- `http://terminology.hl7.org/ValueSet/v2-0642` +- `http://terminology.hl7.org/ValueSet/v2-0651` +- `http://terminology.hl7.org/ValueSet/v2-0653` +- `http://terminology.hl7.org/ValueSet/v2-0657` +- `http://terminology.hl7.org/ValueSet/v2-0659` +- `http://terminology.hl7.org/ValueSet/v2-0667` +- `http://terminology.hl7.org/ValueSet/v2-0669` +- `http://terminology.hl7.org/ValueSet/v2-0682` +- `http://terminology.hl7.org/ValueSet/v2-0702` +- `http://terminology.hl7.org/ValueSet/v2-0717` +- `http://terminology.hl7.org/ValueSet/v2-0719` +- `http://terminology.hl7.org/ValueSet/v2-0725` +- `http://terminology.hl7.org/ValueSet/v2-0728` +- `http://terminology.hl7.org/ValueSet/v2-0731` +- `http://terminology.hl7.org/ValueSet/v2-0734` +- `http://terminology.hl7.org/ValueSet/v2-0739` +- `http://terminology.hl7.org/ValueSet/v2-0742` +- `http://terminology.hl7.org/ValueSet/v2-0749` +- `http://terminology.hl7.org/ValueSet/v2-0755` +- `http://terminology.hl7.org/ValueSet/v2-0757` +- `http://terminology.hl7.org/ValueSet/v2-0759` +- `http://terminology.hl7.org/ValueSet/v2-0761` +- `http://terminology.hl7.org/ValueSet/v2-0763` +- `http://terminology.hl7.org/ValueSet/v2-0776` +- `http://terminology.hl7.org/ValueSet/v2-0778` +- `http://terminology.hl7.org/ValueSet/v2-0790` +- `http://terminology.hl7.org/ValueSet/v2-0793` +- `http://terminology.hl7.org/ValueSet/v2-0806` +- `http://terminology.hl7.org/ValueSet/v2-0818` +- `http://terminology.hl7.org/ValueSet/v2-0834` +- `http://terminology.hl7.org/ValueSet/v2-0868` +- `http://terminology.hl7.org/ValueSet/v2-0871` +- `http://terminology.hl7.org/ValueSet/v2-0881` +- `http://terminology.hl7.org/ValueSet/v2-0882` +- `http://terminology.hl7.org/ValueSet/v2-0894` +- `http://terminology.hl7.org/ValueSet/v2-0895` +- `http://terminology.hl7.org/ValueSet/v2-0904` +- `http://terminology.hl7.org/ValueSet/v2-0905` +- `http://terminology.hl7.org/ValueSet/v2-0906` +- `http://terminology.hl7.org/ValueSet/v2-0907` +- `http://terminology.hl7.org/ValueSet/v2-0909` +- `http://terminology.hl7.org/ValueSet/v2-0912` +- `http://terminology.hl7.org/ValueSet/v2-0914` +- `http://terminology.hl7.org/ValueSet/v2-0916` +- `http://terminology.hl7.org/ValueSet/v2-0917` +- `http://terminology.hl7.org/ValueSet/v2-0918` +- `http://terminology.hl7.org/ValueSet/v2-0919` +- `http://terminology.hl7.org/ValueSet/v2-0920` +- `http://terminology.hl7.org/ValueSet/v2-0921` +- `http://terminology.hl7.org/ValueSet/v2-0922` +- `http://terminology.hl7.org/ValueSet/v2-0923` +- `http://terminology.hl7.org/ValueSet/v2-0924` +- `http://terminology.hl7.org/ValueSet/v2-0925` +- `http://terminology.hl7.org/ValueSet/v2-0926` +- `http://terminology.hl7.org/ValueSet/v2-0927` +- `http://terminology.hl7.org/ValueSet/v2-0933` +- `http://terminology.hl7.org/ValueSet/v2-0935` +- `http://terminology.hl7.org/ValueSet/v2-2.1-0006` +- `http://terminology.hl7.org/ValueSet/v2-2.3.1-0360` +- `http://terminology.hl7.org/ValueSet/v2-2.4-0006` +- `http://terminology.hl7.org/ValueSet/v2-2.4-0391` +- `http://terminology.hl7.org/ValueSet/v2-2.6-0391` +- `http://terminology.hl7.org/ValueSet/v2-2.7-0360` +- `http://terminology.hl7.org/ValueSet/v2-4000` +- `http://terminology.hl7.org/ValueSet/v3-AcknowledgementCondition` +- `http://terminology.hl7.org/ValueSet/v3-AcknowledgementDetailCode` +- `http://terminology.hl7.org/ValueSet/v3-AcknowledgementDetailType` +- `http://terminology.hl7.org/ValueSet/v3-AcknowledgementType` +- `http://terminology.hl7.org/ValueSet/v3-ActClass` +- `http://terminology.hl7.org/ValueSet/v3-ActClassClinicalDocument` +- `http://terminology.hl7.org/ValueSet/v3-ActClassDocument` +- `http://terminology.hl7.org/ValueSet/v3-ActClassInvestigation` +- `http://terminology.hl7.org/ValueSet/v3-ActClassObservation` +- `http://terminology.hl7.org/ValueSet/v3-ActClassProcedure` +- `http://terminology.hl7.org/ValueSet/v3-ActClassROI` +- `http://terminology.hl7.org/ValueSet/v3-ActClassSupply` +- `http://terminology.hl7.org/ValueSet/v3-ActCode` +- `http://terminology.hl7.org/ValueSet/v3-ActConsentDirective` +- `http://terminology.hl7.org/ValueSet/v3-ActConsentType` +- `http://terminology.hl7.org/ValueSet/v3-ActCoverageTypeCode` +- `http://terminology.hl7.org/ValueSet/v3-ActEncounterCode` +- `http://terminology.hl7.org/ValueSet/v3-ActExposureLevelCode` +- `http://terminology.hl7.org/ValueSet/v3-ActIncidentCode` +- `http://terminology.hl7.org/ValueSet/v3-ActInvoiceElementModifier` +- `http://terminology.hl7.org/ValueSet/v3-ActInvoiceGroupCode` +- `http://terminology.hl7.org/ValueSet/v3-ActMood` +- `http://terminology.hl7.org/ValueSet/v3-ActMoodIntent` +- `http://terminology.hl7.org/ValueSet/v3-ActMoodPredicate` +- `http://terminology.hl7.org/ValueSet/v3-ActPharmacySupplyType` +- `http://terminology.hl7.org/ValueSet/v3-ActPriority` +- `http://terminology.hl7.org/ValueSet/v3-ActReason` +- `http://terminology.hl7.org/ValueSet/v3-ActRelationshipCheckpoint` +- `http://terminology.hl7.org/ValueSet/v3-ActRelationshipConditional` +- `http://terminology.hl7.org/ValueSet/v3-ActRelationshipFulfills` +- `http://terminology.hl7.org/ValueSet/v3-ActRelationshipHasComponent` +- `http://terminology.hl7.org/ValueSet/v3-ActRelationshipJoin` +- `http://terminology.hl7.org/ValueSet/v3-ActRelationshipPertains` +- `http://terminology.hl7.org/ValueSet/v3-ActRelationshipSplit` +- `http://terminology.hl7.org/ValueSet/v3-ActRelationshipSubset` +- `http://terminology.hl7.org/ValueSet/v3-ActRelationshipType` +- `http://terminology.hl7.org/ValueSet/v3-ActSite` +- `http://terminology.hl7.org/ValueSet/v3-ActStatus` +- `http://terminology.hl7.org/ValueSet/v3-ActSubstanceAdminSubstitutionCode` +- `http://terminology.hl7.org/ValueSet/v3-ActTaskCode` +- `http://terminology.hl7.org/ValueSet/v3-ActUSPrivacyLaw` +- `http://terminology.hl7.org/ValueSet/v3-ActUncertainty` +- `http://terminology.hl7.org/ValueSet/v3-AddressPartType` +- `http://terminology.hl7.org/ValueSet/v3-AddressUse` +- `http://terminology.hl7.org/ValueSet/v3-AdministrativeGender` +- `http://terminology.hl7.org/ValueSet/v3-AmericanIndianAlaskaNativeLanguages` +- `http://terminology.hl7.org/ValueSet/v3-Calendar` +- `http://terminology.hl7.org/ValueSet/v3-CalendarCycle` +- `http://terminology.hl7.org/ValueSet/v3-CalendarType` +- `http://terminology.hl7.org/ValueSet/v3-Charset` +- `http://terminology.hl7.org/ValueSet/v3-CodingRationale` +- `http://terminology.hl7.org/ValueSet/v3-CommunicationFunctionType` +- `http://terminology.hl7.org/ValueSet/v3-Compartment` +- `http://terminology.hl7.org/ValueSet/v3-CompressionAlgorithm` +- `http://terminology.hl7.org/ValueSet/v3-Confidentiality` +- `http://terminology.hl7.org/ValueSet/v3-ConfidentialityClassification` +- `http://terminology.hl7.org/ValueSet/v3-ContainerCap` +- `http://terminology.hl7.org/ValueSet/v3-ContainerSeparator` +- `http://terminology.hl7.org/ValueSet/v3-ContentProcessingMode` +- `http://terminology.hl7.org/ValueSet/v3-ContextControl` +- `http://terminology.hl7.org/ValueSet/v3-DataOperation` +- `http://terminology.hl7.org/ValueSet/v3-Dentition` +- `http://terminology.hl7.org/ValueSet/v3-DeviceAlertLevel` +- `http://terminology.hl7.org/ValueSet/v3-DocumentCompletion` +- `http://terminology.hl7.org/ValueSet/v3-DocumentSectionType` +- `http://terminology.hl7.org/ValueSet/v3-DocumentStorage` +- `http://terminology.hl7.org/ValueSet/v3-EducationLevel` +- `http://terminology.hl7.org/ValueSet/v3-EmployeeJobClass` +- `http://terminology.hl7.org/ValueSet/v3-EncounterAdmissionSource` +- `http://terminology.hl7.org/ValueSet/v3-EncounterSpecialCourtesy` +- `http://terminology.hl7.org/ValueSet/v3-EntityClass` +- `http://terminology.hl7.org/ValueSet/v3-EntityClassDevice` +- `http://terminology.hl7.org/ValueSet/v3-EntityClassLivingSubject` +- `http://terminology.hl7.org/ValueSet/v3-EntityClassManufacturedMaterial` +- `http://terminology.hl7.org/ValueSet/v3-EntityClassOrganization` +- `http://terminology.hl7.org/ValueSet/v3-EntityClassPlace` +- `http://terminology.hl7.org/ValueSet/v3-EntityClassRoot` +- `http://terminology.hl7.org/ValueSet/v3-EntityCode` +- `http://terminology.hl7.org/ValueSet/v3-EntityDeterminer` +- `http://terminology.hl7.org/ValueSet/v3-EntityDeterminerDetermined` +- `http://terminology.hl7.org/ValueSet/v3-EntityHandling` +- `http://terminology.hl7.org/ValueSet/v3-EntityNamePartQualifier` +- `http://terminology.hl7.org/ValueSet/v3-EntityNamePartQualifierR2` +- `http://terminology.hl7.org/ValueSet/v3-EntityNamePartType` +- `http://terminology.hl7.org/ValueSet/v3-EntityNamePartTypeR2` +- `http://terminology.hl7.org/ValueSet/v3-EntityNameUse` +- `http://terminology.hl7.org/ValueSet/v3-EntityNameUseR2` +- `http://terminology.hl7.org/ValueSet/v3-EntityRisk` +- `http://terminology.hl7.org/ValueSet/v3-EntityStatus` +- `http://terminology.hl7.org/ValueSet/v3-EquipmentAlertLevel` +- `http://terminology.hl7.org/ValueSet/v3-Ethnicity` +- `http://terminology.hl7.org/ValueSet/v3-ExposureMode` +- `http://terminology.hl7.org/ValueSet/v3-FamilyMember` +- `http://terminology.hl7.org/ValueSet/v3-GTSAbbreviation` +- `http://terminology.hl7.org/ValueSet/v3-GenderStatus` +- `http://terminology.hl7.org/ValueSet/v3-GeneralPurposeOfUse` +- `http://terminology.hl7.org/ValueSet/v3-HL7ContextConductionStyle` +- `http://terminology.hl7.org/ValueSet/v3-HL7StandardVersionCode` +- `http://terminology.hl7.org/ValueSet/v3-HL7UpdateMode` +- `http://terminology.hl7.org/ValueSet/v3-HtmlLinkType` +- `http://terminology.hl7.org/ValueSet/v3-HumanLanguage` +- `http://terminology.hl7.org/ValueSet/v3-IdentifierReliability` +- `http://terminology.hl7.org/ValueSet/v3-IdentifierScope` +- `http://terminology.hl7.org/ValueSet/v3-InformationSensitivityPolicy` +- `http://terminology.hl7.org/ValueSet/v3-IntegrityCheckAlgorithm` +- `http://terminology.hl7.org/ValueSet/v3-LanguageAbilityMode` +- `http://terminology.hl7.org/ValueSet/v3-LanguageAbilityProficiency` +- `http://terminology.hl7.org/ValueSet/v3-LivingArrangement` +- `http://terminology.hl7.org/ValueSet/v3-LocalMarkupIgnore` +- `http://terminology.hl7.org/ValueSet/v3-LocalRemoteControlState` +- `http://terminology.hl7.org/ValueSet/v3-ManagedParticipationStatus` +- `http://terminology.hl7.org/ValueSet/v3-MapRelationship` +- `http://terminology.hl7.org/ValueSet/v3-MaritalStatus` +- `http://terminology.hl7.org/ValueSet/v3-MessageWaitingPriority` +- `http://terminology.hl7.org/ValueSet/v3-MilitaryRoleType` +- `http://terminology.hl7.org/ValueSet/v3-ModifyIndicator` +- `http://terminology.hl7.org/ValueSet/v3-NullFlavor` +- `http://terminology.hl7.org/ValueSet/v3-ObligationPolicy` +- `http://terminology.hl7.org/ValueSet/v3-ObservationCategory` +- `http://terminology.hl7.org/ValueSet/v3-ObservationInterpretation` +- `http://terminology.hl7.org/ValueSet/v3-ObservationMethod` +- `http://terminology.hl7.org/ValueSet/v3-ObservationType` +- `http://terminology.hl7.org/ValueSet/v3-ObservationValue` +- `http://terminology.hl7.org/ValueSet/v3-ParticipationFunction` +- `http://terminology.hl7.org/ValueSet/v3-ParticipationIndirectTarget` +- `http://terminology.hl7.org/ValueSet/v3-ParticipationInformationGenerator` +- `http://terminology.hl7.org/ValueSet/v3-ParticipationInformationTranscriber` +- `http://terminology.hl7.org/ValueSet/v3-ParticipationMode` +- `http://terminology.hl7.org/ValueSet/v3-ParticipationPhysicalPerformer` +- `http://terminology.hl7.org/ValueSet/v3-ParticipationSignature` +- `http://terminology.hl7.org/ValueSet/v3-ParticipationTargetDirect` +- `http://terminology.hl7.org/ValueSet/v3-ParticipationTargetLocation` +- `http://terminology.hl7.org/ValueSet/v3-ParticipationTargetSubject` +- `http://terminology.hl7.org/ValueSet/v3-ParticipationType` +- `http://terminology.hl7.org/ValueSet/v3-ParticipationVerifier` +- `http://terminology.hl7.org/ValueSet/v3-PatientImportance` +- `http://terminology.hl7.org/ValueSet/v3-PaymentTerms` +- `http://terminology.hl7.org/ValueSet/v3-PersonDisabilityType` +- `http://terminology.hl7.org/ValueSet/v3-PersonalRelationshipRoleType` +- `http://terminology.hl7.org/ValueSet/v3-ProbabilityDistributionType` +- `http://terminology.hl7.org/ValueSet/v3-ProcessingID` +- `http://terminology.hl7.org/ValueSet/v3-ProcessingMode` +- `http://terminology.hl7.org/ValueSet/v3-ProvenanceEventCurrentState` +- `http://terminology.hl7.org/ValueSet/v3-ProvenanceEventCurrentState-AS` +- `http://terminology.hl7.org/ValueSet/v3-ProvenanceEventCurrentState-DC` +- `http://terminology.hl7.org/ValueSet/v3-PurposeOfUse` +- `http://terminology.hl7.org/ValueSet/v3-QueryParameterValue` +- `http://terminology.hl7.org/ValueSet/v3-QueryPriority` +- `http://terminology.hl7.org/ValueSet/v3-QueryRequestLimit` +- `http://terminology.hl7.org/ValueSet/v3-QueryResponse` +- `http://terminology.hl7.org/ValueSet/v3-QueryStatusCode` +- `http://terminology.hl7.org/ValueSet/v3-Race` +- `http://terminology.hl7.org/ValueSet/v3-RefrainPolicy` +- `http://terminology.hl7.org/ValueSet/v3-RelationalOperator` +- `http://terminology.hl7.org/ValueSet/v3-RelationshipConjunction` +- `http://terminology.hl7.org/ValueSet/v3-ReligiousAffiliation` +- `http://terminology.hl7.org/ValueSet/v3-ResponseLevel` +- `http://terminology.hl7.org/ValueSet/v3-ResponseModality` +- `http://terminology.hl7.org/ValueSet/v3-ResponseMode` +- `http://terminology.hl7.org/ValueSet/v3-RoleClass` +- `http://terminology.hl7.org/ValueSet/v3-RoleClassAgent` +- `http://terminology.hl7.org/ValueSet/v3-RoleClassAssociative` +- `http://terminology.hl7.org/ValueSet/v3-RoleClassManufacturedProduct` +- `http://terminology.hl7.org/ValueSet/v3-RoleClassMutualRelationship` +- `http://terminology.hl7.org/ValueSet/v3-RoleClassPartitive` +- `http://terminology.hl7.org/ValueSet/v3-RoleClassPassive` +- `http://terminology.hl7.org/ValueSet/v3-RoleClassRelationshipFormal` +- `http://terminology.hl7.org/ValueSet/v3-RoleClassRoot` +- `http://terminology.hl7.org/ValueSet/v3-RoleClassServiceDeliveryLocation` +- `http://terminology.hl7.org/ValueSet/v3-RoleClassSpecimen` +- `http://terminology.hl7.org/ValueSet/v3-RoleCode` +- `http://terminology.hl7.org/ValueSet/v3-RoleLinkStatus` +- `http://terminology.hl7.org/ValueSet/v3-RoleLinkType` +- `http://terminology.hl7.org/ValueSet/v3-RoleStatus` +- `http://terminology.hl7.org/ValueSet/v3-RouteOfAdministration` +- `http://terminology.hl7.org/ValueSet/v3-SecurityControlObservationValue` +- `http://terminology.hl7.org/ValueSet/v3-SecurityIntegrityObservationValue` +- `http://terminology.hl7.org/ValueSet/v3-SecurityPolicy` +- `http://terminology.hl7.org/ValueSet/v3-Sequencing` +- `http://terminology.hl7.org/ValueSet/v3-ServiceDeliveryLocationRoleType` +- `http://terminology.hl7.org/ValueSet/v3-SetOperator` +- `http://terminology.hl7.org/ValueSet/v3-SeverityObservation` +- `http://terminology.hl7.org/ValueSet/v3-SpecimenType` +- `http://terminology.hl7.org/ValueSet/v3-SubstanceAdminSubstitutionReason` +- `http://terminology.hl7.org/ValueSet/v3-SubstitutionCondition` +- `http://terminology.hl7.org/ValueSet/v3-TableCellHorizontalAlign` +- `http://terminology.hl7.org/ValueSet/v3-TableCellScope` +- `http://terminology.hl7.org/ValueSet/v3-TableCellVerticalAlign` +- `http://terminology.hl7.org/ValueSet/v3-TableFrame` +- `http://terminology.hl7.org/ValueSet/v3-TableRules` +- `http://terminology.hl7.org/ValueSet/v3-TargetAwareness` +- `http://terminology.hl7.org/ValueSet/v3-TelecommunicationCapabilities` +- `http://terminology.hl7.org/ValueSet/v3-TimingEvent` +- `http://terminology.hl7.org/ValueSet/v3-TransmissionRelationshipTypeCode` +- `http://terminology.hl7.org/ValueSet/v3-TribalEntityUS` +- `http://terminology.hl7.org/ValueSet/v3-VaccineManufacturer` +- `http://terminology.hl7.org/ValueSet/v3-VerificationMethod` +- `http://terminology.hl7.org/ValueSet/v3-WorkClassificationODH` +- `http://terminology.hl7.org/ValueSet/v3-WorkScheduleODH` +- `http://terminology.hl7.org/ValueSet/v3-employmentStatusODH` +- `http://terminology.hl7.org/ValueSet/v3-hl7ApprovalStatus` +- `http://terminology.hl7.org/ValueSet/v3-hl7CMETAttribution` +- `http://terminology.hl7.org/ValueSet/v3-hl7ITSType` +- `http://terminology.hl7.org/ValueSet/v3-hl7ITSVersionCode` +- `http://terminology.hl7.org/ValueSet/v3-hl7PublishingDomain` +- `http://terminology.hl7.org/ValueSet/v3-hl7PublishingSection` +- `http://terminology.hl7.org/ValueSet/v3-hl7PublishingSubSection` +- `http://terminology.hl7.org/ValueSet/v3-hl7Realm` +- `http://terminology.hl7.org/ValueSet/v3-hl7V3Conformance` +- `http://terminology.hl7.org/ValueSet/v3-hl7VoteResolution` +- `http://terminology.hl7.org/ValueSet/v3-orderableDrugForm` +- `http://terminology.hl7.org/ValueSet/v3-policyHolderRole` +- `http://terminology.hl7.org/ValueSet/v3-styleType` +- `http://terminology.hl7.org/ValueSet/v3-substanceAdminSubstitution` +- `http://terminology.hl7.org/ValueSet/v3-triggerEventID` +- `http://terminology.hl7.org/ValueSet/v3-xBasicConfidentialityKind` + +## Package: `shared` + +### Skipped Canonicals + +- `urn:fhir:binding:AccidentType` +- `urn:fhir:binding:AccountStatus` +- `urn:fhir:binding:AccountType` +- `urn:fhir:binding:ActionCardinalityBehavior` +- `urn:fhir:binding:ActionConditionKind` +- `urn:fhir:binding:ActionGroupingBehavior` +- `urn:fhir:binding:ActionParticipantRole` +- `urn:fhir:binding:ActionParticipantType` +- `urn:fhir:binding:ActionPrecheckBehavior` +- `urn:fhir:binding:ActionRelationshipType` +- `urn:fhir:binding:ActionRequiredBehavior` +- `urn:fhir:binding:ActionSelectionBehavior` +- `urn:fhir:binding:ActionType` +- `urn:fhir:binding:ActivityDefinitionKind` +- `urn:fhir:binding:ActivityDefinitionType` +- `urn:fhir:binding:ActivityParticipantRole` +- `urn:fhir:binding:ActivityParticipantType` +- `urn:fhir:binding:Adjudication` +- `urn:fhir:binding:AdjudicationError` +- `urn:fhir:binding:AdjudicationReason` +- `urn:fhir:binding:AdjunctDiagnosis` +- `urn:fhir:binding:AdverseEventActuality` +- `urn:fhir:binding:AdverseEventCategory` +- `urn:fhir:binding:AdverseEventCausalityAssessment` +- `urn:fhir:binding:AdverseEventCausalityMethod` +- `urn:fhir:binding:AdverseEventOutcome` +- `urn:fhir:binding:AdverseEventSeriousness` +- `urn:fhir:binding:AdverseEventSeverity` +- `urn:fhir:binding:AdverseEventType` +- `urn:fhir:binding:AggregationMode` +- `urn:fhir:binding:AppointmentStatus` +- `urn:fhir:binding:ApptReason` +- `urn:fhir:binding:AssertionDirectionType` +- `urn:fhir:binding:AssertionOperatorType` +- `urn:fhir:binding:AssertionResponseTypes` +- `urn:fhir:binding:AssetAvailabilityType` +- `urn:fhir:binding:AuditAgentRole` +- `urn:fhir:binding:AuditAgentType` +- `urn:fhir:binding:AuditEventAction` +- `urn:fhir:binding:AuditEventAgentNetworkType` +- `urn:fhir:binding:AuditEventEntityLifecycle` +- `urn:fhir:binding:AuditEventEntityRole` +- `urn:fhir:binding:AuditEventEntityType` +- `urn:fhir:binding:AuditEventOutcome` +- `urn:fhir:binding:AuditEventSourceType` +- `urn:fhir:binding:AuditEventSubType` +- `urn:fhir:binding:AuditEventType` +- `urn:fhir:binding:AuditPurposeOfUse` +- `urn:fhir:binding:AuthSupporting` +- `urn:fhir:binding:BasicResourceType` +- `urn:fhir:binding:BenefitCategory` +- `urn:fhir:binding:BenefitCostApplicability` +- `urn:fhir:binding:BenefitNetwork` +- `urn:fhir:binding:BenefitTerm` +- `urn:fhir:binding:BenefitType` +- `urn:fhir:binding:BenefitUnit` +- `urn:fhir:binding:BindingStrength` +- `urn:fhir:binding:BiologicallyDerivedProductCategory` +- `urn:fhir:binding:BiologicallyDerivedProductProcedure` +- `urn:fhir:binding:BiologicallyDerivedProductStatus` +- `urn:fhir:binding:BiologicallyDerivedProductStorageScale` +- `urn:fhir:binding:BodyLengthUnits` +- `urn:fhir:binding:BodyStructureCode` +- `urn:fhir:binding:BodyStructureQualifier` +- `urn:fhir:binding:BodyTempUnits` +- `urn:fhir:binding:BodyWeightUnits` +- `urn:fhir:binding:CapabilityStatementKind` +- `urn:fhir:binding:CarePlanActivityKind` +- `urn:fhir:binding:CarePlanActivityOutcome` +- `urn:fhir:binding:CarePlanActivityReason` +- `urn:fhir:binding:CarePlanActivityStatus` +- `urn:fhir:binding:CarePlanActivityType` +- `urn:fhir:binding:CarePlanCategory` +- `urn:fhir:binding:CarePlanIntent` +- `urn:fhir:binding:CarePlanStatus` +- `urn:fhir:binding:CareTeamCategory` +- `urn:fhir:binding:CareTeamParticipantRole` +- `urn:fhir:binding:CareTeamReason` +- `urn:fhir:binding:CareTeamRole` +- `urn:fhir:binding:CareTeamStatus` +- `urn:fhir:binding:CatalogEntryRelationType` +- `urn:fhir:binding:CatalogType` +- `urn:fhir:binding:CertaintySubcomponentRating` +- `urn:fhir:binding:CertaintySubcomponentType` +- `urn:fhir:binding:ChargeItemCode` +- `urn:fhir:binding:ChargeItemDefinitionCode` +- `urn:fhir:binding:ChargeItemDefinitionPriceComponentType` +- `urn:fhir:binding:ChargeItemPerformerFunction` +- `urn:fhir:binding:ChargeItemReason` +- `urn:fhir:binding:ChargeItemStatus` +- `urn:fhir:binding:ClaimResponseStatus` +- `urn:fhir:binding:ClaimStatus` +- `urn:fhir:binding:ClaimSubType` +- `urn:fhir:binding:ClaimType` +- `urn:fhir:binding:ClinicalImpressionPrognosis` +- `urn:fhir:binding:ClinicalImpressionStatus` +- `urn:fhir:binding:CodeSearchSupport` +- `urn:fhir:binding:CodeSystemContentMode` +- `urn:fhir:binding:CodeSystemHierarchyMeaning` +- `urn:fhir:binding:CollectedSpecimenType` +- `urn:fhir:binding:CommunicationCategory` +- `urn:fhir:binding:CommunicationMedium` +- `urn:fhir:binding:CommunicationNotDoneReason` +- `urn:fhir:binding:CommunicationPriority` +- `urn:fhir:binding:CommunicationReason` +- `urn:fhir:binding:CommunicationRequestStatus` +- `urn:fhir:binding:CommunicationStatus` +- `urn:fhir:binding:CommunicationTopic` +- `urn:fhir:binding:CompartmentCode` +- `urn:fhir:binding:CompartmentType` +- `urn:fhir:binding:CompositeMeasureScoring` +- `urn:fhir:binding:CompositionAttestationMode` +- `urn:fhir:binding:CompositionSectionType` +- `urn:fhir:binding:CompositionStatus` +- `urn:fhir:binding:ConceptDesignationUse` +- `urn:fhir:binding:ConceptMapEquivalence` +- `urn:fhir:binding:ConceptMapGroupUnmappedMode` +- `urn:fhir:binding:ConditionCategory` +- `urn:fhir:binding:ConditionClinicalStatus` +- `urn:fhir:binding:ConditionCode` +- `urn:fhir:binding:ConditionKind` +- `urn:fhir:binding:ConditionOutcome` +- `urn:fhir:binding:ConditionSeverity` +- `urn:fhir:binding:ConditionStage` +- `urn:fhir:binding:ConditionStageType` +- `urn:fhir:binding:ConditionVerificationStatus` +- `urn:fhir:binding:ConditionalDeleteStatus` +- `urn:fhir:binding:ConditionalReadStatus` +- `urn:fhir:binding:ConsentAction` +- `urn:fhir:binding:ConsentActorRole` +- `urn:fhir:binding:ConsentCategory` +- `urn:fhir:binding:ConsentContentClass` +- `urn:fhir:binding:ConsentContentCode` +- `urn:fhir:binding:ConsentDataMeaning` +- `urn:fhir:binding:ConsentPolicyRule` +- `urn:fhir:binding:ConsentProvisionType` +- `urn:fhir:binding:ConsentScope` +- `urn:fhir:binding:ConsentState` +- `urn:fhir:binding:ConstraintSeverity` +- `urn:fhir:binding:ContactPartyType` +- `urn:fhir:binding:ContainerCap` +- `urn:fhir:binding:ContainerMaterial` +- `urn:fhir:binding:ContainerType` +- `urn:fhir:binding:ContractAction` +- `urn:fhir:binding:ContractActionPerformerRole` +- `urn:fhir:binding:ContractActionPerformerType` +- `urn:fhir:binding:ContractActionReason` +- `urn:fhir:binding:ContractActionStatus` +- `urn:fhir:binding:ContractActorRole` +- `urn:fhir:binding:ContractAssetContext` +- `urn:fhir:binding:ContractAssetScope` +- `urn:fhir:binding:ContractAssetSubtype` +- `urn:fhir:binding:ContractAssetType` +- `urn:fhir:binding:ContractContentDerivative` +- `urn:fhir:binding:ContractDecisionMode` +- `urn:fhir:binding:ContractDecisionType` +- `urn:fhir:binding:ContractDefinitionSubtype` +- `urn:fhir:binding:ContractDefinitionType` +- `urn:fhir:binding:ContractExpiration` +- `urn:fhir:binding:ContractLegalState` +- `urn:fhir:binding:ContractPartyRole` +- `urn:fhir:binding:ContractPublicationStatus` +- `urn:fhir:binding:ContractScope` +- `urn:fhir:binding:ContractSecurityCategory` +- `urn:fhir:binding:ContractSecurityClassification` +- `urn:fhir:binding:ContractSecurityControl` +- `urn:fhir:binding:ContractSignerType` +- `urn:fhir:binding:ContractStatus` +- `urn:fhir:binding:ContractSubtype` +- `urn:fhir:binding:ContractTermSubType` +- `urn:fhir:binding:ContractTermType` +- `urn:fhir:binding:ContractType` +- `urn:fhir:binding:CopayTypes` +- `urn:fhir:binding:CoverageClass` +- `urn:fhir:binding:CoverageFinancialException` +- `urn:fhir:binding:CoverageStatus` +- `urn:fhir:binding:CoverageType` +- `urn:fhir:binding:DICOMMediaType` +- `urn:fhir:binding:DaysOfWeek` +- `urn:fhir:binding:DefinitionTopic` +- `urn:fhir:binding:DetectedIssueCategory` +- `urn:fhir:binding:DetectedIssueEvidenceCode` +- `urn:fhir:binding:DetectedIssueMitigationAction` +- `urn:fhir:binding:DetectedIssueSeverity` +- `urn:fhir:binding:DetectedIssueStatus` +- `urn:fhir:binding:DeviceActionKind` +- `urn:fhir:binding:DeviceKind` +- `urn:fhir:binding:DeviceMetricCalibrationState` +- `urn:fhir:binding:DeviceMetricCalibrationType` +- `urn:fhir:binding:DeviceMetricCategory` +- `urn:fhir:binding:DeviceMetricColor` +- `urn:fhir:binding:DeviceMetricOperationalStatus` +- `urn:fhir:binding:DeviceNameType` +- `urn:fhir:binding:DeviceRequestParticipantRole` +- `urn:fhir:binding:DeviceRequestReason` +- `urn:fhir:binding:DeviceRequestStatus` +- `urn:fhir:binding:DeviceType` +- `urn:fhir:binding:DeviceUseStatementStatus` +- `urn:fhir:binding:DiagnosisOnAdmission` +- `urn:fhir:binding:DiagnosisRelatedGroup` +- `urn:fhir:binding:DiagnosisType` +- `urn:fhir:binding:DiagnosticReportCodes` +- `urn:fhir:binding:DiagnosticReportStatus` +- `urn:fhir:binding:DiagnosticServiceSection` +- `urn:fhir:binding:DiscriminatorType` +- `urn:fhir:binding:DocumentC80Class` +- `urn:fhir:binding:DocumentC80FacilityType` +- `urn:fhir:binding:DocumentC80PracticeSetting` +- `urn:fhir:binding:DocumentC80Type` +- `urn:fhir:binding:DocumentCategory` +- `urn:fhir:binding:DocumentConfidentiality` +- `urn:fhir:binding:DocumentEventType` +- `urn:fhir:binding:DocumentFormat` +- `urn:fhir:binding:DocumentMode` +- `urn:fhir:binding:DocumentReferenceStatus` +- `urn:fhir:binding:DocumentRelationshipType` +- `urn:fhir:binding:DocumentType` +- `urn:fhir:binding:EffectEstimateType` +- `urn:fhir:binding:ElementDefinitionCode` +- `urn:fhir:binding:EligibilityRequestPurpose` +- `urn:fhir:binding:EligibilityRequestStatus` +- `urn:fhir:binding:EligibilityResponsePurpose` +- `urn:fhir:binding:EligibilityResponseStatus` +- `urn:fhir:binding:EnableWhenBehavior` +- `urn:fhir:binding:EndpointStatus` +- `urn:fhir:binding:EnrollmentRequestStatus` +- `urn:fhir:binding:EnrollmentResponseStatus` +- `urn:fhir:binding:EnteralFormulaAdditiveType` +- `urn:fhir:binding:EnteralFormulaType` +- `urn:fhir:binding:EnteralRouteOfAdministration` +- `urn:fhir:binding:EpisodeOfCareStatus` +- `urn:fhir:binding:EpisodeOfCareType` +- `urn:fhir:binding:EvaluationDoseStatus` +- `urn:fhir:binding:EvaluationDoseStatusReason` +- `urn:fhir:binding:EvaluationTargetDisease` +- `urn:fhir:binding:EventCapabilityMode` +- `urn:fhir:binding:EventPerformerFunction` +- `urn:fhir:binding:EventReason` +- `urn:fhir:binding:EvidenceVariableType` +- `urn:fhir:binding:EvidenceVariantState` +- `urn:fhir:binding:ExampleScenarioActorType` +- `urn:fhir:binding:ExplanationOfBenefitStatus` +- `urn:fhir:binding:ExposureState` +- `urn:fhir:binding:ExtensionContextType` +- `urn:fhir:binding:FHIRDefinedType` +- `urn:fhir:binding:FHIRDefinedTypeExt` +- `urn:fhir:binding:FHIRDeviceStatus` +- `urn:fhir:binding:FHIRDeviceStatusReason` +- `urn:fhir:binding:FHIRResourceType` +- `urn:fhir:binding:FHIRSubstanceStatus` +- `urn:fhir:binding:FHIRVersion` +- `urn:fhir:binding:FamilialRelationship` +- `urn:fhir:binding:FamilyHistoryAbsentReason` +- `urn:fhir:binding:FamilyHistoryReason` +- `urn:fhir:binding:FamilyHistoryStatus` +- `urn:fhir:binding:FilterOperator` +- `urn:fhir:binding:FlagCategory` +- `urn:fhir:binding:FlagCode` +- `urn:fhir:binding:FlagStatus` +- `urn:fhir:binding:FluidConsistencyType` +- `urn:fhir:binding:FoodType` +- `urn:fhir:binding:Forms` +- `urn:fhir:binding:FundingSource` +- `urn:fhir:binding:FundsReserve` +- `urn:fhir:binding:GoalAchievementStatus` +- `urn:fhir:binding:GoalAddresses` +- `urn:fhir:binding:GoalCategory` +- `urn:fhir:binding:GoalDescription` +- `urn:fhir:binding:GoalLifecycleStatus` +- `urn:fhir:binding:GoalOutcome` +- `urn:fhir:binding:GoalPriority` +- `urn:fhir:binding:GoalStartEvent` +- `urn:fhir:binding:GoalTargetMeasure` +- `urn:fhir:binding:GraphCompartmentRule` +- `urn:fhir:binding:GraphCompartmentUse` +- `urn:fhir:binding:GroupMeasure` +- `urn:fhir:binding:GroupType` +- `urn:fhir:binding:GuidanceResponseStatus` +- `urn:fhir:binding:GuidePageGeneration` +- `urn:fhir:binding:GuideParameterCode` +- `urn:fhir:binding:HandlingConditionSet` +- `urn:fhir:binding:IdentityAssuranceLevel` +- `urn:fhir:binding:ImagingModality` +- `urn:fhir:binding:ImagingProcedureCode` +- `urn:fhir:binding:ImagingReason` +- `urn:fhir:binding:ImagingStudyStatus` +- `urn:fhir:binding:ImmunizationEvaluationStatus` +- `urn:fhir:binding:ImmunizationFunction` +- `urn:fhir:binding:ImmunizationReason` +- `urn:fhir:binding:ImmunizationRecommendationDateCriterion` +- `urn:fhir:binding:ImmunizationRecommendationReason` +- `urn:fhir:binding:ImmunizationRecommendationStatus` +- `urn:fhir:binding:ImmunizationReportOrigin` +- `urn:fhir:binding:ImmunizationRoute` +- `urn:fhir:binding:ImmunizationSite` +- `urn:fhir:binding:ImmunizationStatus` +- `urn:fhir:binding:ImmunizationStatusReason` +- `urn:fhir:binding:InformationCategory` +- `urn:fhir:binding:InformationCode` +- `urn:fhir:binding:InsurancePlanType` +- `urn:fhir:binding:IntendedSpecimenType` +- `urn:fhir:binding:InvestigationGroupType` +- `urn:fhir:binding:InvoicePriceComponentType` +- `urn:fhir:binding:InvoiceStatus` +- `urn:fhir:binding:Jurisdiction` +- `urn:fhir:binding:LDLCodes` +- `urn:fhir:binding:LOINC LL379-9 answerlist` +- `urn:fhir:binding:Laterality` +- `urn:fhir:binding:LibraryType` +- `urn:fhir:binding:LinkageType` +- `urn:fhir:binding:ListEmptyReason` +- `urn:fhir:binding:ListItemFlag` +- `urn:fhir:binding:ListMode` +- `urn:fhir:binding:ListOrder` +- `urn:fhir:binding:ListPurpose` +- `urn:fhir:binding:ListStatus` +- `urn:fhir:binding:LocationMode` +- `urn:fhir:binding:LocationStatus` +- `urn:fhir:binding:LocationType` +- `urn:fhir:binding:ManifestationOrSymptom` +- `urn:fhir:binding:MeasureDataUsage` +- `urn:fhir:binding:MeasureImprovementNotation` +- `urn:fhir:binding:MeasurePopulation` +- `urn:fhir:binding:MeasurePopulationType` +- `urn:fhir:binding:MeasureReportStatus` +- `urn:fhir:binding:MeasureReportType` +- `urn:fhir:binding:MeasureScoring` +- `urn:fhir:binding:MeasureType` +- `urn:fhir:binding:MediaModality` +- `urn:fhir:binding:MediaReason` +- `urn:fhir:binding:MediaStatus` +- `urn:fhir:binding:MediaType` +- `urn:fhir:binding:MediaView` +- `urn:fhir:binding:MedicationAdministrationCategory` +- `urn:fhir:binding:MedicationAdministrationNegationReason` +- `urn:fhir:binding:MedicationAdministrationPerformerFunction` +- `urn:fhir:binding:MedicationAdministrationReason` +- `urn:fhir:binding:MedicationAdministrationStatus` +- `urn:fhir:binding:MedicationCharacteristic` +- `urn:fhir:binding:MedicationDispenseCategory` +- `urn:fhir:binding:MedicationDispensePerformerFunction` +- `urn:fhir:binding:MedicationDispenseStatus` +- `urn:fhir:binding:MedicationDispenseType` +- `urn:fhir:binding:MedicationForm` +- `urn:fhir:binding:MedicationFormalRepresentation` +- `urn:fhir:binding:MedicationIntendedSubstitutionReason` +- `urn:fhir:binding:MedicationIntendedSubstitutionType` +- `urn:fhir:binding:MedicationKnowledgeStatus` +- `urn:fhir:binding:MedicationPackageType` +- `urn:fhir:binding:MedicationReason` +- `urn:fhir:binding:MedicationRequestCategory` +- `urn:fhir:binding:MedicationRequestCourseOfTherapy` +- `urn:fhir:binding:MedicationRequestIntent` +- `urn:fhir:binding:MedicationRequestPerformerType` +- `urn:fhir:binding:MedicationRequestPriority` +- `urn:fhir:binding:MedicationRequestReason` +- `urn:fhir:binding:MedicationRequestStatus` +- `urn:fhir:binding:MedicationRequestStatusReason` +- `urn:fhir:binding:MedicationRoute` +- `urn:fhir:binding:MedicationStatementCategory` +- `urn:fhir:binding:MedicationStatementStatus` +- `urn:fhir:binding:MedicationStatementStatusReason` +- `urn:fhir:binding:MedicationStatus` +- `urn:fhir:binding:MessageSignificanceCategory` +- `urn:fhir:binding:MessageTransport` +- `urn:fhir:binding:MetricType` +- `urn:fhir:binding:MetricUnit` +- `urn:fhir:binding:MissingReason` +- `urn:fhir:binding:Modifiers` +- `urn:fhir:binding:NamingSystemIdentifierType` +- `urn:fhir:binding:NamingSystemType` +- `urn:fhir:binding:NoteType` +- `urn:fhir:binding:NutrientModifier` +- `urn:fhir:binding:NutritiionOrderIntent` +- `urn:fhir:binding:NutritionOrderStatus` +- `urn:fhir:binding:ObservationDataType` +- `urn:fhir:binding:ObservationRangeAppliesTo` +- `urn:fhir:binding:ObservationRangeCategory` +- `urn:fhir:binding:ObservationUnit` +- `urn:fhir:binding:OperationKind` +- `urn:fhir:binding:OperationParameterUse` +- `urn:fhir:binding:OperationalStatus` +- `urn:fhir:binding:OralDiet` +- `urn:fhir:binding:OralSites` +- `urn:fhir:binding:OrderDetail` +- `urn:fhir:binding:OrganizationAffiliation` +- `urn:fhir:binding:OrganizationSpecialty` +- `urn:fhir:binding:OrganizationType` +- `urn:fhir:binding:ParticipantRequired` +- `urn:fhir:binding:ParticipantStatus` +- `urn:fhir:binding:ParticipationStatus` +- `urn:fhir:binding:PatientRelationshipType` +- `urn:fhir:binding:PayeeType` +- `urn:fhir:binding:PayloadType` +- `urn:fhir:binding:PaymentAdjustmentReason` +- `urn:fhir:binding:PaymentNoticeStatus` +- `urn:fhir:binding:PaymentReconciliationStatus` +- `urn:fhir:binding:PaymentStatus` +- `urn:fhir:binding:PaymentType` +- `urn:fhir:binding:PlanDefinitionType` +- `urn:fhir:binding:PractitionerRole` +- `urn:fhir:binding:PractitionerSpecialty` +- `urn:fhir:binding:PrecisionEstimateType` +- `urn:fhir:binding:PreparePatient` +- `urn:fhir:binding:ProcedureCategory` +- `urn:fhir:binding:ProcedureCode` +- `urn:fhir:binding:ProcedureComplication` +- `urn:fhir:binding:ProcedureFollowUp` +- `urn:fhir:binding:ProcedureNegationReason` +- `urn:fhir:binding:ProcedureOutcome` +- `urn:fhir:binding:ProcedurePerformerRole` +- `urn:fhir:binding:ProcedureReason` +- `urn:fhir:binding:ProcedureStatus` +- `urn:fhir:binding:ProcedureType` +- `urn:fhir:binding:ProcedureUsed` +- `urn:fhir:binding:ProcessPriority` +- `urn:fhir:binding:Program` +- `urn:fhir:binding:ProgramCode` +- `urn:fhir:binding:ProgramEligibility` +- `urn:fhir:binding:PropertyRepresentation` +- `urn:fhir:binding:PropertyType` +- `urn:fhir:binding:ProvenanceHistoryAgentType` +- `urn:fhir:binding:ProvenanceHistoryRecordActivity` +- `urn:fhir:binding:ProviderQualification` +- `urn:fhir:binding:PublicationStatus` +- `urn:fhir:binding:PurposeOfUse` +- `urn:fhir:binding:Qualification` +- `urn:fhir:binding:QualityOfEvidenceRating` +- `urn:fhir:binding:QuestionnaireConcept` +- `urn:fhir:binding:QuestionnaireItemOperator` +- `urn:fhir:binding:QuestionnaireItemType` +- `urn:fhir:binding:QuestionnaireResponseStatus` +- `urn:fhir:binding:ReferenceHandlingPolicy` +- `urn:fhir:binding:ReferenceVersionRules` +- `urn:fhir:binding:ReferralMethod` +- `urn:fhir:binding:ReferredDocumentStatus` +- `urn:fhir:binding:RejectionCriterion` +- `urn:fhir:binding:RelatedClaimRelationship` +- `urn:fhir:binding:Relationship` +- `urn:fhir:binding:RemittanceOutcome` +- `urn:fhir:binding:RequestIntent` +- `urn:fhir:binding:RequestPriority` +- `urn:fhir:binding:RequestStatus` +- `urn:fhir:binding:ResearchElementType` +- `urn:fhir:binding:ResearchStudyObjectiveType` +- `urn:fhir:binding:ResearchStudyPhase` +- `urn:fhir:binding:ResearchStudyPrimaryPurposeType` +- `urn:fhir:binding:ResearchStudyReasonStopped` +- `urn:fhir:binding:ResearchStudyStatus` +- `urn:fhir:binding:ResearchSubjectStatus` +- `urn:fhir:binding:ResourceType` +- `urn:fhir:binding:ResourceVersionPolicy` +- `urn:fhir:binding:ResponseType` +- `urn:fhir:binding:RestfulCapabilityMode` +- `urn:fhir:binding:RestfulSecurityService` +- `urn:fhir:binding:RevenueCenter` +- `urn:fhir:binding:RiskAssessmentProbability` +- `urn:fhir:binding:RiskAssessmentStatus` +- `urn:fhir:binding:RiskEstimateType` +- `urn:fhir:binding:SPDXLicense` +- `urn:fhir:binding:Safety` +- `urn:fhir:binding:SearchComparator` +- `urn:fhir:binding:SearchModifierCode` +- `urn:fhir:binding:SearchParamType` +- `urn:fhir:binding:SectionEmptyReason` +- `urn:fhir:binding:SectionEntryOrder` +- `urn:fhir:binding:SectionMode` +- `urn:fhir:binding:ServiceProduct` +- `urn:fhir:binding:ServiceProvisionConditions` +- `urn:fhir:binding:ServiceRequestCategory` +- `urn:fhir:binding:ServiceRequestCode` +- `urn:fhir:binding:ServiceRequestIntent` +- `urn:fhir:binding:ServiceRequestLocation` +- `urn:fhir:binding:ServiceRequestParticipantRole` +- `urn:fhir:binding:ServiceRequestPriority` +- `urn:fhir:binding:ServiceRequestReason` +- `urn:fhir:binding:ServiceRequestStatus` +- `urn:fhir:binding:Sex` +- `urn:fhir:binding:SlicingRules` +- `urn:fhir:binding:SlotStatus` +- `urn:fhir:binding:SpecimenCollection` +- `urn:fhir:binding:SpecimenCollectionMethod` +- `urn:fhir:binding:SpecimenCondition` +- `urn:fhir:binding:SpecimenContainedPreference` +- `urn:fhir:binding:SpecimenContainerType` +- `urn:fhir:binding:SpecimenProcessingProcedure` +- `urn:fhir:binding:SpecimenStatus` +- `urn:fhir:binding:SpecimenType` +- `urn:fhir:binding:Status` +- `urn:fhir:binding:StructureDefinitionKeyword` +- `urn:fhir:binding:StructureDefinitionKind` +- `urn:fhir:binding:StructureMapContextType` +- `urn:fhir:binding:StructureMapGroupTypeMode` +- `urn:fhir:binding:StructureMapInputMode` +- `urn:fhir:binding:StructureMapModelMode` +- `urn:fhir:binding:StructureMapSourceListMode` +- `urn:fhir:binding:StructureMapTargetListMode` +- `urn:fhir:binding:StructureMapTransform` +- `urn:fhir:binding:StudyType` +- `urn:fhir:binding:SubpotentReason` +- `urn:fhir:binding:SubscriptionChannelType` +- `urn:fhir:binding:SubscriptionStatus` +- `urn:fhir:binding:SubstanceCategory` +- `urn:fhir:binding:SupplementType` +- `urn:fhir:binding:SupplyDeliveryStatus` +- `urn:fhir:binding:SupplyDeliveryType` +- `urn:fhir:binding:SupplyRequestKind` +- `urn:fhir:binding:SupplyRequestReason` +- `urn:fhir:binding:SupplyRequestStatus` +- `urn:fhir:binding:Surface` +- `urn:fhir:binding:SynthesisType` +- `urn:fhir:binding:SystemRestfulInteraction` +- `urn:fhir:binding:TargetDisease` +- `urn:fhir:binding:TaskCode` +- `urn:fhir:binding:TaskIntent` +- `urn:fhir:binding:TaskPerformerType` +- `urn:fhir:binding:TaskPriority` +- `urn:fhir:binding:TaskStatus` +- `urn:fhir:binding:TestReportActionResult` +- `urn:fhir:binding:TestReportParticipantType` +- `urn:fhir:binding:TestReportResult` +- `urn:fhir:binding:TestReportStatus` +- `urn:fhir:binding:TestScriptOperationCode` +- `urn:fhir:binding:TestScriptProfileDestinationType` +- `urn:fhir:binding:TestScriptProfileOriginType` +- `urn:fhir:binding:TestScriptRequestMethodCode` +- `urn:fhir:binding:TextureModifiedFoodType` +- `urn:fhir:binding:TextureModifier` +- `urn:fhir:binding:TypeDerivationRule` +- `urn:fhir:binding:TypeRestfulInteraction` +- `urn:fhir:binding:UCUMUnits` +- `urn:fhir:binding:UDIEntryType` +- `urn:fhir:binding:Use` +- `urn:fhir:binding:VaccineCode` +- `urn:fhir:binding:VariableType` +- `urn:fhir:binding:VisionBase` +- `urn:fhir:binding:VisionEyes` +- `urn:fhir:binding:VisionProduct` +- `urn:fhir:binding:VisionStatus` +- `urn:fhir:binding:VitalSigns` +- `urn:fhir:binding:XPathUsageType` +- `urn:fhir:binding:appointment-type` +- `urn:fhir:binding:can-push-updates` +- `urn:fhir:binding:cancelation-reason` +- `urn:fhir:binding:chromosome-human` +- `urn:fhir:binding:communication-method` +- `urn:fhir:binding:endpoint-contype` +- `urn:fhir:binding:failure-action` +- `urn:fhir:binding:messageheader-response-request` +- `urn:fhir:binding:need` +- `urn:fhir:binding:orientationType` +- `urn:fhir:binding:primary-source-type` +- `urn:fhir:binding:push-type-available` +- `urn:fhir:binding:qualityMethod` +- `urn:fhir:binding:qualityStandardSequence` +- `urn:fhir:binding:qualityType` +- `urn:fhir:binding:repositoryType` +- `urn:fhir:binding:sequenceReference` +- `urn:fhir:binding:sequenceType` +- `urn:fhir:binding:service-category` +- `urn:fhir:binding:service-specialty` +- `urn:fhir:binding:service-type` +- `urn:fhir:binding:sopClass` +- `urn:fhir:binding:specialty` +- `urn:fhir:binding:status` +- `urn:fhir:binding:strandType` +- `urn:fhir:binding:v3Act` +- `urn:fhir:binding:validation-process` +- `urn:fhir:binding:validation-status` +- `urn:fhir:binding:validation-type` + +## Schema Collisions + +The following canonicals have multiple schema versions with different content. +To inspect collision versions, export TypeSchemas using `.introspection({ typeSchemas: 'path' })` +and check `/collisions//1.json, 2.json, ...` files. + +### `shared` + +- `urn:fhir:binding:CommunicationReason` (2 versions) + - Version 1 (auto): Communication (hl7.fhir.r4.core#4.0.1), Communication (hl7.fhir.r4.core#4.0.1) + - Version 2: CommunicationRequest (hl7.fhir.r4.core#4.0.1), CommunicationRequest (hl7.fhir.r4.core#4.0.1) +- `urn:fhir:binding:ObservationCategory` (2 versions) + - Version 1 (auto): Observation (hl7.fhir.r4.core#4.0.1), vitalsigns (hl7.fhir.r4.core#4.0.1), UKCore-Observation (fhir.r4.ukcore.stu2#2.0.2), UKCore-Observation-Group-Lab (fhir.r4.ukcore.stu2#2.0.2), UKCore-Observation-Lab (fhir.r4.ukcore.stu2#2.0.2), Observation (hl7.fhir.r4.core#4.0.1), vitalsigns (hl7.fhir.r4.core#4.0.1) + - Version 2: ObservationDefinition (hl7.fhir.r4.core#4.0.1), ObservationDefinition (hl7.fhir.r4.core#4.0.1) +- `urn:fhir:binding:ObservationRangeMeaning` (2 versions) + - Version 1 (auto): cholesterol (hl7.fhir.r4.core#4.0.1), hdlcholesterol (hl7.fhir.r4.core#4.0.1), ldlcholesterol (hl7.fhir.r4.core#4.0.1), Observation (hl7.fhir.r4.core#4.0.1), triglyceride (hl7.fhir.r4.core#4.0.1), cholesterol (hl7.fhir.r4.core#4.0.1), hdlcholesterol (hl7.fhir.r4.core#4.0.1), ldlcholesterol (hl7.fhir.r4.core#4.0.1), Observation (hl7.fhir.r4.core#4.0.1), triglyceride (hl7.fhir.r4.core#4.0.1) + - Version 2: ObservationDefinition (hl7.fhir.r4.core#4.0.1), ObservationDefinition (hl7.fhir.r4.core#4.0.1) +- `urn:fhir:binding:PaymentType` (2 versions) + - Version 1 (auto): ClaimResponse (hl7.fhir.r4.core#4.0.1), ExplanationOfBenefit (hl7.fhir.r4.core#4.0.1), ClaimResponse (hl7.fhir.r4.core#4.0.1), ExplanationOfBenefit (hl7.fhir.r4.core#4.0.1) + - Version 2: PaymentReconciliation (hl7.fhir.r4.core#4.0.1), PaymentReconciliation (hl7.fhir.r4.core#4.0.1) +- `urn:fhir:binding:ProcessPriority` (2 versions) + - Version 1 (auto): Claim (hl7.fhir.r4.core#4.0.1), CoverageEligibilityRequest (hl7.fhir.r4.core#4.0.1), Claim (hl7.fhir.r4.core#4.0.1), CoverageEligibilityRequest (hl7.fhir.r4.core#4.0.1) + - Version 2: ExplanationOfBenefit (hl7.fhir.r4.core#4.0.1), ExplanationOfBenefit (hl7.fhir.r4.core#4.0.1) +- `urn:fhir:binding:TargetDisease` (2 versions) + - Version 1 (auto): Immunization (hl7.fhir.r4.core#4.0.1), Immunization (hl7.fhir.r4.core#4.0.1) + - Version 2: ImmunizationRecommendation (hl7.fhir.r4.core#4.0.1), ImmunizationRecommendation (hl7.fhir.r4.core#4.0.1) + +### Suggested `resolveCollisions` config + +Add to `.typeSchema({ resolveCollisions: { ... } })` to resolve remaining collisions: + +```typescript +.typeSchema({ + resolveCollisions: { + "urn:fhir:binding:CommunicationReason": { + package: "hl7.fhir.r4.core#4.0.1", + canonical: "http://hl7.org/fhir/StructureDefinition/Communication", + }, + "urn:fhir:binding:ObservationCategory": { + package: "hl7.fhir.r4.core#4.0.1", + canonical: "http://hl7.org/fhir/StructureDefinition/Observation", + }, + "urn:fhir:binding:ObservationRangeMeaning": { + package: "hl7.fhir.r4.core#4.0.1", + canonical: "http://hl7.org/fhir/StructureDefinition/cholesterol", + }, + "urn:fhir:binding:PaymentType": { + package: "hl7.fhir.r4.core#4.0.1", + canonical: "http://hl7.org/fhir/StructureDefinition/ClaimResponse", + }, + "urn:fhir:binding:ProcessPriority": { + package: "hl7.fhir.r4.core#4.0.1", + canonical: "http://hl7.org/fhir/StructureDefinition/Claim", + }, + "urn:fhir:binding:TargetDisease": { + package: "hl7.fhir.r4.core#4.0.1", + canonical: "http://hl7.org/fhir/StructureDefinition/Immunization", + }, + }, +}) +``` diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/index.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/index.ts new file mode 100644 index 0000000..09303f5 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/index.ts @@ -0,0 +1 @@ +export * from "./profiles"; diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/AllergyIntolerance_UKCoreAllergyIntolerance.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/AllergyIntolerance_UKCoreAllergyIntolerance.ts new file mode 100644 index 0000000..a060691 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/AllergyIntolerance_UKCoreAllergyIntolerance.ts @@ -0,0 +1,180 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { AllergyIntolerance } from "../../hl7-fhir-r4-core/AllergyIntolerance"; +import type { CodeableConcept } from "../../hl7-fhir-r4-core/CodeableConcept"; +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; +import type { Reference } from "../../hl7-fhir-r4-core/Reference"; + +import { + ExtensionUKCoreAllergyIntoleranceEndProfile, + type ExtensionUKCoreAllergyIntoleranceEndProfileFlat, +} from "./Extension_ExtensionUKCoreAllergyIntoleranceEnd"; +import { ExtensionUKCoreEvidenceProfile } from "./Extension_ExtensionUKCoreEvidence"; + +import { + buildResource, + ensureProfile, + ensurePath, + extractComplexExtension, + isExtension, + getExtensionValue, + pushExtension, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type UKCoreAllergyIntoleranceProfileRaw = { + code: CodeableConcept<("NI" | string)>; + patient: Reference<"Patient">; +} + +// CanonicalURL: https://fhir.hl7.org.uk/StructureDefinition/UKCore-AllergyIntolerance (pkg: fhir.r4.ukcore.stu2#2.0.2) +export class UKCoreAllergyIntoleranceProfile { + static readonly canonicalUrl = "https://fhir.hl7.org.uk/StructureDefinition/UKCore-AllergyIntolerance"; + + private resource: AllergyIntolerance; + + constructor (resource: AllergyIntolerance) { + this.resource = resource; + } + + static from (resource: AllergyIntolerance) : UKCoreAllergyIntoleranceProfile { + if (!resource.meta?.profile?.includes(UKCoreAllergyIntoleranceProfile.canonicalUrl)) { + throw new Error(`UKCoreAllergyIntoleranceProfile: meta.profile must include ${UKCoreAllergyIntoleranceProfile.canonicalUrl}`) + } + const profile = new UKCoreAllergyIntoleranceProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: AllergyIntolerance) : UKCoreAllergyIntoleranceProfile { + ensureProfile(resource, UKCoreAllergyIntoleranceProfile.canonicalUrl); + return new UKCoreAllergyIntoleranceProfile(resource); + } + + static createResource (args: UKCoreAllergyIntoleranceProfileRaw) : AllergyIntolerance { + const resource = buildResource( { + resourceType: "AllergyIntolerance", + code: args.code, + patient: args.patient, + meta: { profile: [UKCoreAllergyIntoleranceProfile.canonicalUrl] }, + }) + return resource; + } + + static create (args: UKCoreAllergyIntoleranceProfileRaw) : UKCoreAllergyIntoleranceProfile { + return UKCoreAllergyIntoleranceProfile.apply(UKCoreAllergyIntoleranceProfile.createResource(args)); + } + + toResource () : AllergyIntolerance { + return this.resource; + } + + // Field accessors + getCode () : CodeableConcept<("NI" | string)> | undefined { + return this.resource.code as CodeableConcept<("NI" | string)> | undefined; + } + + setCode (value: CodeableConcept<("NI" | string)>) : this { + Object.assign(this.resource, { code: value }); + return this; + } + + getPatient () : Reference<"Patient"> | undefined { + return this.resource.patient as Reference<"Patient"> | undefined; + } + + setPatient (value: Reference<"Patient">) : this { + Object.assign(this.resource, { patient: value }); + return this; + } + + // Extensions + public setEvidence (value: ExtensionUKCoreEvidenceProfile | Extension | Reference): this { + if (value instanceof ExtensionUKCoreEvidenceProfile) { + pushExtension(this.resource, value.toResource()) + } else if (isExtension(value)) { + if (value.url !== "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-Evidence") throw new Error(`Expected extension url 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-Evidence', got '${value.url}'`) + pushExtension(this.resource, value) + } else { + pushExtension(this.resource, ExtensionUKCoreEvidenceProfile.createResource({ valueReference: value as Reference })) + } + return this + } + + public getEvidence(mode: 'flat'): Reference | undefined; + public getEvidence(mode: 'profile'): ExtensionUKCoreEvidenceProfile | undefined; + public getEvidence(mode: 'raw'): Extension | undefined; + public getEvidence(): Reference | undefined; + public getEvidence (mode: 'flat' | 'profile' | 'raw' = 'flat'): Reference | ExtensionUKCoreEvidenceProfile | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-Evidence") + if (!ext) return undefined + if (mode === 'raw') return ext + if (mode === 'profile') return ExtensionUKCoreEvidenceProfile.apply(ext) + return getExtensionValue(ext, "valueReference") + } + + public setAllergyIntoleranceEnd (input: ExtensionUKCoreAllergyIntoleranceEndProfileFlat | ExtensionUKCoreAllergyIntoleranceEndProfile | Extension): this { + if (input instanceof ExtensionUKCoreAllergyIntoleranceEndProfile) { + const target = ensurePath(this.resource as unknown as Record, ["clinicalStatus"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, input.toResource()) + } else if (isExtension(input)) { + if (input.url !== "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AllergyIntoleranceEnd") throw new Error(`Expected extension url 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AllergyIntoleranceEnd', got '${input.url}'`) + const target = ensurePath(this.resource as unknown as Record, ["clinicalStatus"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, input) + } else { + const target = ensurePath(this.resource as unknown as Record, ["clinicalStatus"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, ExtensionUKCoreAllergyIntoleranceEndProfile.createResource(input)) + } + return this + } + + public getAllergyIntoleranceEnd(mode: 'flat'): ExtensionUKCoreAllergyIntoleranceEndProfileFlat | undefined; + public getAllergyIntoleranceEnd(mode: 'profile'): ExtensionUKCoreAllergyIntoleranceEndProfile | undefined; + public getAllergyIntoleranceEnd(mode: 'raw'): Extension | undefined; + public getAllergyIntoleranceEnd(): ExtensionUKCoreAllergyIntoleranceEndProfileFlat | undefined; + public getAllergyIntoleranceEnd (mode: 'flat' | 'profile' | 'raw' = 'flat'): ExtensionUKCoreAllergyIntoleranceEndProfileFlat | ExtensionUKCoreAllergyIntoleranceEndProfile | Extension | undefined { + const target = ensurePath(this.resource as unknown as Record, ["clinicalStatus"]) + const ext = (target.extension as Extension[] | undefined)?.find(e => e.url === "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AllergyIntoleranceEnd") + if (!ext) return undefined + if (mode === 'raw') return ext + if (mode === 'profile') return ExtensionUKCoreAllergyIntoleranceEndProfile.apply(ext) + const config = [{ name: "endDate", valueField: "valueDateTime", isArray: false }, { name: "reasonEnded", valueField: "valueString", isArray: false }] + return extractComplexExtension(ext, config) + } + + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "UKCoreAllergyIntolerance" + const res = this.resource + return { + errors: [ + ...validateEnum(res, profileName, "clinicalStatus", ["active","inactive","resolved"]), + ...validateEnum(res, profileName, "verificationStatus", ["unconfirmed","confirmed","refuted","entered-in-error"]), + ...validateRequired(res, profileName, "code"), + ...validateRequired(res, profileName, "patient"), + ...validateReference(res, profileName, "patient", ["Patient"]), + ], + warnings: [ + ...validateMustSupport(res, profileName, "clinicalStatus"), + ...validateMustSupport(res, profileName, "verificationStatus"), + ...validateEnum(res, profileName, "code", ["NI"]), + ], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreAddressKey.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreAddressKey.ts new file mode 100644 index 0000000..cd6bb79 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreAddressKey.ts @@ -0,0 +1,143 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { CodeableConcept } from "../../hl7-fhir-r4-core/CodeableConcept"; +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + isRawExtensionInput, + isExtension, + getExtensionValue, + pushExtension, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type ExtensionUKCoreAddressKeyProfileRaw = { + extension?: Extension[]; +} + +export type ExtensionUKCoreAddressKeyProfileFlat = { + type: CodeableConcept; + value: string; +} + +// CanonicalURL: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey (pkg: fhir.r4.ukcore.stu2#2.0.2) +export class ExtensionUKCoreAddressKeyProfile { + static readonly canonicalUrl = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : ExtensionUKCoreAddressKeyProfile { + const profile = new ExtensionUKCoreAddressKeyProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : ExtensionUKCoreAddressKeyProfile { + return new ExtensionUKCoreAddressKeyProfile(resource); + } + + private static resolveInput (args: ExtensionUKCoreAddressKeyProfileRaw | ExtensionUKCoreAddressKeyProfileFlat) : Extension[] { + if (isRawExtensionInput(args)) { + return args.extension ?? []; + } else { + const result: Extension[] = []; + if (args.type !== undefined) { + result.push({ url: "type", valueCodeableConcept: args.type } as Extension); + } + if (args.value !== undefined) { + result.push({ url: "value", valueString: args.value } as Extension); + } + return result; + } + } + + static createResource (args?: ExtensionUKCoreAddressKeyProfileRaw | ExtensionUKCoreAddressKeyProfileFlat) : Extension { + const resolvedExtensions = ExtensionUKCoreAddressKeyProfile.resolveInput(args ?? {}); + + const resource = buildResource( { + url: "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey", + extension: resolvedExtensions, + }) + return resource; + } + + static create (args?: ExtensionUKCoreAddressKeyProfileRaw | ExtensionUKCoreAddressKeyProfileFlat) : ExtensionUKCoreAddressKeyProfile { + return ExtensionUKCoreAddressKeyProfile.apply(ExtensionUKCoreAddressKeyProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + public setType (value: CodeableConcept): this { + pushExtension(this.resource, { url: "type", valueCodeableConcept: value } as Extension) + return this + } + + public getType(mode: 'flat'): CodeableConcept | undefined; + public getType(mode: 'raw'): Extension | undefined; + public getType(): CodeableConcept | undefined; + public getType (mode: 'flat' | 'raw' = 'flat'): CodeableConcept | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "type") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue(ext, "valueCodeableConcept") + } + + public setValue (value: string): this { + pushExtension(this.resource, { url: "value", valueString: value } as Extension) + return this + } + + public getValue(mode: 'flat'): string | undefined; + public getValue(mode: 'raw'): Extension | undefined; + public getValue(): string | undefined; + public getValue (mode: 'flat' | 'raw' = 'flat'): string | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "value") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue(ext, "valueString") + } + + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "ExtensionUKCoreAddressKey" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", ExtensionUKCoreAddressKeyProfile.canonicalUrl), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreAllergyIntoleranceEnd.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreAllergyIntoleranceEnd.ts new file mode 100644 index 0000000..414128a --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreAllergyIntoleranceEnd.ts @@ -0,0 +1,142 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + isRawExtensionInput, + isExtension, + getExtensionValue, + pushExtension, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type ExtensionUKCoreAllergyIntoleranceEndProfileRaw = { + extension?: Extension[]; +} + +export type ExtensionUKCoreAllergyIntoleranceEndProfileFlat = { + endDate?: string; + reasonEnded?: string; +} + +// CanonicalURL: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AllergyIntoleranceEnd (pkg: fhir.r4.ukcore.stu2#2.0.2) +export class ExtensionUKCoreAllergyIntoleranceEndProfile { + static readonly canonicalUrl = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AllergyIntoleranceEnd"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : ExtensionUKCoreAllergyIntoleranceEndProfile { + const profile = new ExtensionUKCoreAllergyIntoleranceEndProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : ExtensionUKCoreAllergyIntoleranceEndProfile { + return new ExtensionUKCoreAllergyIntoleranceEndProfile(resource); + } + + private static resolveInput (args: ExtensionUKCoreAllergyIntoleranceEndProfileRaw | ExtensionUKCoreAllergyIntoleranceEndProfileFlat) : Extension[] { + if (isRawExtensionInput(args)) { + return args.extension ?? []; + } else { + const result: Extension[] = []; + if (args.endDate !== undefined) { + result.push({ url: "endDate", valueDateTime: args.endDate } as Extension); + } + if (args.reasonEnded !== undefined) { + result.push({ url: "reasonEnded", valueString: args.reasonEnded } as Extension); + } + return result; + } + } + + static createResource (args?: ExtensionUKCoreAllergyIntoleranceEndProfileRaw | ExtensionUKCoreAllergyIntoleranceEndProfileFlat) : Extension { + const resolvedExtensions = ExtensionUKCoreAllergyIntoleranceEndProfile.resolveInput(args ?? {}); + + const resource = buildResource( { + url: "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AllergyIntoleranceEnd", + extension: resolvedExtensions, + }) + return resource; + } + + static create (args?: ExtensionUKCoreAllergyIntoleranceEndProfileRaw | ExtensionUKCoreAllergyIntoleranceEndProfileFlat) : ExtensionUKCoreAllergyIntoleranceEndProfile { + return ExtensionUKCoreAllergyIntoleranceEndProfile.apply(ExtensionUKCoreAllergyIntoleranceEndProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + public setEndDate (value: string): this { + pushExtension(this.resource, { url: "endDate", valueDateTime: value } as Extension) + return this + } + + public getEndDate(mode: 'flat'): string | undefined; + public getEndDate(mode: 'raw'): Extension | undefined; + public getEndDate(): string | undefined; + public getEndDate (mode: 'flat' | 'raw' = 'flat'): string | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "endDate") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue(ext, "valueDateTime") + } + + public setReasonEnded (value: string): this { + pushExtension(this.resource, { url: "reasonEnded", valueString: value } as Extension) + return this + } + + public getReasonEnded(mode: 'flat'): string | undefined; + public getReasonEnded(mode: 'raw'): Extension | undefined; + public getReasonEnded(): string | undefined; + public getReasonEnded (mode: 'flat' | 'raw' = 'flat'): string | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "reasonEnded") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue(ext, "valueString") + } + + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "ExtensionUKCoreAllergyIntoleranceEnd" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", ExtensionUKCoreAllergyIntoleranceEndProfile.canonicalUrl), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreBirthSex.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreBirthSex.ts new file mode 100644 index 0000000..c342e73 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreBirthSex.ts @@ -0,0 +1,97 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { CodeableConcept } from "../../hl7-fhir-r4-core/CodeableConcept"; +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type ExtensionUKCoreBirthSexProfileRaw = { + valueCodeableConcept: CodeableConcept; +} + +// CanonicalURL: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BirthSex (pkg: fhir.r4.ukcore.stu2#2.0.2) +export class ExtensionUKCoreBirthSexProfile { + static readonly canonicalUrl = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BirthSex"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : ExtensionUKCoreBirthSexProfile { + const profile = new ExtensionUKCoreBirthSexProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : ExtensionUKCoreBirthSexProfile { + return new ExtensionUKCoreBirthSexProfile(resource); + } + + static createResource (args: ExtensionUKCoreBirthSexProfileRaw) : Extension { + const resource = buildResource( { + url: "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BirthSex", + valueCodeableConcept: args.valueCodeableConcept, + }) + return resource; + } + + static create (args: ExtensionUKCoreBirthSexProfileRaw) : ExtensionUKCoreBirthSexProfile { + return ExtensionUKCoreBirthSexProfile.apply(ExtensionUKCoreBirthSexProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getValueCodeableConcept () : CodeableConcept | undefined { + return this.resource.valueCodeableConcept as CodeableConcept | undefined; + } + + setValueCodeableConcept (value: CodeableConcept) : this { + Object.assign(this.resource, { valueCodeableConcept: value }); + return this; + } + + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "ExtensionUKCoreBirthSex" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", ExtensionUKCoreBirthSexProfile.canonicalUrl), + ...validateChoiceRequired(res, profileName, ["valueCodeableConcept"]), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreContactPreference.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreContactPreference.ts new file mode 100644 index 0000000..85162a7 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreContactPreference.ts @@ -0,0 +1,162 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { CodeableConcept } from "../../hl7-fhir-r4-core/CodeableConcept"; +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + isRawExtensionInput, + isExtension, + getExtensionValue, + pushExtension, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type ExtensionUKCoreContactPreferenceProfileRaw = { + extension?: Extension[]; +} + +export type ExtensionUKCoreContactPreferenceProfileFlat = { + preferredContactMethod?: CodeableConcept; + preferredContactTimes?: string; + preferredWrittenCommunicationFormat?: CodeableConcept; +} + +// CanonicalURL: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactPreference (pkg: fhir.r4.ukcore.stu2#2.0.2) +export class ExtensionUKCoreContactPreferenceProfile { + static readonly canonicalUrl = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactPreference"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : ExtensionUKCoreContactPreferenceProfile { + const profile = new ExtensionUKCoreContactPreferenceProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : ExtensionUKCoreContactPreferenceProfile { + return new ExtensionUKCoreContactPreferenceProfile(resource); + } + + private static resolveInput (args: ExtensionUKCoreContactPreferenceProfileRaw | ExtensionUKCoreContactPreferenceProfileFlat) : Extension[] { + if (isRawExtensionInput(args)) { + return args.extension ?? []; + } else { + const result: Extension[] = []; + if (args.preferredContactMethod !== undefined) { + result.push({ url: "PreferredContactMethod", valueCodeableConcept: args.preferredContactMethod } as Extension); + } + if (args.preferredContactTimes !== undefined) { + result.push({ url: "PreferredContactTimes", valueString: args.preferredContactTimes } as Extension); + } + if (args.preferredWrittenCommunicationFormat !== undefined) { + result.push({ url: "PreferredWrittenCommunicationFormat", valueCodeableConcept: args.preferredWrittenCommunicationFormat } as Extension); + } + return result; + } + } + + static createResource (args?: ExtensionUKCoreContactPreferenceProfileRaw | ExtensionUKCoreContactPreferenceProfileFlat) : Extension { + const resolvedExtensions = ExtensionUKCoreContactPreferenceProfile.resolveInput(args ?? {}); + + const resource = buildResource( { + url: "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactPreference", + extension: resolvedExtensions, + }) + return resource; + } + + static create (args?: ExtensionUKCoreContactPreferenceProfileRaw | ExtensionUKCoreContactPreferenceProfileFlat) : ExtensionUKCoreContactPreferenceProfile { + return ExtensionUKCoreContactPreferenceProfile.apply(ExtensionUKCoreContactPreferenceProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + public setPreferredContactMethod (value: CodeableConcept): this { + pushExtension(this.resource, { url: "PreferredContactMethod", valueCodeableConcept: value } as Extension) + return this + } + + public getPreferredContactMethod(mode: 'flat'): CodeableConcept | undefined; + public getPreferredContactMethod(mode: 'raw'): Extension | undefined; + public getPreferredContactMethod(): CodeableConcept | undefined; + public getPreferredContactMethod (mode: 'flat' | 'raw' = 'flat'): CodeableConcept | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "PreferredContactMethod") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue(ext, "valueCodeableConcept") + } + + public setPreferredContactTimes (value: string): this { + pushExtension(this.resource, { url: "PreferredContactTimes", valueString: value } as Extension) + return this + } + + public getPreferredContactTimes(mode: 'flat'): string | undefined; + public getPreferredContactTimes(mode: 'raw'): Extension | undefined; + public getPreferredContactTimes(): string | undefined; + public getPreferredContactTimes (mode: 'flat' | 'raw' = 'flat'): string | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "PreferredContactTimes") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue(ext, "valueString") + } + + public setPreferredWrittenCommunicationFormat (value: CodeableConcept): this { + pushExtension(this.resource, { url: "PreferredWrittenCommunicationFormat", valueCodeableConcept: value } as Extension) + return this + } + + public getPreferredWrittenCommunicationFormat(mode: 'flat'): CodeableConcept | undefined; + public getPreferredWrittenCommunicationFormat(mode: 'raw'): Extension | undefined; + public getPreferredWrittenCommunicationFormat(): CodeableConcept | undefined; + public getPreferredWrittenCommunicationFormat (mode: 'flat' | 'raw' = 'flat'): CodeableConcept | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "PreferredWrittenCommunicationFormat") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue(ext, "valueCodeableConcept") + } + + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "ExtensionUKCoreContactPreference" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", ExtensionUKCoreContactPreferenceProfile.canonicalUrl), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreContactRank.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreContactRank.ts new file mode 100644 index 0000000..8b60a90 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreContactRank.ts @@ -0,0 +1,96 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type ExtensionUKCoreContactRankProfileRaw = { + valuePositiveInt: number; +} + +// CanonicalURL: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactRank (pkg: fhir.r4.ukcore.stu2#2.0.2) +export class ExtensionUKCoreContactRankProfile { + static readonly canonicalUrl = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactRank"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : ExtensionUKCoreContactRankProfile { + const profile = new ExtensionUKCoreContactRankProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : ExtensionUKCoreContactRankProfile { + return new ExtensionUKCoreContactRankProfile(resource); + } + + static createResource (args: ExtensionUKCoreContactRankProfileRaw) : Extension { + const resource = buildResource( { + url: "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactRank", + valuePositiveInt: args.valuePositiveInt, + }) + return resource; + } + + static create (args: ExtensionUKCoreContactRankProfileRaw) : ExtensionUKCoreContactRankProfile { + return ExtensionUKCoreContactRankProfile.apply(ExtensionUKCoreContactRankProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getValuePositiveInt () : number | undefined { + return this.resource.valuePositiveInt as number | undefined; + } + + setValuePositiveInt (value: number) : this { + Object.assign(this.resource, { valuePositiveInt: value }); + return this; + } + + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "ExtensionUKCoreContactRank" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", ExtensionUKCoreContactRankProfile.canonicalUrl), + ...validateChoiceRequired(res, profileName, ["valuePositiveInt"]), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreCopyCorrespondenceIndicator.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreCopyCorrespondenceIndicator.ts new file mode 100644 index 0000000..3d902a3 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreCopyCorrespondenceIndicator.ts @@ -0,0 +1,96 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type ExtensionUKCoreCopyCorrespondenceIndicatorProfileRaw = { + valueBoolean: boolean; +} + +// CanonicalURL: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-CopyCorrespondenceIndicator (pkg: fhir.r4.ukcore.stu2#2.0.2) +export class ExtensionUKCoreCopyCorrespondenceIndicatorProfile { + static readonly canonicalUrl = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-CopyCorrespondenceIndicator"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : ExtensionUKCoreCopyCorrespondenceIndicatorProfile { + const profile = new ExtensionUKCoreCopyCorrespondenceIndicatorProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : ExtensionUKCoreCopyCorrespondenceIndicatorProfile { + return new ExtensionUKCoreCopyCorrespondenceIndicatorProfile(resource); + } + + static createResource (args: ExtensionUKCoreCopyCorrespondenceIndicatorProfileRaw) : Extension { + const resource = buildResource( { + url: "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-CopyCorrespondenceIndicator", + valueBoolean: args.valueBoolean, + }) + return resource; + } + + static create (args: ExtensionUKCoreCopyCorrespondenceIndicatorProfileRaw) : ExtensionUKCoreCopyCorrespondenceIndicatorProfile { + return ExtensionUKCoreCopyCorrespondenceIndicatorProfile.apply(ExtensionUKCoreCopyCorrespondenceIndicatorProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getValueBoolean () : boolean | undefined { + return this.resource.valueBoolean as boolean | undefined; + } + + setValueBoolean (value: boolean) : this { + Object.assign(this.resource, { valueBoolean: value }); + return this; + } + + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "ExtensionUKCoreCopyCorrespondenceIndicator" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", ExtensionUKCoreCopyCorrespondenceIndicatorProfile.canonicalUrl), + ...validateChoiceRequired(res, profileName, ["valueBoolean"]), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreDeathNotificationStatus.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreDeathNotificationStatus.ts new file mode 100644 index 0000000..9eee4b8 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreDeathNotificationStatus.ts @@ -0,0 +1,153 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { CodeableConcept } from "../../hl7-fhir-r4-core/CodeableConcept"; +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + isRawExtensionInput, + isExtension, + getExtensionValue, + pushExtension, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type ExtensionUKCoreDeathNotificationStatusProfileRaw = { + extension: Extension[]; +} + +export type ExtensionUKCoreDeathNotificationStatusProfileFlat = { + deathNotificationStatus: CodeableConcept; + systemEffectiveDate?: string; +} + +// CanonicalURL: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus (pkg: fhir.r4.ukcore.stu2#2.0.2) +export class ExtensionUKCoreDeathNotificationStatusProfile { + static readonly canonicalUrl = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : ExtensionUKCoreDeathNotificationStatusProfile { + const profile = new ExtensionUKCoreDeathNotificationStatusProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : ExtensionUKCoreDeathNotificationStatusProfile { + return new ExtensionUKCoreDeathNotificationStatusProfile(resource); + } + + private static resolveInput (args: ExtensionUKCoreDeathNotificationStatusProfileRaw | ExtensionUKCoreDeathNotificationStatusProfileFlat) : Extension[] { + if (isRawExtensionInput(args)) { + return args.extension ?? []; + } else { + const result: Extension[] = []; + if (args.deathNotificationStatus !== undefined) { + result.push({ url: "deathNotificationStatus", valueCodeableConcept: args.deathNotificationStatus } as Extension); + } + if (args.systemEffectiveDate !== undefined) { + result.push({ url: "systemEffectiveDate", valueDateTime: args.systemEffectiveDate } as Extension); + } + return result; + } + } + + static createResource (args: ExtensionUKCoreDeathNotificationStatusProfileRaw | ExtensionUKCoreDeathNotificationStatusProfileFlat) : Extension { + const resolvedExtensions = ExtensionUKCoreDeathNotificationStatusProfile.resolveInput(args ?? {}); + + const resource = buildResource( { + url: "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus", + extension: resolvedExtensions, + }) + return resource; + } + + static create (args: ExtensionUKCoreDeathNotificationStatusProfileRaw | ExtensionUKCoreDeathNotificationStatusProfileFlat) : ExtensionUKCoreDeathNotificationStatusProfile { + return ExtensionUKCoreDeathNotificationStatusProfile.apply(ExtensionUKCoreDeathNotificationStatusProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getExtension () : Extension[] | undefined { + return this.resource.extension as Extension[] | undefined; + } + + setExtension (value: Extension[]) : this { + Object.assign(this.resource, { extension: value }); + return this; + } + + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + public setDeathNotificationStatus (value: CodeableConcept): this { + pushExtension(this.resource, { url: "deathNotificationStatus", valueCodeableConcept: value } as Extension) + return this + } + + public getDeathNotificationStatus(mode: 'flat'): CodeableConcept | undefined; + public getDeathNotificationStatus(mode: 'raw'): Extension | undefined; + public getDeathNotificationStatus(): CodeableConcept | undefined; + public getDeathNotificationStatus (mode: 'flat' | 'raw' = 'flat'): CodeableConcept | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "deathNotificationStatus") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue(ext, "valueCodeableConcept") + } + + public setSystemEffectiveDate (value: string): this { + pushExtension(this.resource, { url: "systemEffectiveDate", valueDateTime: value } as Extension) + return this + } + + public getSystemEffectiveDate(mode: 'flat'): string | undefined; + public getSystemEffectiveDate(mode: 'raw'): Extension | undefined; + public getSystemEffectiveDate(): string | undefined; + public getSystemEffectiveDate (mode: 'flat' | 'raw' = 'flat'): string | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "systemEffectiveDate") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue(ext, "valueDateTime") + } + + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "ExtensionUKCoreDeathNotificationStatus" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "extension"), + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", ExtensionUKCoreDeathNotificationStatusProfile.canonicalUrl), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreEthnicCategory.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreEthnicCategory.ts new file mode 100644 index 0000000..afcfadc --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreEthnicCategory.ts @@ -0,0 +1,97 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { CodeableConcept } from "../../hl7-fhir-r4-core/CodeableConcept"; +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type ExtensionUKCoreEthnicCategoryProfileRaw = { + valueCodeableConcept: CodeableConcept; +} + +// CanonicalURL: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory (pkg: fhir.r4.ukcore.stu2#2.0.2) +export class ExtensionUKCoreEthnicCategoryProfile { + static readonly canonicalUrl = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : ExtensionUKCoreEthnicCategoryProfile { + const profile = new ExtensionUKCoreEthnicCategoryProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : ExtensionUKCoreEthnicCategoryProfile { + return new ExtensionUKCoreEthnicCategoryProfile(resource); + } + + static createResource (args: ExtensionUKCoreEthnicCategoryProfileRaw) : Extension { + const resource = buildResource( { + url: "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory", + valueCodeableConcept: args.valueCodeableConcept, + }) + return resource; + } + + static create (args: ExtensionUKCoreEthnicCategoryProfileRaw) : ExtensionUKCoreEthnicCategoryProfile { + return ExtensionUKCoreEthnicCategoryProfile.apply(ExtensionUKCoreEthnicCategoryProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getValueCodeableConcept () : CodeableConcept | undefined { + return this.resource.valueCodeableConcept as CodeableConcept | undefined; + } + + setValueCodeableConcept (value: CodeableConcept) : this { + Object.assign(this.resource, { valueCodeableConcept: value }); + return this; + } + + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "ExtensionUKCoreEthnicCategory" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", ExtensionUKCoreEthnicCategoryProfile.canonicalUrl), + ...validateChoiceRequired(res, profileName, ["valueCodeableConcept"]), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreEvidence.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreEvidence.ts new file mode 100644 index 0000000..cfddad9 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreEvidence.ts @@ -0,0 +1,97 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; +import type { Reference } from "../../hl7-fhir-r4-core/Reference"; + +import { + buildResource, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type ExtensionUKCoreEvidenceProfileRaw = { + valueReference: Reference; +} + +// CanonicalURL: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-Evidence (pkg: fhir.r4.ukcore.stu2#2.0.2) +export class ExtensionUKCoreEvidenceProfile { + static readonly canonicalUrl = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-Evidence"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : ExtensionUKCoreEvidenceProfile { + const profile = new ExtensionUKCoreEvidenceProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : ExtensionUKCoreEvidenceProfile { + return new ExtensionUKCoreEvidenceProfile(resource); + } + + static createResource (args: ExtensionUKCoreEvidenceProfileRaw) : Extension { + const resource = buildResource( { + url: "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-Evidence", + valueReference: args.valueReference, + }) + return resource; + } + + static create (args: ExtensionUKCoreEvidenceProfileRaw) : ExtensionUKCoreEvidenceProfile { + return ExtensionUKCoreEvidenceProfile.apply(ExtensionUKCoreEvidenceProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getValueReference () : Reference | undefined { + return this.resource.valueReference as Reference | undefined; + } + + setValueReference (value: Reference) : this { + Object.assign(this.resource, { valueReference: value }); + return this; + } + + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "ExtensionUKCoreEvidence" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", ExtensionUKCoreEvidenceProfile.canonicalUrl), + ...validateChoiceRequired(res, profileName, ["valueReference"]), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreNHSNumberUnavailableReason.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreNHSNumberUnavailableReason.ts new file mode 100644 index 0000000..72ee41e --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreNHSNumberUnavailableReason.ts @@ -0,0 +1,97 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { CodeableConcept } from "../../hl7-fhir-r4-core/CodeableConcept"; +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type ExtensionUKCoreNHSNumberUnavailableReasonProfileRaw = { + valueCodeableConcept: CodeableConcept; +} + +// CanonicalURL: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberUnavailableReason (pkg: fhir.r4.ukcore.stu2#2.0.2) +export class ExtensionUKCoreNHSNumberUnavailableReasonProfile { + static readonly canonicalUrl = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberUnavailableReason"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : ExtensionUKCoreNHSNumberUnavailableReasonProfile { + const profile = new ExtensionUKCoreNHSNumberUnavailableReasonProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : ExtensionUKCoreNHSNumberUnavailableReasonProfile { + return new ExtensionUKCoreNHSNumberUnavailableReasonProfile(resource); + } + + static createResource (args: ExtensionUKCoreNHSNumberUnavailableReasonProfileRaw) : Extension { + const resource = buildResource( { + url: "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberUnavailableReason", + valueCodeableConcept: args.valueCodeableConcept, + }) + return resource; + } + + static create (args: ExtensionUKCoreNHSNumberUnavailableReasonProfileRaw) : ExtensionUKCoreNHSNumberUnavailableReasonProfile { + return ExtensionUKCoreNHSNumberUnavailableReasonProfile.apply(ExtensionUKCoreNHSNumberUnavailableReasonProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getValueCodeableConcept () : CodeableConcept | undefined { + return this.resource.valueCodeableConcept as CodeableConcept | undefined; + } + + setValueCodeableConcept (value: CodeableConcept) : this { + Object.assign(this.resource, { valueCodeableConcept: value }); + return this; + } + + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "ExtensionUKCoreNHSNumberUnavailableReason" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", ExtensionUKCoreNHSNumberUnavailableReasonProfile.canonicalUrl), + ...validateChoiceRequired(res, profileName, ["valueCodeableConcept"]), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreOtherContactSystem.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreOtherContactSystem.ts new file mode 100644 index 0000000..ded0533 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreOtherContactSystem.ts @@ -0,0 +1,97 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { CodeableConcept } from "../../hl7-fhir-r4-core/CodeableConcept"; +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type ExtensionUKCoreOtherContactSystemProfileRaw = { + valueCodeableConcept: CodeableConcept; +} + +// CanonicalURL: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-OtherContactSystem (pkg: fhir.r4.ukcore.stu2#2.0.2) +export class ExtensionUKCoreOtherContactSystemProfile { + static readonly canonicalUrl = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-OtherContactSystem"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : ExtensionUKCoreOtherContactSystemProfile { + const profile = new ExtensionUKCoreOtherContactSystemProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : ExtensionUKCoreOtherContactSystemProfile { + return new ExtensionUKCoreOtherContactSystemProfile(resource); + } + + static createResource (args: ExtensionUKCoreOtherContactSystemProfileRaw) : Extension { + const resource = buildResource( { + url: "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-OtherContactSystem", + valueCodeableConcept: args.valueCodeableConcept, + }) + return resource; + } + + static create (args: ExtensionUKCoreOtherContactSystemProfileRaw) : ExtensionUKCoreOtherContactSystemProfile { + return ExtensionUKCoreOtherContactSystemProfile.apply(ExtensionUKCoreOtherContactSystemProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getValueCodeableConcept () : CodeableConcept | undefined { + return this.resource.valueCodeableConcept as CodeableConcept | undefined; + } + + setValueCodeableConcept (value: CodeableConcept) : this { + Object.assign(this.resource, { valueCodeableConcept: value }); + return this; + } + + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "ExtensionUKCoreOtherContactSystem" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", ExtensionUKCoreOtherContactSystemProfile.canonicalUrl), + ...validateChoiceRequired(res, profileName, ["valueCodeableConcept"]), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreResidentialStatus.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreResidentialStatus.ts new file mode 100644 index 0000000..81b9707 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Extension_ExtensionUKCoreResidentialStatus.ts @@ -0,0 +1,97 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { CodeableConcept } from "../../hl7-fhir-r4-core/CodeableConcept"; +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type ExtensionUKCoreResidentialStatusProfileRaw = { + valueCodeableConcept: CodeableConcept; +} + +// CanonicalURL: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ResidentialStatus (pkg: fhir.r4.ukcore.stu2#2.0.2) +export class ExtensionUKCoreResidentialStatusProfile { + static readonly canonicalUrl = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ResidentialStatus"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : ExtensionUKCoreResidentialStatusProfile { + const profile = new ExtensionUKCoreResidentialStatusProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : ExtensionUKCoreResidentialStatusProfile { + return new ExtensionUKCoreResidentialStatusProfile(resource); + } + + static createResource (args: ExtensionUKCoreResidentialStatusProfileRaw) : Extension { + const resource = buildResource( { + url: "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ResidentialStatus", + valueCodeableConcept: args.valueCodeableConcept, + }) + return resource; + } + + static create (args: ExtensionUKCoreResidentialStatusProfileRaw) : ExtensionUKCoreResidentialStatusProfile { + return ExtensionUKCoreResidentialStatusProfile.apply(ExtensionUKCoreResidentialStatusProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getValueCodeableConcept () : CodeableConcept | undefined { + return this.resource.valueCodeableConcept as CodeableConcept | undefined; + } + + setValueCodeableConcept (value: CodeableConcept) : this { + Object.assign(this.resource, { valueCodeableConcept: value }); + return this; + } + + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "ExtensionUKCoreResidentialStatus" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", ExtensionUKCoreResidentialStatusProfile.canonicalUrl), + ...validateChoiceRequired(res, profileName, ["valueCodeableConcept"]), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Patient_UKCorePatient.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Patient_UKCorePatient.ts new file mode 100644 index 0000000..b4f69be --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/Patient_UKCorePatient.ts @@ -0,0 +1,549 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Address } from "../../hl7-fhir-r4-core/Address"; +import type { CodeableConcept } from "../../hl7-fhir-r4-core/CodeableConcept"; +import type { Coding } from "../../hl7-fhir-r4-core/Coding"; +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; +import type { Identifier } from "../../hl7-fhir-r4-core/Identifier"; +import type { Patient } from "../../hl7-fhir-r4-core/Patient"; + +import { + ExtensionUKCoreAddressKeyProfile, + type ExtensionUKCoreAddressKeyProfileFlat, +} from "./Extension_ExtensionUKCoreAddressKey"; +import { ExtensionUKCoreBirthSexProfile } from "./Extension_ExtensionUKCoreBirthSex"; +import { + ExtensionUKCoreContactPreferenceProfile, + type ExtensionUKCoreContactPreferenceProfileFlat, +} from "./Extension_ExtensionUKCoreContactPreference"; +import { ExtensionUKCoreContactRankProfile } from "./Extension_ExtensionUKCoreContactRank"; +import { + ExtensionUKCoreCopyCorrespondenceIndicatorProfile, +} from "./Extension_ExtensionUKCoreCopyCorrespondenceIndicator"; +import { + ExtensionUKCoreDeathNotificationStatusProfile, + type ExtensionUKCoreDeathNotificationStatusProfileFlat, +} from "./Extension_ExtensionUKCoreDeathNotificationStatus"; +import { ExtensionUKCoreEthnicCategoryProfile } from "./Extension_ExtensionUKCoreEthnicCategory"; +import { ExtensionUKCoreNHSNumberUnavailableReasonProfile } from "./Extension_ExtensionUKCoreNHSNumberUnavailableReason"; +import { ExtensionUKCoreOtherContactSystemProfile } from "./Extension_ExtensionUKCoreOtherContactSystem"; +import { ExtensionUKCoreResidentialStatusProfile } from "./Extension_ExtensionUKCoreResidentialStatus"; + +export type UKCorePatient_ProficiencyFlat = { + level?: Coding; + type?: Coding[]; +} + +export type UKCorePatient_Identifier_NhsNumberSliceFlat = Omit & Required>; + +import { + buildResource, + ensureProfile, + applySliceMatch, + matchesValue, + setArraySlice, + getArraySlice, + ensureSliceDefaults, + ensurePath, + extractComplexExtension, + stripMatchKeys, + isExtension, + getExtensionValue, + pushExtension, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +// CanonicalURL: https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient (pkg: fhir.r4.ukcore.stu2#2.0.2) +export class UKCorePatientProfile { + static readonly canonicalUrl = "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient"; + + private static readonly nhsNumberSliceMatch: Record = {"system":"https://fhir.nhs.uk/Id/nhs-number"}; + + private resource: Patient; + + constructor (resource: Patient) { + this.resource = resource; + } + + static from (resource: Patient) : UKCorePatientProfile { + if (!resource.meta?.profile?.includes(UKCorePatientProfile.canonicalUrl)) { + throw new Error(`UKCorePatientProfile: meta.profile must include ${UKCorePatientProfile.canonicalUrl}`) + } + const profile = new UKCorePatientProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Patient) : UKCorePatientProfile { + ensureProfile(resource, UKCorePatientProfile.canonicalUrl); + return new UKCorePatientProfile(resource); + } + + static createResource () : Patient { + const resource = buildResource( { + resourceType: "Patient", + meta: { profile: [UKCorePatientProfile.canonicalUrl] }, + }) + return resource; + } + + static create () : UKCorePatientProfile { + return UKCorePatientProfile.apply(UKCorePatientProfile.createResource()); + } + + toResource () : Patient { + return this.resource; + } + + // Field accessors + // Extensions + public setBirthPlace (value: Address): this { + pushExtension(this.resource, { url: "http://hl7.org/fhir/StructureDefinition/patient-birthPlace", valueAddress: value } as Extension) + return this + } + + public getBirthPlace(mode: 'flat'): Address | undefined; + public getBirthPlace(mode: 'raw'): Extension | undefined; + public getBirthPlace(): Address | undefined; + public getBirthPlace (mode: 'flat' | 'raw' = 'flat'): Address | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "http://hl7.org/fhir/StructureDefinition/patient-birthPlace") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue
(ext, "valueAddress") + } + + public setBirthSex (value: ExtensionUKCoreBirthSexProfile | Extension | CodeableConcept): this { + if (value instanceof ExtensionUKCoreBirthSexProfile) { + pushExtension(this.resource, value.toResource()) + } else if (isExtension(value)) { + if (value.url !== "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BirthSex") throw new Error(`Expected extension url 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BirthSex', got '${value.url}'`) + pushExtension(this.resource, value) + } else { + pushExtension(this.resource, ExtensionUKCoreBirthSexProfile.createResource({ valueCodeableConcept: value as CodeableConcept })) + } + return this + } + + public getBirthSex(mode: 'flat'): CodeableConcept | undefined; + public getBirthSex(mode: 'profile'): ExtensionUKCoreBirthSexProfile | undefined; + public getBirthSex(mode: 'raw'): Extension | undefined; + public getBirthSex(): CodeableConcept | undefined; + public getBirthSex (mode: 'flat' | 'profile' | 'raw' = 'flat'): CodeableConcept | ExtensionUKCoreBirthSexProfile | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BirthSex") + if (!ext) return undefined + if (mode === 'raw') return ext + if (mode === 'profile') return ExtensionUKCoreBirthSexProfile.apply(ext) + return getExtensionValue(ext, "valueCodeableConcept") + } + + public setCadavericDonor (value: boolean): this { + pushExtension(this.resource, { url: "http://hl7.org/fhir/StructureDefinition/patient-cadavericDonor", valueBoolean: value } as Extension) + return this + } + + public getCadavericDonor(mode: 'flat'): boolean | undefined; + public getCadavericDonor(mode: 'raw'): Extension | undefined; + public getCadavericDonor(): boolean | undefined; + public getCadavericDonor (mode: 'flat' | 'raw' = 'flat'): boolean | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "http://hl7.org/fhir/StructureDefinition/patient-cadavericDonor") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue(ext, "valueBoolean") + } + + public setContactPreference (input: ExtensionUKCoreContactPreferenceProfileFlat | ExtensionUKCoreContactPreferenceProfile | Extension): this { + if (input instanceof ExtensionUKCoreContactPreferenceProfile) { + pushExtension(this.resource, input.toResource()) + } else if (isExtension(input)) { + if (input.url !== "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactPreference") throw new Error(`Expected extension url 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactPreference', got '${input.url}'`) + pushExtension(this.resource, input) + } else { + pushExtension(this.resource, ExtensionUKCoreContactPreferenceProfile.createResource(input)) + } + return this + } + + public getContactPreference(mode: 'flat'): ExtensionUKCoreContactPreferenceProfileFlat | undefined; + public getContactPreference(mode: 'profile'): ExtensionUKCoreContactPreferenceProfile | undefined; + public getContactPreference(mode: 'raw'): Extension | undefined; + public getContactPreference(): ExtensionUKCoreContactPreferenceProfileFlat | undefined; + public getContactPreference (mode: 'flat' | 'profile' | 'raw' = 'flat'): ExtensionUKCoreContactPreferenceProfileFlat | ExtensionUKCoreContactPreferenceProfile | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactPreference") + if (!ext) return undefined + if (mode === 'raw') return ext + if (mode === 'profile') return ExtensionUKCoreContactPreferenceProfile.apply(ext) + const config = [{ name: "PreferredContactMethod", valueField: "valueCodeableConcept", isArray: false }, { name: "PreferredContactTimes", valueField: "valueString", isArray: false }, { name: "PreferredWrittenCommunicationFormat", valueField: "valueCodeableConcept", isArray: false }] + return extractComplexExtension(ext, config) + } + + public setDeathNotificationStatus (input: ExtensionUKCoreDeathNotificationStatusProfileFlat | ExtensionUKCoreDeathNotificationStatusProfile | Extension): this { + if (input instanceof ExtensionUKCoreDeathNotificationStatusProfile) { + pushExtension(this.resource, input.toResource()) + } else if (isExtension(input)) { + if (input.url !== "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus") throw new Error(`Expected extension url 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus', got '${input.url}'`) + pushExtension(this.resource, input) + } else { + pushExtension(this.resource, ExtensionUKCoreDeathNotificationStatusProfile.createResource(input)) + } + return this + } + + public getDeathNotificationStatus(mode: 'flat'): ExtensionUKCoreDeathNotificationStatusProfileFlat | undefined; + public getDeathNotificationStatus(mode: 'profile'): ExtensionUKCoreDeathNotificationStatusProfile | undefined; + public getDeathNotificationStatus(mode: 'raw'): Extension | undefined; + public getDeathNotificationStatus(): ExtensionUKCoreDeathNotificationStatusProfileFlat | undefined; + public getDeathNotificationStatus (mode: 'flat' | 'profile' | 'raw' = 'flat'): ExtensionUKCoreDeathNotificationStatusProfileFlat | ExtensionUKCoreDeathNotificationStatusProfile | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus") + if (!ext) return undefined + if (mode === 'raw') return ext + if (mode === 'profile') return ExtensionUKCoreDeathNotificationStatusProfile.apply(ext) + const config = [{ name: "deathNotificationStatus", valueField: "valueCodeableConcept", isArray: false }, { name: "systemEffectiveDate", valueField: "valueDateTime", isArray: false }] + return extractComplexExtension(ext, config) + } + + public setEthnicCategory (value: ExtensionUKCoreEthnicCategoryProfile | Extension | CodeableConcept): this { + if (value instanceof ExtensionUKCoreEthnicCategoryProfile) { + pushExtension(this.resource, value.toResource()) + } else if (isExtension(value)) { + if (value.url !== "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory") throw new Error(`Expected extension url 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory', got '${value.url}'`) + pushExtension(this.resource, value) + } else { + pushExtension(this.resource, ExtensionUKCoreEthnicCategoryProfile.createResource({ valueCodeableConcept: value as CodeableConcept })) + } + return this + } + + public getEthnicCategory(mode: 'flat'): CodeableConcept | undefined; + public getEthnicCategory(mode: 'profile'): ExtensionUKCoreEthnicCategoryProfile | undefined; + public getEthnicCategory(mode: 'raw'): Extension | undefined; + public getEthnicCategory(): CodeableConcept | undefined; + public getEthnicCategory (mode: 'flat' | 'profile' | 'raw' = 'flat'): CodeableConcept | ExtensionUKCoreEthnicCategoryProfile | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory") + if (!ext) return undefined + if (mode === 'raw') return ext + if (mode === 'profile') return ExtensionUKCoreEthnicCategoryProfile.apply(ext) + return getExtensionValue(ext, "valueCodeableConcept") + } + + public setResidentialStatus (value: ExtensionUKCoreResidentialStatusProfile | Extension | CodeableConcept): this { + if (value instanceof ExtensionUKCoreResidentialStatusProfile) { + pushExtension(this.resource, value.toResource()) + } else if (isExtension(value)) { + if (value.url !== "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ResidentialStatus") throw new Error(`Expected extension url 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ResidentialStatus', got '${value.url}'`) + pushExtension(this.resource, value) + } else { + pushExtension(this.resource, ExtensionUKCoreResidentialStatusProfile.createResource({ valueCodeableConcept: value as CodeableConcept })) + } + return this + } + + public getResidentialStatus(mode: 'flat'): CodeableConcept | undefined; + public getResidentialStatus(mode: 'profile'): ExtensionUKCoreResidentialStatusProfile | undefined; + public getResidentialStatus(mode: 'raw'): Extension | undefined; + public getResidentialStatus(): CodeableConcept | undefined; + public getResidentialStatus (mode: 'flat' | 'profile' | 'raw' = 'flat'): CodeableConcept | ExtensionUKCoreResidentialStatusProfile | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ResidentialStatus") + if (!ext) return undefined + if (mode === 'raw') return ext + if (mode === 'profile') return ExtensionUKCoreResidentialStatusProfile.apply(ext) + return getExtensionValue(ext, "valueCodeableConcept") + } + + public setPatientInterpreterRequired (value: boolean): this { + pushExtension(this.resource, { url: "http://hl7.org/fhir/StructureDefinition/patient-interpreterRequired", valueBoolean: value } as Extension) + return this + } + + public getPatientInterpreterRequired(mode: 'flat'): boolean | undefined; + public getPatientInterpreterRequired(mode: 'raw'): Extension | undefined; + public getPatientInterpreterRequired(): boolean | undefined; + public getPatientInterpreterRequired (mode: 'flat' | 'raw' = 'flat'): boolean | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "http://hl7.org/fhir/StructureDefinition/patient-interpreterRequired") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue(ext, "valueBoolean") + } + + public setNhsNumberUnavailableReason (value: ExtensionUKCoreNHSNumberUnavailableReasonProfile | Extension | CodeableConcept): this { + if (value instanceof ExtensionUKCoreNHSNumberUnavailableReasonProfile) { + pushExtension(this.resource, value.toResource()) + } else if (isExtension(value)) { + if (value.url !== "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberUnavailableReason") throw new Error(`Expected extension url 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberUnavailableReason', got '${value.url}'`) + pushExtension(this.resource, value) + } else { + pushExtension(this.resource, ExtensionUKCoreNHSNumberUnavailableReasonProfile.createResource({ valueCodeableConcept: value as CodeableConcept })) + } + return this + } + + public getNhsNumberUnavailableReason(mode: 'flat'): CodeableConcept | undefined; + public getNhsNumberUnavailableReason(mode: 'profile'): ExtensionUKCoreNHSNumberUnavailableReasonProfile | undefined; + public getNhsNumberUnavailableReason(mode: 'raw'): Extension | undefined; + public getNhsNumberUnavailableReason(): CodeableConcept | undefined; + public getNhsNumberUnavailableReason (mode: 'flat' | 'profile' | 'raw' = 'flat'): CodeableConcept | ExtensionUKCoreNHSNumberUnavailableReasonProfile | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberUnavailableReason") + if (!ext) return undefined + if (mode === 'raw') return ext + if (mode === 'profile') return ExtensionUKCoreNHSNumberUnavailableReasonProfile.apply(ext) + return getExtensionValue(ext, "valueCodeableConcept") + } + + public setTelecomSystemOtherContactSystem (value: ExtensionUKCoreOtherContactSystemProfile | Extension | CodeableConcept): this { + if (value instanceof ExtensionUKCoreOtherContactSystemProfile) { + const target = ensurePath(this.resource as unknown as Record, ["telecom","system"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, value.toResource()) + } else if (isExtension(value)) { + if (value.url !== "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-OtherContactSystem") throw new Error(`Expected extension url 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-OtherContactSystem', got '${value.url}'`) + const target = ensurePath(this.resource as unknown as Record, ["telecom","system"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, value) + } else { + const target = ensurePath(this.resource as unknown as Record, ["telecom","system"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, ExtensionUKCoreOtherContactSystemProfile.createResource({ valueCodeableConcept: value as CodeableConcept })) + } + return this + } + + public getTelecomSystemOtherContactSystem(mode: 'flat'): CodeableConcept | undefined; + public getTelecomSystemOtherContactSystem(mode: 'profile'): ExtensionUKCoreOtherContactSystemProfile | undefined; + public getTelecomSystemOtherContactSystem(mode: 'raw'): Extension | undefined; + public getTelecomSystemOtherContactSystem(): CodeableConcept | undefined; + public getTelecomSystemOtherContactSystem (mode: 'flat' | 'profile' | 'raw' = 'flat'): CodeableConcept | ExtensionUKCoreOtherContactSystemProfile | Extension | undefined { + const target = ensurePath(this.resource as unknown as Record, ["telecom","system"]) + const ext = (target.extension as Extension[] | undefined)?.find(e => e.url === "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-OtherContactSystem") + if (!ext) return undefined + if (mode === 'raw') return ext + if (mode === 'profile') return ExtensionUKCoreOtherContactSystemProfile.apply(ext) + return getExtensionValue(ext, "valueCodeableConcept") + } + + public setBirthTime (value: string): this { + const target = ensurePath(this.resource as unknown as Record, ["birthDate"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, { url: "http://hl7.org/fhir/StructureDefinition/patient-birthTime", valueDateTime: value } as Extension) + return this + } + + public getBirthTime(mode: 'flat'): string | undefined; + public getBirthTime(mode: 'raw'): Extension | undefined; + public getBirthTime(): string | undefined; + public getBirthTime (mode: 'flat' | 'raw' = 'flat'): string | Extension | undefined { + const target = ensurePath(this.resource as unknown as Record, ["birthDate"]) + const ext = (target.extension as Extension[] | undefined)?.find(e => e.url === "http://hl7.org/fhir/StructureDefinition/patient-birthTime") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue(ext, "valueDateTime") + } + + public setAddressKey (input: ExtensionUKCoreAddressKeyProfileFlat | ExtensionUKCoreAddressKeyProfile | Extension): this { + if (input instanceof ExtensionUKCoreAddressKeyProfile) { + const target = ensurePath(this.resource as unknown as Record, ["address"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, input.toResource()) + } else if (isExtension(input)) { + if (input.url !== "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey") throw new Error(`Expected extension url 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey', got '${input.url}'`) + const target = ensurePath(this.resource as unknown as Record, ["address"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, input) + } else { + const target = ensurePath(this.resource as unknown as Record, ["address"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, ExtensionUKCoreAddressKeyProfile.createResource(input)) + } + return this + } + + public getAddressKey(mode: 'flat'): ExtensionUKCoreAddressKeyProfileFlat | undefined; + public getAddressKey(mode: 'profile'): ExtensionUKCoreAddressKeyProfile | undefined; + public getAddressKey(mode: 'raw'): Extension | undefined; + public getAddressKey(): ExtensionUKCoreAddressKeyProfileFlat | undefined; + public getAddressKey (mode: 'flat' | 'profile' | 'raw' = 'flat'): ExtensionUKCoreAddressKeyProfileFlat | ExtensionUKCoreAddressKeyProfile | Extension | undefined { + const target = ensurePath(this.resource as unknown as Record, ["address"]) + const ext = (target.extension as Extension[] | undefined)?.find(e => e.url === "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey") + if (!ext) return undefined + if (mode === 'raw') return ext + if (mode === 'profile') return ExtensionUKCoreAddressKeyProfile.apply(ext) + const config = [{ name: "type", valueField: "valueCodeableConcept", isArray: false }, { name: "value", valueField: "valueString", isArray: false }] + return extractComplexExtension(ext, config) + } + + public setContactRank (value: ExtensionUKCoreContactRankProfile | Extension | number): this { + if (value instanceof ExtensionUKCoreContactRankProfile) { + const target = ensurePath(this.resource as unknown as Record, ["contact"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, value.toResource()) + } else if (isExtension(value)) { + if (value.url !== "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactRank") throw new Error(`Expected extension url 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactRank', got '${value.url}'`) + const target = ensurePath(this.resource as unknown as Record, ["contact"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, value) + } else { + const target = ensurePath(this.resource as unknown as Record, ["contact"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, ExtensionUKCoreContactRankProfile.createResource({ valuePositiveInt: value as number })) + } + return this + } + + public getContactRank(mode: 'flat'): number | undefined; + public getContactRank(mode: 'profile'): ExtensionUKCoreContactRankProfile | undefined; + public getContactRank(mode: 'raw'): Extension | undefined; + public getContactRank(): number | undefined; + public getContactRank (mode: 'flat' | 'profile' | 'raw' = 'flat'): number | ExtensionUKCoreContactRankProfile | Extension | undefined { + const target = ensurePath(this.resource as unknown as Record, ["contact"]) + const ext = (target.extension as Extension[] | undefined)?.find(e => e.url === "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactRank") + if (!ext) return undefined + if (mode === 'raw') return ext + if (mode === 'profile') return ExtensionUKCoreContactRankProfile.apply(ext) + return getExtensionValue(ext, "valuePositiveInt") + } + + public setCopyCorrespondenceIndicator (value: ExtensionUKCoreCopyCorrespondenceIndicatorProfile | Extension | boolean): this { + if (value instanceof ExtensionUKCoreCopyCorrespondenceIndicatorProfile) { + const target = ensurePath(this.resource as unknown as Record, ["contact"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, value.toResource()) + } else if (isExtension(value)) { + if (value.url !== "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-CopyCorrespondenceIndicator") throw new Error(`Expected extension url 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-CopyCorrespondenceIndicator', got '${value.url}'`) + const target = ensurePath(this.resource as unknown as Record, ["contact"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, value) + } else { + const target = ensurePath(this.resource as unknown as Record, ["contact"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, ExtensionUKCoreCopyCorrespondenceIndicatorProfile.createResource({ valueBoolean: value as boolean })) + } + return this + } + + public getCopyCorrespondenceIndicator(mode: 'flat'): boolean | undefined; + public getCopyCorrespondenceIndicator(mode: 'profile'): ExtensionUKCoreCopyCorrespondenceIndicatorProfile | undefined; + public getCopyCorrespondenceIndicator(mode: 'raw'): Extension | undefined; + public getCopyCorrespondenceIndicator(): boolean | undefined; + public getCopyCorrespondenceIndicator (mode: 'flat' | 'profile' | 'raw' = 'flat'): boolean | ExtensionUKCoreCopyCorrespondenceIndicatorProfile | Extension | undefined { + const target = ensurePath(this.resource as unknown as Record, ["contact"]) + const ext = (target.extension as Extension[] | undefined)?.find(e => e.url === "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-CopyCorrespondenceIndicator") + if (!ext) return undefined + if (mode === 'raw') return ext + if (mode === 'profile') return ExtensionUKCoreCopyCorrespondenceIndicatorProfile.apply(ext) + return getExtensionValue(ext, "valueBoolean") + } + + public setContactTelecomSystemOtherContactSystem (value: ExtensionUKCoreOtherContactSystemProfile | Extension | CodeableConcept): this { + if (value instanceof ExtensionUKCoreOtherContactSystemProfile) { + const target = ensurePath(this.resource as unknown as Record, ["contact","telecom","system"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, value.toResource()) + } else if (isExtension(value)) { + if (value.url !== "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-OtherContactSystem") throw new Error(`Expected extension url 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-OtherContactSystem', got '${value.url}'`) + const target = ensurePath(this.resource as unknown as Record, ["contact","telecom","system"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, value) + } else { + const target = ensurePath(this.resource as unknown as Record, ["contact","telecom","system"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + pushExtension(target as unknown as { extension?: Extension[] }, ExtensionUKCoreOtherContactSystemProfile.createResource({ valueCodeableConcept: value as CodeableConcept })) + } + return this + } + + public getContactTelecomSystemOtherContactSystem(mode: 'flat'): CodeableConcept | undefined; + public getContactTelecomSystemOtherContactSystem(mode: 'profile'): ExtensionUKCoreOtherContactSystemProfile | undefined; + public getContactTelecomSystemOtherContactSystem(mode: 'raw'): Extension | undefined; + public getContactTelecomSystemOtherContactSystem(): CodeableConcept | undefined; + public getContactTelecomSystemOtherContactSystem (mode: 'flat' | 'profile' | 'raw' = 'flat'): CodeableConcept | ExtensionUKCoreOtherContactSystemProfile | Extension | undefined { + const target = ensurePath(this.resource as unknown as Record, ["contact","telecom","system"]) + const ext = (target.extension as Extension[] | undefined)?.find(e => e.url === "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-OtherContactSystem") + if (!ext) return undefined + if (mode === 'raw') return ext + if (mode === 'profile') return ExtensionUKCoreOtherContactSystemProfile.apply(ext) + return getExtensionValue(ext, "valueCodeableConcept") + } + + public setProficiency (input: UKCorePatient_ProficiencyFlat): this { + const subExtensions: Extension[] = [] + if (input.level !== undefined) { + subExtensions.push({ url: "level", valueCoding: input.level } as Extension) + } + if (input.type) { + for (const item of input.type) { + subExtensions.push({ url: "type", valueCoding: item } as Extension) + } + } + const target = ensurePath(this.resource as unknown as Record, ["communication"]) + if (!Array.isArray(target.extension)) target.extension = [] as Extension[] + (target.extension as Extension[]).push({ url: "http://hl7.org/fhir/StructureDefinition/patient-proficiency", extension: subExtensions }) + return this + } + + public getProficiency(mode: 'flat'): UKCorePatient_ProficiencyFlat | undefined; + public getProficiency(mode: 'raw'): Extension | undefined; + public getProficiency(): UKCorePatient_ProficiencyFlat | undefined; + public getProficiency (mode: 'flat' | 'raw' = 'flat'): UKCorePatient_ProficiencyFlat | Extension | undefined { + const target = ensurePath(this.resource as unknown as Record, ["communication"]) + const ext = (target.extension as Extension[] | undefined)?.find(e => e.url === "http://hl7.org/fhir/StructureDefinition/patient-proficiency") + if (!ext) return undefined + if (mode === 'raw') return ext + const config = [{ name: "level", valueField: "valueCoding", isArray: false }, { name: "type", valueField: "valueCoding", isArray: true }] + return extractComplexExtension(ext, config) + } + + // Slices + public setNhsNumber (input: UKCorePatient_Identifier_NhsNumberSliceFlat | Identifier): this { + const match = UKCorePatientProfile.nhsNumberSliceMatch + if (input && matchesValue(input, match)) { + setArraySlice(this.resource.identifier ??= [], match, input as Identifier) + return this + } + const value = applySliceMatch(input, match) + setArraySlice(this.resource.identifier ??= [], match, value) + return this + } + + public getNhsNumber(mode: 'flat'): UKCorePatient_Identifier_NhsNumberSliceFlat | undefined; + public getNhsNumber(mode: 'raw'): Identifier | undefined; + public getNhsNumber(): UKCorePatient_Identifier_NhsNumberSliceFlat | undefined; + public getNhsNumber (mode: 'flat' | 'raw' = 'flat'): UKCorePatient_Identifier_NhsNumberSliceFlat | Identifier | undefined { + const match = UKCorePatientProfile.nhsNumberSliceMatch + const item = getArraySlice(this.resource.identifier, match) + if (!item) return undefined + if (mode === 'raw') return item + return stripMatchKeys(item, ["system"]) + } + + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "UKCorePatient" + const res = this.resource + return { + errors: [ + ...validateSliceCardinality(res, profileName, "identifier", {"system":"https://fhir.nhs.uk/Id/nhs-number"}, "nhsNumber", 0, 1), + ...validateEnum(res, profileName, "gender", ["male","female","other","unknown"]), + ], + warnings: [ + ...validateMustSupport(res, profileName, "identifier"), + ...validateMustSupport(res, profileName, "active"), + ...validateMustSupport(res, profileName, "name"), + ...validateMustSupport(res, profileName, "telecom"), + ...validateMustSupport(res, profileName, "gender"), + ...validateMustSupport(res, profileName, "birthDate"), + ...validateMustSupport(res, profileName, "address"), + ...validateEnum(res, profileName, "maritalStatus", ["UNK","A","D","T","I","L","M","S","P","U","W","M","D","W","N","P","8","22","32","42","51","91"]), + ], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/index.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/index.ts new file mode 100644 index 0000000..20d8c2d --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/fhir-r4-ukcore-stu2/profiles/index.ts @@ -0,0 +1,14 @@ +export { ExtensionUKCoreAddressKeyProfile } from "./Extension_ExtensionUKCoreAddressKey"; +export { ExtensionUKCoreAllergyIntoleranceEndProfile } from "./Extension_ExtensionUKCoreAllergyIntoleranceEnd"; +export { ExtensionUKCoreBirthSexProfile } from "./Extension_ExtensionUKCoreBirthSex"; +export { ExtensionUKCoreContactPreferenceProfile } from "./Extension_ExtensionUKCoreContactPreference"; +export { ExtensionUKCoreContactRankProfile } from "./Extension_ExtensionUKCoreContactRank"; +export { ExtensionUKCoreCopyCorrespondenceIndicatorProfile } from "./Extension_ExtensionUKCoreCopyCorrespondenceIndicator"; +export { ExtensionUKCoreDeathNotificationStatusProfile } from "./Extension_ExtensionUKCoreDeathNotificationStatus"; +export { ExtensionUKCoreEthnicCategoryProfile } from "./Extension_ExtensionUKCoreEthnicCategory"; +export { ExtensionUKCoreEvidenceProfile } from "./Extension_ExtensionUKCoreEvidence"; +export { ExtensionUKCoreNHSNumberUnavailableReasonProfile } from "./Extension_ExtensionUKCoreNHSNumberUnavailableReason"; +export { ExtensionUKCoreOtherContactSystemProfile } from "./Extension_ExtensionUKCoreOtherContactSystem"; +export { ExtensionUKCoreResidentialStatusProfile } from "./Extension_ExtensionUKCoreResidentialStatus"; +export { UKCoreAllergyIntoleranceProfile } from "./AllergyIntolerance_UKCoreAllergyIntolerance"; +export { UKCorePatientProfile } from "./Patient_UKCorePatient"; diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Address.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Address.ts new file mode 100644 index 0000000..5cb3312 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Address.ts @@ -0,0 +1,32 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Period } from "../hl7-fhir-r4-core/Period"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Period } from "../hl7-fhir-r4-core/Period"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Address (pkg: hl7.fhir.r4.core#4.0.1) +export interface Address extends Element { + city?: string; + _city?: Element; + country?: string; + _country?: Element; + district?: string; + _district?: Element; + line?: string[]; + _line?: (Element | null)[]; + period?: Period; + postalCode?: string; + _postalCode?: Element; + state?: string; + _state?: Element; + text?: string; + _text?: Element; + type?: ("postal" | "physical" | "both"); + _type?: Element; + use?: ("home" | "work" | "temp" | "old" | "billing"); + _use?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Age.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Age.ts new file mode 100644 index 0000000..be492a3 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Age.ts @@ -0,0 +1,11 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Quantity } from "../hl7-fhir-r4-core/Quantity"; + +export type { Quantity } from "../hl7-fhir-r4-core/Quantity"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Age (pkg: hl7.fhir.r4.core#4.0.1) +export interface Age extends Quantity { +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/AllergyIntolerance.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/AllergyIntolerance.ts new file mode 100644 index 0000000..7cb17ff --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/AllergyIntolerance.ts @@ -0,0 +1,69 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Age } from "../hl7-fhir-r4-core/Age"; +import type { Annotation } from "../hl7-fhir-r4-core/Annotation"; +import type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +import type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +import type { DomainResource } from "../hl7-fhir-r4-core/DomainResource"; +import type { Identifier } from "../hl7-fhir-r4-core/Identifier"; +import type { Period } from "../hl7-fhir-r4-core/Period"; +import type { Range } from "../hl7-fhir-r4-core/Range"; +import type { Reference } from "../hl7-fhir-r4-core/Reference"; + +import type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Age } from "../hl7-fhir-r4-core/Age"; +export type { Annotation } from "../hl7-fhir-r4-core/Annotation"; +export type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +export type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +export type { Identifier } from "../hl7-fhir-r4-core/Identifier"; +export type { Period } from "../hl7-fhir-r4-core/Period"; +export type { Range } from "../hl7-fhir-r4-core/Range"; +export type { Reference } from "../hl7-fhir-r4-core/Reference"; + +export interface AllergyIntoleranceReaction extends BackboneElement { + description?: string; + exposureRoute?: CodeableConcept; + manifestation: CodeableConcept[]; + note?: Annotation[]; + onset?: string; + severity?: ("mild" | "moderate" | "severe"); + substance?: CodeableConcept; +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/AllergyIntolerance (pkg: hl7.fhir.r4.core#4.0.1) +export interface AllergyIntolerance extends DomainResource { + resourceType: "AllergyIntolerance"; + + asserter?: Reference<"Patient" | "Practitioner" | "PractitionerRole" | "RelatedPerson">; + category?: ("food" | "medication" | "environment" | "biologic")[]; + _category?: (Element | null)[]; + clinicalStatus?: CodeableConcept<("active" | "inactive" | "resolved")>; + code?: CodeableConcept; + criticality?: ("low" | "high" | "unable-to-assess"); + _criticality?: Element; + encounter?: Reference<"Encounter">; + identifier?: Identifier[]; + lastOccurrence?: string; + _lastOccurrence?: Element; + note?: Annotation[]; + onsetAge?: Age; + onsetDateTime?: string; + _onsetDateTime?: Element; + onsetPeriod?: Period; + onsetRange?: Range; + onsetString?: string; + _onsetString?: Element; + patient: Reference<"Patient">; + reaction?: AllergyIntoleranceReaction[]; + recordedDate?: string; + _recordedDate?: Element; + recorder?: Reference<"Patient" | "Practitioner" | "PractitionerRole" | "RelatedPerson">; + type?: ("allergy" | "intolerance"); + _type?: Element; + verificationStatus?: CodeableConcept<("unconfirmed" | "confirmed" | "refuted" | "entered-in-error")>; +} +export const isAllergyIntolerance = (resource: unknown): resource is AllergyIntolerance => { + return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "AllergyIntolerance"; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Annotation.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Annotation.ts new file mode 100644 index 0000000..25bd874 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Annotation.ts @@ -0,0 +1,20 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Reference } from "../hl7-fhir-r4-core/Reference"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Reference } from "../hl7-fhir-r4-core/Reference"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Annotation (pkg: hl7.fhir.r4.core#4.0.1) +export interface Annotation extends Element { + authorReference?: Reference<"Organization" | "Patient" | "Practitioner" | "RelatedPerson">; + authorString?: string; + _authorString?: Element; + text: string; + _text?: Element; + time?: string; + _time?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Attachment.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Attachment.ts new file mode 100644 index 0000000..137a342 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Attachment.ts @@ -0,0 +1,27 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Attachment (pkg: hl7.fhir.r4.core#4.0.1) +export interface Attachment extends Element { + contentType?: string; + _contentType?: Element; + creation?: string; + _creation?: Element; + data?: string; + _data?: Element; + hash?: string; + _hash?: Element; + language?: ("ar" | "bn" | "cs" | "da" | "de" | "de-AT" | "de-CH" | "de-DE" | "el" | "en" | "en-AU" | "en-CA" | "en-GB" | "en-IN" | "en-NZ" | "en-SG" | "en-US" | "es" | "es-AR" | "es-ES" | "es-UY" | "fi" | "fr" | "fr-BE" | "fr-CH" | "fr-FR" | "fy" | "fy-NL" | "hi" | "hr" | "it" | "it-CH" | "it-IT" | "ja" | "ko" | "nl" | "nl-BE" | "nl-NL" | "no" | "no-NO" | "pa" | "pl" | "pt" | "pt-BR" | "ru" | "ru-RU" | "sr" | "sr-RS" | "sv" | "sv-SE" | "te" | "zh" | "zh-CN" | "zh-HK" | "zh-SG" | "zh-TW" | string); + _language?: Element; + size?: number; + _size?: Element; + title?: string; + _title?: Element; + url?: string; + _url?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/BackboneElement.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/BackboneElement.ts new file mode 100644 index 0000000..b2b70e6 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/BackboneElement.ts @@ -0,0 +1,14 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Extension } from "../hl7-fhir-r4-core/Extension"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Extension } from "../hl7-fhir-r4-core/Extension"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/BackboneElement (pkg: hl7.fhir.r4.core#4.0.1) +export interface BackboneElement extends Element { + modifierExtension?: Extension[]; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Bundle.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Bundle.ts new file mode 100644 index 0000000..3a9e013 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Bundle.ts @@ -0,0 +1,68 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +import type { Identifier } from "../hl7-fhir-r4-core/Identifier"; +import type { Resource } from "../hl7-fhir-r4-core/Resource"; +import type { Signature } from "../hl7-fhir-r4-core/Signature"; + +import type { Element } from "../hl7-fhir-r4-core/Element"; +export type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +export type { Identifier } from "../hl7-fhir-r4-core/Identifier"; +export type { Signature } from "../hl7-fhir-r4-core/Signature"; + +export interface BundleEntry extends BackboneElement { + fullUrl?: string; + link?: BundleLink[]; + request?: BundleEntryRequest; + resource?: T; + response?: BundleEntryResponse; + search?: BundleEntrySearch; +} + +export interface BundleEntryRequest extends BackboneElement { + ifMatch?: string; + ifModifiedSince?: string; + ifNoneExist?: string; + ifNoneMatch?: string; + method: ("GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "PATCH"); + url: string; +} + +export interface BundleEntryResponse extends BackboneElement { + etag?: string; + lastModified?: string; + location?: string; + outcome?: T; + status: string; +} + +export interface BundleEntrySearch extends BackboneElement { + mode?: ("match" | "include" | "outcome"); + score?: number; +} + +export interface BundleLink extends BackboneElement { + relation: string; + url: string; +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Bundle (pkg: hl7.fhir.r4.core#4.0.1) +export interface Bundle extends Resource { + resourceType: "Bundle"; + + entry?: BundleEntry[]; + identifier?: Identifier; + link?: BundleLink[]; + signature?: Signature; + timestamp?: string; + _timestamp?: Element; + total?: number; + _total?: Element; + type: ("document" | "message" | "transaction" | "transaction-response" | "batch" | "batch-response" | "history" | "searchset" | "collection"); + _type?: Element; +} +export const isBundle = (resource: unknown): resource is Bundle => { + return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "Bundle"; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/CodeableConcept.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/CodeableConcept.ts new file mode 100644 index 0000000..94f47f6 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/CodeableConcept.ts @@ -0,0 +1,16 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Coding } from "../hl7-fhir-r4-core/Coding"; +import type { Element } from "../hl7-fhir-r4-core/Element"; + +export type { Coding } from "../hl7-fhir-r4-core/Coding"; +export type { Element } from "../hl7-fhir-r4-core/Element"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/CodeableConcept (pkg: hl7.fhir.r4.core#4.0.1) +export interface CodeableConcept extends Element { + coding?: Coding[]; + text?: string; + _text?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Coding.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Coding.ts new file mode 100644 index 0000000..84ad129 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Coding.ts @@ -0,0 +1,21 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Coding (pkg: hl7.fhir.r4.core#4.0.1) +export interface Coding extends Element { + code?: T; + _code?: Element; + display?: string; + _display?: Element; + system?: string; + _system?: Element; + userSelected?: boolean; + _userSelected?: Element; + version?: string; + _version?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/ContactDetail.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/ContactDetail.ts new file mode 100644 index 0000000..61b94d2 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/ContactDetail.ts @@ -0,0 +1,16 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { ContactPoint } from "../hl7-fhir-r4-core/ContactPoint"; +import type { Element } from "../hl7-fhir-r4-core/Element"; + +export type { ContactPoint } from "../hl7-fhir-r4-core/ContactPoint"; +export type { Element } from "../hl7-fhir-r4-core/Element"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/ContactDetail (pkg: hl7.fhir.r4.core#4.0.1) +export interface ContactDetail extends Element { + name?: string; + _name?: Element; + telecom?: ContactPoint[]; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/ContactPoint.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/ContactPoint.ts new file mode 100644 index 0000000..a8507dc --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/ContactPoint.ts @@ -0,0 +1,22 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Period } from "../hl7-fhir-r4-core/Period"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Period } from "../hl7-fhir-r4-core/Period"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/ContactPoint (pkg: hl7.fhir.r4.core#4.0.1) +export interface ContactPoint extends Element { + period?: Period; + rank?: number; + _rank?: Element; + system?: ("phone" | "fax" | "email" | "pager" | "url" | "sms" | "other"); + _system?: Element; + use?: ("home" | "work" | "temp" | "old" | "mobile"); + _use?: Element; + value?: string; + _value?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Contributor.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Contributor.ts new file mode 100644 index 0000000..c0c56d2 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Contributor.ts @@ -0,0 +1,18 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { ContactDetail } from "../hl7-fhir-r4-core/ContactDetail"; +import type { Element } from "../hl7-fhir-r4-core/Element"; + +export type { ContactDetail } from "../hl7-fhir-r4-core/ContactDetail"; +export type { Element } from "../hl7-fhir-r4-core/Element"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Contributor (pkg: hl7.fhir.r4.core#4.0.1) +export interface Contributor extends Element { + contact?: ContactDetail[]; + name: string; + _name?: Element; + type: ("author" | "editor" | "reviewer" | "endorser"); + _type?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Count.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Count.ts new file mode 100644 index 0000000..e8db9c5 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Count.ts @@ -0,0 +1,11 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Quantity } from "../hl7-fhir-r4-core/Quantity"; + +export type { Quantity } from "../hl7-fhir-r4-core/Quantity"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Count (pkg: hl7.fhir.r4.core#4.0.1) +export interface Count extends Quantity { +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/DataRequirement.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/DataRequirement.ts new file mode 100644 index 0000000..5a010ea --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/DataRequirement.ts @@ -0,0 +1,54 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +import type { Coding } from "../hl7-fhir-r4-core/Coding"; +import type { Duration } from "../hl7-fhir-r4-core/Duration"; +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Period } from "../hl7-fhir-r4-core/Period"; +import type { Reference } from "../hl7-fhir-r4-core/Reference"; + +export type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +export type { Coding } from "../hl7-fhir-r4-core/Coding"; +export type { Duration } from "../hl7-fhir-r4-core/Duration"; +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Period } from "../hl7-fhir-r4-core/Period"; +export type { Reference } from "../hl7-fhir-r4-core/Reference"; + +export interface DataRequirementCodeFilter extends Element { + code?: Coding[]; + path?: string; + searchParam?: string; + valueSet?: string; +} + +export interface DataRequirementDateFilter extends Element { + path?: string; + searchParam?: string; + valueDateTime?: string; + valueDuration?: Duration; + valuePeriod?: Period; +} + +export interface DataRequirementSort extends Element { + direction: ("ascending" | "descending"); + path: string; +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/DataRequirement (pkg: hl7.fhir.r4.core#4.0.1) +export interface DataRequirement extends Element { + codeFilter?: DataRequirementCodeFilter[]; + dateFilter?: DataRequirementDateFilter[]; + limit?: number; + _limit?: Element; + mustSupport?: string[]; + _mustSupport?: (Element | null)[]; + profile?: string[]; + _profile?: (Element | null)[]; + sort?: DataRequirementSort[]; + subjectCodeableConcept?: CodeableConcept; + subjectReference?: Reference<"Group">; + type: string; + _type?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Distance.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Distance.ts new file mode 100644 index 0000000..0dcb5be --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Distance.ts @@ -0,0 +1,11 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Quantity } from "../hl7-fhir-r4-core/Quantity"; + +export type { Quantity } from "../hl7-fhir-r4-core/Quantity"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Distance (pkg: hl7.fhir.r4.core#4.0.1) +export interface Distance extends Quantity { +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/DomainResource.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/DomainResource.ts new file mode 100644 index 0000000..661ba54 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/DomainResource.ts @@ -0,0 +1,23 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Extension } from "../hl7-fhir-r4-core/Extension"; +import type { Narrative } from "../hl7-fhir-r4-core/Narrative"; +import type { Resource } from "../hl7-fhir-r4-core/Resource"; + +export type { Extension } from "../hl7-fhir-r4-core/Extension"; +export type { Narrative } from "../hl7-fhir-r4-core/Narrative"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/DomainResource (pkg: hl7.fhir.r4.core#4.0.1) +export interface DomainResource extends Resource { + resourceType: "AllergyIntolerance" | "DomainResource" | "Encounter" | "Observation" | "OperationOutcome" | "Patient" | "Provenance"; + + contained?: T[]; + extension?: Extension[]; + modifierExtension?: Extension[]; + text?: Narrative; +} +export const isDomainResource = (resource: unknown): resource is DomainResource => { + return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "DomainResource"; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Dosage.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Dosage.ts new file mode 100644 index 0000000..71bd52a --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Dosage.ts @@ -0,0 +1,50 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +import type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Quantity } from "../hl7-fhir-r4-core/Quantity"; +import type { Range } from "../hl7-fhir-r4-core/Range"; +import type { Ratio } from "../hl7-fhir-r4-core/Ratio"; +import type { Timing } from "../hl7-fhir-r4-core/Timing"; + +export type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +export type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Quantity } from "../hl7-fhir-r4-core/Quantity"; +export type { Range } from "../hl7-fhir-r4-core/Range"; +export type { Ratio } from "../hl7-fhir-r4-core/Ratio"; +export type { Timing } from "../hl7-fhir-r4-core/Timing"; + +export interface DosageDoseAndRate extends Element { + doseQuantity?: Quantity; + doseRange?: Range; + rateQuantity?: Quantity; + rateRange?: Range; + rateRatio?: Ratio; + type?: CodeableConcept; +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Dosage (pkg: hl7.fhir.r4.core#4.0.1) +export interface Dosage extends BackboneElement { + additionalInstruction?: CodeableConcept[]; + asNeededBoolean?: boolean; + _asNeededBoolean?: Element; + asNeededCodeableConcept?: CodeableConcept; + doseAndRate?: DosageDoseAndRate[]; + maxDosePerAdministration?: Quantity; + maxDosePerLifetime?: Quantity; + maxDosePerPeriod?: Ratio; + method?: CodeableConcept; + patientInstruction?: string; + _patientInstruction?: Element; + route?: CodeableConcept; + sequence?: number; + _sequence?: Element; + site?: CodeableConcept; + text?: string; + _text?: Element; + timing?: Timing; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Duration.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Duration.ts new file mode 100644 index 0000000..0019823 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Duration.ts @@ -0,0 +1,11 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Quantity } from "../hl7-fhir-r4-core/Quantity"; + +export type { Quantity } from "../hl7-fhir-r4-core/Quantity"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Duration (pkg: hl7.fhir.r4.core#4.0.1) +export interface Duration extends Quantity { +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Element.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Element.ts new file mode 100644 index 0000000..eac8191 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Element.ts @@ -0,0 +1,14 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Extension } from "../hl7-fhir-r4-core/Extension"; + +export type { Extension } from "../hl7-fhir-r4-core/Extension"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Element (pkg: hl7.fhir.r4.core#4.0.1) +export interface Element { + extension?: Extension[]; + id?: string; + _id?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Encounter.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Encounter.ts new file mode 100644 index 0000000..8c657da --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Encounter.ts @@ -0,0 +1,95 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +import type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +import type { Coding } from "../hl7-fhir-r4-core/Coding"; +import type { DomainResource } from "../hl7-fhir-r4-core/DomainResource"; +import type { Duration } from "../hl7-fhir-r4-core/Duration"; +import type { Identifier } from "../hl7-fhir-r4-core/Identifier"; +import type { Period } from "../hl7-fhir-r4-core/Period"; +import type { Reference } from "../hl7-fhir-r4-core/Reference"; + +import type { Element } from "../hl7-fhir-r4-core/Element"; +export type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +export type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +export type { Coding } from "../hl7-fhir-r4-core/Coding"; +export type { Duration } from "../hl7-fhir-r4-core/Duration"; +export type { Identifier } from "../hl7-fhir-r4-core/Identifier"; +export type { Period } from "../hl7-fhir-r4-core/Period"; +export type { Reference } from "../hl7-fhir-r4-core/Reference"; + +export interface EncounterClassHistory extends BackboneElement { + "class": Coding; + period: Period; +} + +export interface EncounterDiagnosis extends BackboneElement { + condition: Reference<"Condition" | "Procedure">; + rank?: number; + use?: CodeableConcept<("AD" | "DD" | "CC" | "CM" | "pre-op" | "post-op" | "billing" | string)>; +} + +export interface EncounterHospitalization extends BackboneElement { + admitSource?: CodeableConcept<("hosp-trans" | "emd" | "outp" | "born" | "gp" | "mp" | "nursing" | "psych" | "rehab" | "other" | string)>; + destination?: Reference<"Location" | "Organization">; + dietPreference?: CodeableConcept[]; + dischargeDisposition?: CodeableConcept; + origin?: Reference<"Location" | "Organization">; + preAdmissionIdentifier?: Identifier; + reAdmission?: CodeableConcept; + specialArrangement?: CodeableConcept<("wheel" | "add-bed" | "int" | "att" | "dog" | string)>[]; + specialCourtesy?: CodeableConcept<("EXT" | "NRM" | "PRF" | "STF" | "VIP" | "UNK" | string)>[]; +} + +export interface EncounterLocation extends BackboneElement { + location: Reference<"Location">; + period?: Period; + physicalType?: CodeableConcept; + status?: ("planned" | "active" | "reserved" | "completed"); +} + +export interface EncounterParticipant extends BackboneElement { + individual?: Reference<"Practitioner" | "PractitionerRole" | "RelatedPerson">; + period?: Period; + type?: CodeableConcept<("SPRF" | "PPRF" | "PART" | "translator" | "emergency" | string)>[]; +} + +export interface EncounterStatusHistory extends BackboneElement { + period: Period; + status: ("planned" | "arrived" | "triaged" | "in-progress" | "onleave" | "finished" | "cancelled" | "entered-in-error" | "unknown"); +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Encounter (pkg: hl7.fhir.r4.core#4.0.1) +export interface Encounter extends DomainResource { + resourceType: "Encounter"; + + account?: Reference<"Account">[]; + appointment?: Reference<"Appointment">[]; + basedOn?: Reference<"ServiceRequest">[]; + "class": Coding; + classHistory?: EncounterClassHistory[]; + diagnosis?: EncounterDiagnosis[]; + episodeOfCare?: Reference<"EpisodeOfCare">[]; + hospitalization?: EncounterHospitalization; + identifier?: Identifier[]; + length?: Duration; + location?: EncounterLocation[]; + participant?: EncounterParticipant[]; + partOf?: Reference<"Encounter">; + period?: Period; + priority?: CodeableConcept; + reasonCode?: CodeableConcept[]; + reasonReference?: Reference<"Condition" | "ImmunizationRecommendation" | "Observation" | "Procedure">[]; + serviceProvider?: Reference<"Organization">; + serviceType?: CodeableConcept; + status: ("planned" | "arrived" | "triaged" | "in-progress" | "onleave" | "finished" | "cancelled" | "entered-in-error" | "unknown"); + _status?: Element; + statusHistory?: EncounterStatusHistory[]; + subject?: Reference<"Group" | "Patient">; + type?: CodeableConcept[]; +} +export const isEncounter = (resource: unknown): resource is Encounter => { + return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "Encounter"; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Expression.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Expression.ts new file mode 100644 index 0000000..9033b39 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Expression.ts @@ -0,0 +1,21 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Expression (pkg: hl7.fhir.r4.core#4.0.1) +export interface Expression extends Element { + description?: string; + _description?: Element; + expression?: string; + _expression?: Element; + language: ("text/cql" | "text/fhirpath" | "application/x-fhir-query" | string); + _language?: Element; + name?: string; + _name?: Element; + reference?: string; + _reference?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Extension.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Extension.ts new file mode 100644 index 0000000..34dcb31 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Extension.ts @@ -0,0 +1,144 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Address } from "../hl7-fhir-r4-core/Address"; +import type { Age } from "../hl7-fhir-r4-core/Age"; +import type { Annotation } from "../hl7-fhir-r4-core/Annotation"; +import type { Attachment } from "../hl7-fhir-r4-core/Attachment"; +import type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +import type { Coding } from "../hl7-fhir-r4-core/Coding"; +import type { ContactDetail } from "../hl7-fhir-r4-core/ContactDetail"; +import type { ContactPoint } from "../hl7-fhir-r4-core/ContactPoint"; +import type { Contributor } from "../hl7-fhir-r4-core/Contributor"; +import type { Count } from "../hl7-fhir-r4-core/Count"; +import type { DataRequirement } from "../hl7-fhir-r4-core/DataRequirement"; +import type { Distance } from "../hl7-fhir-r4-core/Distance"; +import type { Dosage } from "../hl7-fhir-r4-core/Dosage"; +import type { Duration } from "../hl7-fhir-r4-core/Duration"; +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Expression } from "../hl7-fhir-r4-core/Expression"; +import type { HumanName } from "../hl7-fhir-r4-core/HumanName"; +import type { Identifier } from "../hl7-fhir-r4-core/Identifier"; +import type { Meta } from "../hl7-fhir-r4-core/Meta"; +import type { Money } from "../hl7-fhir-r4-core/Money"; +import type { ParameterDefinition } from "../hl7-fhir-r4-core/ParameterDefinition"; +import type { Period } from "../hl7-fhir-r4-core/Period"; +import type { Quantity } from "../hl7-fhir-r4-core/Quantity"; +import type { Range } from "../hl7-fhir-r4-core/Range"; +import type { Ratio } from "../hl7-fhir-r4-core/Ratio"; +import type { Reference } from "../hl7-fhir-r4-core/Reference"; +import type { RelatedArtifact } from "../hl7-fhir-r4-core/RelatedArtifact"; +import type { SampledData } from "../hl7-fhir-r4-core/SampledData"; +import type { Signature } from "../hl7-fhir-r4-core/Signature"; +import type { Timing } from "../hl7-fhir-r4-core/Timing"; +import type { TriggerDefinition } from "../hl7-fhir-r4-core/TriggerDefinition"; +import type { UsageContext } from "../hl7-fhir-r4-core/UsageContext"; + +export type { Address } from "../hl7-fhir-r4-core/Address"; +export type { Age } from "../hl7-fhir-r4-core/Age"; +export type { Annotation } from "../hl7-fhir-r4-core/Annotation"; +export type { Attachment } from "../hl7-fhir-r4-core/Attachment"; +export type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +export type { Coding } from "../hl7-fhir-r4-core/Coding"; +export type { ContactDetail } from "../hl7-fhir-r4-core/ContactDetail"; +export type { ContactPoint } from "../hl7-fhir-r4-core/ContactPoint"; +export type { Contributor } from "../hl7-fhir-r4-core/Contributor"; +export type { Count } from "../hl7-fhir-r4-core/Count"; +export type { DataRequirement } from "../hl7-fhir-r4-core/DataRequirement"; +export type { Distance } from "../hl7-fhir-r4-core/Distance"; +export type { Dosage } from "../hl7-fhir-r4-core/Dosage"; +export type { Duration } from "../hl7-fhir-r4-core/Duration"; +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Expression } from "../hl7-fhir-r4-core/Expression"; +export type { HumanName } from "../hl7-fhir-r4-core/HumanName"; +export type { Identifier } from "../hl7-fhir-r4-core/Identifier"; +export type { Meta } from "../hl7-fhir-r4-core/Meta"; +export type { Money } from "../hl7-fhir-r4-core/Money"; +export type { ParameterDefinition } from "../hl7-fhir-r4-core/ParameterDefinition"; +export type { Period } from "../hl7-fhir-r4-core/Period"; +export type { Quantity } from "../hl7-fhir-r4-core/Quantity"; +export type { Range } from "../hl7-fhir-r4-core/Range"; +export type { Ratio } from "../hl7-fhir-r4-core/Ratio"; +export type { Reference } from "../hl7-fhir-r4-core/Reference"; +export type { RelatedArtifact } from "../hl7-fhir-r4-core/RelatedArtifact"; +export type { SampledData } from "../hl7-fhir-r4-core/SampledData"; +export type { Signature } from "../hl7-fhir-r4-core/Signature"; +export type { Timing } from "../hl7-fhir-r4-core/Timing"; +export type { TriggerDefinition } from "../hl7-fhir-r4-core/TriggerDefinition"; +export type { UsageContext } from "../hl7-fhir-r4-core/UsageContext"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Extension (pkg: hl7.fhir.r4.core#4.0.1) +export interface Extension extends Element { + url: string; + _url?: Element; + valueAddress?: Address; + valueAge?: Age; + valueAnnotation?: Annotation; + valueAttachment?: Attachment; + valueBase64Binary?: string; + _valueBase64Binary?: Element; + valueBoolean?: boolean; + _valueBoolean?: Element; + valueCanonical?: string; + _valueCanonical?: Element; + valueCode?: string; + _valueCode?: Element; + valueCodeableConcept?: CodeableConcept; + valueCoding?: Coding; + valueContactDetail?: ContactDetail; + valueContactPoint?: ContactPoint; + valueContributor?: Contributor; + valueCount?: Count; + valueDataRequirement?: DataRequirement; + valueDate?: string; + _valueDate?: Element; + valueDateTime?: string; + _valueDateTime?: Element; + valueDecimal?: number; + _valueDecimal?: Element; + valueDistance?: Distance; + valueDosage?: Dosage; + valueDuration?: Duration; + valueExpression?: Expression; + valueHumanName?: HumanName; + valueId?: string; + _valueId?: Element; + valueIdentifier?: Identifier; + valueInstant?: string; + _valueInstant?: Element; + valueInteger?: number; + _valueInteger?: Element; + valueMarkdown?: string; + _valueMarkdown?: Element; + valueMeta?: Meta; + valueMoney?: Money; + valueOid?: string; + _valueOid?: Element; + valueParameterDefinition?: ParameterDefinition; + valuePeriod?: Period; + valuePositiveInt?: number; + _valuePositiveInt?: Element; + valueQuantity?: Quantity; + valueRange?: Range; + valueRatio?: Ratio; + valueReference?: Reference; + valueRelatedArtifact?: RelatedArtifact; + valueSampledData?: SampledData; + valueSignature?: Signature; + valueString?: string; + _valueString?: Element; + valueTime?: string; + _valueTime?: Element; + valueTiming?: Timing; + valueTriggerDefinition?: TriggerDefinition; + valueUnsignedInt?: number; + _valueUnsignedInt?: Element; + valueUri?: string; + _valueUri?: Element; + valueUrl?: string; + _valueUrl?: Element; + valueUsageContext?: UsageContext; + valueUuid?: string; + _valueUuid?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/HumanName.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/HumanName.ts new file mode 100644 index 0000000..457f899 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/HumanName.ts @@ -0,0 +1,26 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Period } from "../hl7-fhir-r4-core/Period"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Period } from "../hl7-fhir-r4-core/Period"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/HumanName (pkg: hl7.fhir.r4.core#4.0.1) +export interface HumanName extends Element { + family?: string; + _family?: Element; + given?: string[]; + _given?: (Element | null)[]; + period?: Period; + prefix?: string[]; + _prefix?: (Element | null)[]; + suffix?: string[]; + _suffix?: (Element | null)[]; + text?: string; + _text?: Element; + use?: ("usual" | "official" | "temp" | "nickname" | "anonymous" | "old" | "maiden"); + _use?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Identifier.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Identifier.ts new file mode 100644 index 0000000..2171bdb --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Identifier.ts @@ -0,0 +1,26 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Period } from "../hl7-fhir-r4-core/Period"; +import type { Reference } from "../hl7-fhir-r4-core/Reference"; + +export type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Period } from "../hl7-fhir-r4-core/Period"; +export type { Reference } from "../hl7-fhir-r4-core/Reference"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Identifier (pkg: hl7.fhir.r4.core#4.0.1) +export interface Identifier extends Element { + assigner?: Reference<"Organization">; + period?: Period; + system?: string; + _system?: Element; + type?: CodeableConcept<("DL" | "PPN" | "BRN" | "MR" | "MCN" | "EN" | "TAX" | "NIIP" | "PRN" | "MD" | "DR" | "ACSN" | "UDI" | "SNO" | "SB" | "PLAC" | "FILL" | "JHN" | string)>; + use?: ("usual" | "official" | "temp" | "secondary" | "old"); + _use?: Element; + value?: string; + _value?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Meta.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Meta.ts new file mode 100644 index 0000000..0f90be8 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Meta.ts @@ -0,0 +1,23 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Coding } from "../hl7-fhir-r4-core/Coding"; +import type { Element } from "../hl7-fhir-r4-core/Element"; + +export type { Coding } from "../hl7-fhir-r4-core/Coding"; +export type { Element } from "../hl7-fhir-r4-core/Element"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Meta (pkg: hl7.fhir.r4.core#4.0.1) +export interface Meta extends Element { + lastUpdated?: string; + _lastUpdated?: Element; + profile?: string[]; + _profile?: (Element | null)[]; + security?: Coding[]; + source?: string; + _source?: Element; + tag?: Coding[]; + versionId?: string; + _versionId?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Money.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Money.ts new file mode 100644 index 0000000..4a63765 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Money.ts @@ -0,0 +1,15 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Money (pkg: hl7.fhir.r4.core#4.0.1) +export interface Money extends Element { + currency?: string; + _currency?: Element; + value?: number; + _value?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Narrative.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Narrative.ts new file mode 100644 index 0000000..572f021 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Narrative.ts @@ -0,0 +1,15 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Narrative (pkg: hl7.fhir.r4.core#4.0.1) +export interface Narrative extends Element { + div: string; + _div?: Element; + status: ("generated" | "extensions" | "additional" | "empty"); + _status?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Observation.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Observation.ts new file mode 100644 index 0000000..fc2a987 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Observation.ts @@ -0,0 +1,111 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Annotation } from "../hl7-fhir-r4-core/Annotation"; +import type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +import type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +import type { DomainResource } from "../hl7-fhir-r4-core/DomainResource"; +import type { Identifier } from "../hl7-fhir-r4-core/Identifier"; +import type { Period } from "../hl7-fhir-r4-core/Period"; +import type { Quantity } from "../hl7-fhir-r4-core/Quantity"; +import type { Range } from "../hl7-fhir-r4-core/Range"; +import type { Ratio } from "../hl7-fhir-r4-core/Ratio"; +import type { Reference } from "../hl7-fhir-r4-core/Reference"; +import type { SampledData } from "../hl7-fhir-r4-core/SampledData"; +import type { Timing } from "../hl7-fhir-r4-core/Timing"; + +import type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Annotation } from "../hl7-fhir-r4-core/Annotation"; +export type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +export type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +export type { Identifier } from "../hl7-fhir-r4-core/Identifier"; +export type { Period } from "../hl7-fhir-r4-core/Period"; +export type { Quantity } from "../hl7-fhir-r4-core/Quantity"; +export type { Range } from "../hl7-fhir-r4-core/Range"; +export type { Ratio } from "../hl7-fhir-r4-core/Ratio"; +export type { Reference } from "../hl7-fhir-r4-core/Reference"; +export type { SampledData } from "../hl7-fhir-r4-core/SampledData"; +export type { Timing } from "../hl7-fhir-r4-core/Timing"; + +export interface ObservationComponent extends BackboneElement { + code: CodeableConcept; + dataAbsentReason?: CodeableConcept<("unknown" | "asked-unknown" | "temp-unknown" | "not-asked" | "asked-declined" | "masked" | "not-applicable" | "unsupported" | "as-text" | "error" | "not-a-number" | "negative-infinity" | "positive-infinity" | "not-performed" | "not-permitted" | string)>; + interpretation?: CodeableConcept<("_GeneticObservationInterpretation" | "CAR" | "Carrier" | "_ObservationInterpretationChange" | "B" | "D" | "U" | "W" | "_ObservationInterpretationExceptions" | "<" | ">" | "AC" | "IE" | "QCF" | "TOX" | "_ObservationInterpretationNormality" | "A" | "AA" | "HH" | "LL" | "H" | "H>" | "HU" | "L" | "L<" | "LU" | "N" | "_ObservationInterpretationSusceptibility" | "I" | "MS" | "NCL" | "NS" | "R" | "SYN-R" | "S" | "SDD" | "SYN-S" | "VS" | "EX" | "HX" | "LX" | "HM" | "ObservationInterpretationDetection" | "IND" | "E" | "NEG" | "ND" | "POS" | "DET" | "ObservationInterpretationExpectation" | "EXP" | "UNE" | "OBX" | "ReactivityObservationInterpretation" | "NR" | "RR" | "WR" | string)>[]; + referenceRange?: ObservationReferenceRange[]; + valueBoolean?: boolean; + valueCodeableConcept?: CodeableConcept; + valueDateTime?: string; + valueInteger?: number; + valuePeriod?: Period; + valueQuantity?: Quantity; + valueRange?: Range; + valueRatio?: Ratio; + valueSampledData?: SampledData; + valueString?: string; + valueTime?: string; +} + +export interface ObservationReferenceRange extends BackboneElement { + age?: Range; + appliesTo?: CodeableConcept[]; + high?: Quantity; + low?: Quantity; + text?: string; + type?: CodeableConcept<("type" | "normal" | "recommended" | "treatment" | "therapeutic" | "pre" | "post" | "endocrine" | "pre-puberty" | "follicular" | "midcycle" | "luteal" | "postmenopausal" | string)>; +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Observation (pkg: hl7.fhir.r4.core#4.0.1) +export interface Observation extends DomainResource { + resourceType: "Observation"; + + basedOn?: Reference<"CarePlan" | "DeviceRequest" | "ImmunizationRecommendation" | "MedicationRequest" | "NutritionOrder" | "ServiceRequest">[]; + bodySite?: CodeableConcept; + category?: CodeableConcept<("social-history" | "vital-signs" | "imaging" | "laboratory" | "procedure" | "survey" | "exam" | "therapy" | "activity" | string)>[]; + code: CodeableConcept; + component?: ObservationComponent[]; + dataAbsentReason?: CodeableConcept<("unknown" | "asked-unknown" | "temp-unknown" | "not-asked" | "asked-declined" | "masked" | "not-applicable" | "unsupported" | "as-text" | "error" | "not-a-number" | "negative-infinity" | "positive-infinity" | "not-performed" | "not-permitted" | string)>; + derivedFrom?: Reference<"DocumentReference" | "ImagingStudy" | "Media" | "MolecularSequence" | "Observation" | "QuestionnaireResponse">[]; + device?: Reference<"Device" | "DeviceMetric">; + effectiveDateTime?: string; + _effectiveDateTime?: Element; + effectiveInstant?: string; + _effectiveInstant?: Element; + effectivePeriod?: Period; + effectiveTiming?: Timing; + encounter?: Reference<"Encounter">; + focus?: Reference<"Resource">[]; + hasMember?: Reference<"MolecularSequence" | "Observation" | "QuestionnaireResponse">[]; + identifier?: Identifier[]; + interpretation?: CodeableConcept<("_GeneticObservationInterpretation" | "CAR" | "Carrier" | "_ObservationInterpretationChange" | "B" | "D" | "U" | "W" | "_ObservationInterpretationExceptions" | "<" | ">" | "AC" | "IE" | "QCF" | "TOX" | "_ObservationInterpretationNormality" | "A" | "AA" | "HH" | "LL" | "H" | "H>" | "HU" | "L" | "L<" | "LU" | "N" | "_ObservationInterpretationSusceptibility" | "I" | "MS" | "NCL" | "NS" | "R" | "SYN-R" | "S" | "SDD" | "SYN-S" | "VS" | "EX" | "HX" | "LX" | "HM" | "ObservationInterpretationDetection" | "IND" | "E" | "NEG" | "ND" | "POS" | "DET" | "ObservationInterpretationExpectation" | "EXP" | "UNE" | "OBX" | "ReactivityObservationInterpretation" | "NR" | "RR" | "WR" | string)>[]; + issued?: string; + _issued?: Element; + method?: CodeableConcept; + note?: Annotation[]; + partOf?: Reference<"ImagingStudy" | "Immunization" | "MedicationAdministration" | "MedicationDispense" | "MedicationStatement" | "Procedure">[]; + performer?: Reference<"CareTeam" | "Organization" | "Patient" | "Practitioner" | "PractitionerRole" | "RelatedPerson">[]; + referenceRange?: ObservationReferenceRange[]; + specimen?: Reference<"Specimen">; + status: ("registered" | "preliminary" | "final" | "amended" | "corrected" | "cancelled" | "entered-in-error" | "unknown"); + _status?: Element; + subject?: Reference<"Device" | "Group" | "Location" | "Patient">; + valueBoolean?: boolean; + _valueBoolean?: Element; + valueCodeableConcept?: CodeableConcept; + valueDateTime?: string; + _valueDateTime?: Element; + valueInteger?: number; + _valueInteger?: Element; + valuePeriod?: Period; + valueQuantity?: Quantity; + valueRange?: Range; + valueRatio?: Ratio; + valueSampledData?: SampledData; + valueString?: string; + _valueString?: Element; + valueTime?: string; + _valueTime?: Element; +} +export const isObservation = (resource: unknown): resource is Observation => { + return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "Observation"; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/OperationOutcome.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/OperationOutcome.ts new file mode 100644 index 0000000..4d1f622 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/OperationOutcome.ts @@ -0,0 +1,29 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +import type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +import type { DomainResource } from "../hl7-fhir-r4-core/DomainResource"; + +export type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +export type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; + +export interface OperationOutcomeIssue extends BackboneElement { + code: ("invalid" | "structure" | "required" | "value" | "invariant" | "security" | "login" | "unknown" | "expired" | "forbidden" | "suppressed" | "processing" | "not-supported" | "duplicate" | "multiple-matches" | "not-found" | "deleted" | "too-long" | "code-invalid" | "extension" | "too-costly" | "business-rule" | "conflict" | "transient" | "lock-error" | "no-store" | "exception" | "timeout" | "incomplete" | "throttled" | "informational"); + details?: CodeableConcept; + diagnostics?: string; + expression?: string[]; + location?: string[]; + severity: ("fatal" | "error" | "warning" | "information"); +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/OperationOutcome (pkg: hl7.fhir.r4.core#4.0.1) +export interface OperationOutcome extends DomainResource { + resourceType: "OperationOutcome"; + + issue: OperationOutcomeIssue[]; +} +export const isOperationOutcome = (resource: unknown): resource is OperationOutcome => { + return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "OperationOutcome"; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/ParameterDefinition.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/ParameterDefinition.ts new file mode 100644 index 0000000..7b2b263 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/ParameterDefinition.ts @@ -0,0 +1,25 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/ParameterDefinition (pkg: hl7.fhir.r4.core#4.0.1) +export interface ParameterDefinition extends Element { + documentation?: string; + _documentation?: Element; + max?: string; + _max?: Element; + min?: number; + _min?: Element; + name?: string; + _name?: Element; + profile?: string; + _profile?: Element; + type: string; + _type?: Element; + use: ("in" | "out"); + _use?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Parameters.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Parameters.ts new file mode 100644 index 0000000..f2b4e57 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Parameters.ts @@ -0,0 +1,136 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Address } from "../hl7-fhir-r4-core/Address"; +import type { Age } from "../hl7-fhir-r4-core/Age"; +import type { Annotation } from "../hl7-fhir-r4-core/Annotation"; +import type { Attachment } from "../hl7-fhir-r4-core/Attachment"; +import type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +import type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +import type { Coding } from "../hl7-fhir-r4-core/Coding"; +import type { ContactDetail } from "../hl7-fhir-r4-core/ContactDetail"; +import type { ContactPoint } from "../hl7-fhir-r4-core/ContactPoint"; +import type { Contributor } from "../hl7-fhir-r4-core/Contributor"; +import type { Count } from "../hl7-fhir-r4-core/Count"; +import type { DataRequirement } from "../hl7-fhir-r4-core/DataRequirement"; +import type { Distance } from "../hl7-fhir-r4-core/Distance"; +import type { Dosage } from "../hl7-fhir-r4-core/Dosage"; +import type { Duration } from "../hl7-fhir-r4-core/Duration"; +import type { Expression } from "../hl7-fhir-r4-core/Expression"; +import type { HumanName } from "../hl7-fhir-r4-core/HumanName"; +import type { Identifier } from "../hl7-fhir-r4-core/Identifier"; +import type { Meta } from "../hl7-fhir-r4-core/Meta"; +import type { Money } from "../hl7-fhir-r4-core/Money"; +import type { ParameterDefinition } from "../hl7-fhir-r4-core/ParameterDefinition"; +import type { Period } from "../hl7-fhir-r4-core/Period"; +import type { Quantity } from "../hl7-fhir-r4-core/Quantity"; +import type { Range } from "../hl7-fhir-r4-core/Range"; +import type { Ratio } from "../hl7-fhir-r4-core/Ratio"; +import type { Reference } from "../hl7-fhir-r4-core/Reference"; +import type { RelatedArtifact } from "../hl7-fhir-r4-core/RelatedArtifact"; +import type { Resource } from "../hl7-fhir-r4-core/Resource"; +import type { SampledData } from "../hl7-fhir-r4-core/SampledData"; +import type { Signature } from "../hl7-fhir-r4-core/Signature"; +import type { Timing } from "../hl7-fhir-r4-core/Timing"; +import type { TriggerDefinition } from "../hl7-fhir-r4-core/TriggerDefinition"; +import type { UsageContext } from "../hl7-fhir-r4-core/UsageContext"; + +export type { Address } from "../hl7-fhir-r4-core/Address"; +export type { Age } from "../hl7-fhir-r4-core/Age"; +export type { Annotation } from "../hl7-fhir-r4-core/Annotation"; +export type { Attachment } from "../hl7-fhir-r4-core/Attachment"; +export type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +export type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +export type { Coding } from "../hl7-fhir-r4-core/Coding"; +export type { ContactDetail } from "../hl7-fhir-r4-core/ContactDetail"; +export type { ContactPoint } from "../hl7-fhir-r4-core/ContactPoint"; +export type { Contributor } from "../hl7-fhir-r4-core/Contributor"; +export type { Count } from "../hl7-fhir-r4-core/Count"; +export type { DataRequirement } from "../hl7-fhir-r4-core/DataRequirement"; +export type { Distance } from "../hl7-fhir-r4-core/Distance"; +export type { Dosage } from "../hl7-fhir-r4-core/Dosage"; +export type { Duration } from "../hl7-fhir-r4-core/Duration"; +export type { Expression } from "../hl7-fhir-r4-core/Expression"; +export type { HumanName } from "../hl7-fhir-r4-core/HumanName"; +export type { Identifier } from "../hl7-fhir-r4-core/Identifier"; +export type { Meta } from "../hl7-fhir-r4-core/Meta"; +export type { Money } from "../hl7-fhir-r4-core/Money"; +export type { ParameterDefinition } from "../hl7-fhir-r4-core/ParameterDefinition"; +export type { Period } from "../hl7-fhir-r4-core/Period"; +export type { Quantity } from "../hl7-fhir-r4-core/Quantity"; +export type { Range } from "../hl7-fhir-r4-core/Range"; +export type { Ratio } from "../hl7-fhir-r4-core/Ratio"; +export type { Reference } from "../hl7-fhir-r4-core/Reference"; +export type { RelatedArtifact } from "../hl7-fhir-r4-core/RelatedArtifact"; +export type { SampledData } from "../hl7-fhir-r4-core/SampledData"; +export type { Signature } from "../hl7-fhir-r4-core/Signature"; +export type { Timing } from "../hl7-fhir-r4-core/Timing"; +export type { TriggerDefinition } from "../hl7-fhir-r4-core/TriggerDefinition"; +export type { UsageContext } from "../hl7-fhir-r4-core/UsageContext"; + +export interface ParametersParameter extends BackboneElement { + name: string; + part?: ParametersParameter[]; + resource?: T; + valueAddress?: Address; + valueAge?: Age; + valueAnnotation?: Annotation; + valueAttachment?: Attachment; + valueBase64Binary?: string; + valueBoolean?: boolean; + valueCanonical?: string; + valueCode?: string; + valueCodeableConcept?: CodeableConcept; + valueCoding?: Coding; + valueContactDetail?: ContactDetail; + valueContactPoint?: ContactPoint; + valueContributor?: Contributor; + valueCount?: Count; + valueDataRequirement?: DataRequirement; + valueDate?: string; + valueDateTime?: string; + valueDecimal?: number; + valueDistance?: Distance; + valueDosage?: Dosage; + valueDuration?: Duration; + valueExpression?: Expression; + valueHumanName?: HumanName; + valueId?: string; + valueIdentifier?: Identifier; + valueInstant?: string; + valueInteger?: number; + valueMarkdown?: string; + valueMeta?: Meta; + valueMoney?: Money; + valueOid?: string; + valueParameterDefinition?: ParameterDefinition; + valuePeriod?: Period; + valuePositiveInt?: number; + valueQuantity?: Quantity; + valueRange?: Range; + valueRatio?: Ratio; + valueReference?: Reference; + valueRelatedArtifact?: RelatedArtifact; + valueSampledData?: SampledData; + valueSignature?: Signature; + valueString?: string; + valueTime?: string; + valueTiming?: Timing; + valueTriggerDefinition?: TriggerDefinition; + valueUnsignedInt?: number; + valueUri?: string; + valueUrl?: string; + valueUsageContext?: UsageContext; + valueUuid?: string; +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Parameters (pkg: hl7.fhir.r4.core#4.0.1) +export interface Parameters extends Resource { + resourceType: "Parameters"; + + parameter?: ParametersParameter[]; +} +export const isParameters = (resource: unknown): resource is Parameters => { + return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "Parameters"; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Patient.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Patient.ts new file mode 100644 index 0000000..05802a8 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Patient.ts @@ -0,0 +1,79 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Address } from "../hl7-fhir-r4-core/Address"; +import type { Attachment } from "../hl7-fhir-r4-core/Attachment"; +import type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +import type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +import type { ContactPoint } from "../hl7-fhir-r4-core/ContactPoint"; +import type { DomainResource } from "../hl7-fhir-r4-core/DomainResource"; +import type { HumanName } from "../hl7-fhir-r4-core/HumanName"; +import type { Identifier } from "../hl7-fhir-r4-core/Identifier"; +import type { Period } from "../hl7-fhir-r4-core/Period"; +import type { Reference } from "../hl7-fhir-r4-core/Reference"; + +import type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Address } from "../hl7-fhir-r4-core/Address"; +export type { Attachment } from "../hl7-fhir-r4-core/Attachment"; +export type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +export type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +export type { ContactPoint } from "../hl7-fhir-r4-core/ContactPoint"; +export type { HumanName } from "../hl7-fhir-r4-core/HumanName"; +export type { Identifier } from "../hl7-fhir-r4-core/Identifier"; +export type { Period } from "../hl7-fhir-r4-core/Period"; +export type { Reference } from "../hl7-fhir-r4-core/Reference"; + +export interface PatientCommunication extends BackboneElement { + language: CodeableConcept<("ar" | "bn" | "cs" | "da" | "de" | "de-AT" | "de-CH" | "de-DE" | "el" | "en" | "en-AU" | "en-CA" | "en-GB" | "en-IN" | "en-NZ" | "en-SG" | "en-US" | "es" | "es-AR" | "es-ES" | "es-UY" | "fi" | "fr" | "fr-BE" | "fr-CH" | "fr-FR" | "fy" | "fy-NL" | "hi" | "hr" | "it" | "it-CH" | "it-IT" | "ja" | "ko" | "nl" | "nl-BE" | "nl-NL" | "no" | "no-NO" | "pa" | "pl" | "pt" | "pt-BR" | "ru" | "ru-RU" | "sr" | "sr-RS" | "sv" | "sv-SE" | "te" | "zh" | "zh-CN" | "zh-HK" | "zh-SG" | "zh-TW" | string)>; + preferred?: boolean; +} + +export interface PatientContact extends BackboneElement { + address?: Address; + gender?: ("male" | "female" | "other" | "unknown"); + name?: HumanName; + organization?: Reference<"Organization">; + period?: Period; + relationship?: CodeableConcept[]; + telecom?: ContactPoint[]; +} + +export interface PatientLink extends BackboneElement { + other: Reference<"Patient" | "RelatedPerson">; + type: ("replaced-by" | "replaces" | "refer" | "seealso"); +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Patient (pkg: hl7.fhir.r4.core#4.0.1) +export interface Patient extends DomainResource { + resourceType: "Patient"; + + active?: boolean; + _active?: Element; + address?: Address[]; + birthDate?: string; + _birthDate?: Element; + communication?: PatientCommunication[]; + contact?: PatientContact[]; + deceasedBoolean?: boolean; + _deceasedBoolean?: Element; + deceasedDateTime?: string; + _deceasedDateTime?: Element; + gender?: ("male" | "female" | "other" | "unknown"); + _gender?: Element; + generalPractitioner?: Reference<"Organization" | "Practitioner" | "PractitionerRole">[]; + identifier?: Identifier[]; + link?: PatientLink[]; + managingOrganization?: Reference<"Organization">; + maritalStatus?: CodeableConcept<("A" | "D" | "I" | "L" | "M" | "P" | "S" | "T" | "U" | "W" | "UNK" | string)>; + multipleBirthBoolean?: boolean; + _multipleBirthBoolean?: Element; + multipleBirthInteger?: number; + _multipleBirthInteger?: Element; + name?: HumanName[]; + photo?: Attachment[]; + telecom?: ContactPoint[]; +} +export const isPatient = (resource: unknown): resource is Patient => { + return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "Patient"; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Period.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Period.ts new file mode 100644 index 0000000..5a87c3f --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Period.ts @@ -0,0 +1,15 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Period (pkg: hl7.fhir.r4.core#4.0.1) +export interface Period extends Element { + end?: string; + _end?: Element; + start?: string; + _start?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Provenance.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Provenance.ts new file mode 100644 index 0000000..2607e8b --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Provenance.ts @@ -0,0 +1,53 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +import type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +import type { DomainResource } from "../hl7-fhir-r4-core/DomainResource"; +import type { Period } from "../hl7-fhir-r4-core/Period"; +import type { Reference } from "../hl7-fhir-r4-core/Reference"; +import type { Signature } from "../hl7-fhir-r4-core/Signature"; + +import type { Element } from "../hl7-fhir-r4-core/Element"; +export type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +export type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +export type { Period } from "../hl7-fhir-r4-core/Period"; +export type { Reference } from "../hl7-fhir-r4-core/Reference"; +export type { Signature } from "../hl7-fhir-r4-core/Signature"; + +export interface ProvenanceAgent extends BackboneElement { + onBehalfOf?: Reference<"Device" | "Organization" | "Patient" | "Practitioner" | "PractitionerRole" | "RelatedPerson">; + role?: CodeableConcept[]; + type?: CodeableConcept<("enterer" | "performer" | "author" | "verifier" | "legal" | "attester" | "informant" | "custodian" | "assembler" | "composer" | string)>; + who: Reference<"Device" | "Organization" | "Patient" | "Practitioner" | "PractitionerRole" | "RelatedPerson">; +} + +export interface ProvenanceEntity extends BackboneElement { + agent?: ProvenanceAgent[]; + role: ("derivation" | "revision" | "quotation" | "source" | "removal"); + what: Reference<"Resource">; +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Provenance (pkg: hl7.fhir.r4.core#4.0.1) +export interface Provenance extends DomainResource { + resourceType: "Provenance"; + + activity?: CodeableConcept<("LA" | "ANONY" | "DEID" | "MASK" | "LABEL" | "PSEUD" | "CREATE" | "DELETE" | "UPDATE" | "APPEND" | "NULLIFY" | "PART" | "_ParticipationAncillary" | "ADM" | "ATND" | "CALLBCK" | "CON" | "DIS" | "ESC" | "REF" | "_ParticipationInformationGenerator" | "AUT" | "INF" | "TRANS" | "ENT" | "WIT" | "CST" | "DIR" | "ALY" | "BBY" | "CAT" | "CSM" | "TPA" | "DEV" | "NRD" | "RDV" | "DON" | "EXPAGNT" | "EXPART" | "EXPTRGT" | "EXSRC" | "PRD" | "SBJ" | "SPC" | "IND" | "BEN" | "CAGNT" | "COV" | "GUAR" | "HLD" | "RCT" | "RCV" | "IRCP" | "NOT" | "PRCP" | "REFB" | "REFT" | "TRC" | "LOC" | "DST" | "ELOC" | "ORG" | "RML" | "VIA" | "PRF" | "DIST" | "PPRF" | "SPRF" | "RESP" | "VRF" | "AUTHEN" | "LA" | string)>; + agent: ProvenanceAgent[]; + entity?: ProvenanceEntity[]; + location?: Reference<"Location">; + occurredDateTime?: string; + _occurredDateTime?: Element; + occurredPeriod?: Period; + policy?: string[]; + _policy?: (Element | null)[]; + reason?: CodeableConcept[]; + recorded: string; + _recorded?: Element; + signature?: Signature[]; + target: Reference<"Resource">[]; +} +export const isProvenance = (resource: unknown): resource is Provenance => { + return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "Provenance"; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Quantity.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Quantity.ts new file mode 100644 index 0000000..d7724c4 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Quantity.ts @@ -0,0 +1,21 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Quantity (pkg: hl7.fhir.r4.core#4.0.1) +export interface Quantity extends Element { + code?: string; + _code?: Element; + comparator?: ("<" | "<=" | ">=" | ">"); + _comparator?: Element; + system?: string; + _system?: Element; + unit?: string; + _unit?: Element; + value?: number; + _value?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Range.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Range.ts new file mode 100644 index 0000000..770d611 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Range.ts @@ -0,0 +1,15 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Quantity } from "../hl7-fhir-r4-core/Quantity"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Quantity } from "../hl7-fhir-r4-core/Quantity"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Range (pkg: hl7.fhir.r4.core#4.0.1) +export interface Range extends Element { + high?: Quantity; + low?: Quantity; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Ratio.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Ratio.ts new file mode 100644 index 0000000..a7b6611 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Ratio.ts @@ -0,0 +1,15 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Quantity } from "../hl7-fhir-r4-core/Quantity"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Quantity } from "../hl7-fhir-r4-core/Quantity"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Ratio (pkg: hl7.fhir.r4.core#4.0.1) +export interface Ratio extends Element { + denominator?: Quantity; + numerator?: Quantity; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Reference.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Reference.ts new file mode 100644 index 0000000..f59d6fe --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Reference.ts @@ -0,0 +1,20 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Identifier } from "../hl7-fhir-r4-core/Identifier"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Identifier } from "../hl7-fhir-r4-core/Identifier"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Reference (pkg: hl7.fhir.r4.core#4.0.1) +export interface Reference extends Element { + display?: string; + _display?: Element; + identifier?: Identifier; + reference?: `${T}/${string}`; + _reference?: Element; + type?: string; + _type?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/RelatedArtifact.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/RelatedArtifact.ts new file mode 100644 index 0000000..d3fa215 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/RelatedArtifact.ts @@ -0,0 +1,26 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Attachment } from "../hl7-fhir-r4-core/Attachment"; +import type { Element } from "../hl7-fhir-r4-core/Element"; + +export type { Attachment } from "../hl7-fhir-r4-core/Attachment"; +export type { Element } from "../hl7-fhir-r4-core/Element"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/RelatedArtifact (pkg: hl7.fhir.r4.core#4.0.1) +export interface RelatedArtifact extends Element { + citation?: string; + _citation?: Element; + display?: string; + _display?: Element; + document?: Attachment; + label?: string; + _label?: Element; + resource?: string; + _resource?: Element; + type: ("documentation" | "justification" | "citation" | "predecessor" | "successor" | "derived-from" | "depends-on" | "composed-of"); + _type?: Element; + url?: string; + _url?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Resource.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Resource.ts new file mode 100644 index 0000000..4483c1b --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Resource.ts @@ -0,0 +1,24 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Meta } from "../hl7-fhir-r4-core/Meta"; + +import type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Meta } from "../hl7-fhir-r4-core/Meta"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Resource (pkg: hl7.fhir.r4.core#4.0.1) +export interface Resource { + resourceType: "AllergyIntolerance" | "Bundle" | "DomainResource" | "Encounter" | "Observation" | "OperationOutcome" | "Parameters" | "Patient" | "Provenance" | "Resource"; + + id?: string; + _id?: Element; + implicitRules?: string; + _implicitRules?: Element; + language?: ("ar" | "bn" | "cs" | "da" | "de" | "de-AT" | "de-CH" | "de-DE" | "el" | "en" | "en-AU" | "en-CA" | "en-GB" | "en-IN" | "en-NZ" | "en-SG" | "en-US" | "es" | "es-AR" | "es-ES" | "es-UY" | "fi" | "fr" | "fr-BE" | "fr-CH" | "fr-FR" | "fy" | "fy-NL" | "hi" | "hr" | "it" | "it-CH" | "it-IT" | "ja" | "ko" | "nl" | "nl-BE" | "nl-NL" | "no" | "no-NO" | "pa" | "pl" | "pt" | "pt-BR" | "ru" | "ru-RU" | "sr" | "sr-RS" | "sv" | "sv-SE" | "te" | "zh" | "zh-CN" | "zh-HK" | "zh-SG" | "zh-TW" | string); + _language?: Element; + meta?: Meta; +} +export const isResource = (resource: unknown): resource is Resource => { + return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "Resource"; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/SampledData.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/SampledData.ts new file mode 100644 index 0000000..fdde08b --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/SampledData.ts @@ -0,0 +1,26 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Quantity } from "../hl7-fhir-r4-core/Quantity"; + +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Quantity } from "../hl7-fhir-r4-core/Quantity"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/SampledData (pkg: hl7.fhir.r4.core#4.0.1) +export interface SampledData extends Element { + data?: string; + _data?: Element; + dimensions: number; + _dimensions?: Element; + factor?: number; + _factor?: Element; + lowerLimit?: number; + _lowerLimit?: Element; + origin: Quantity; + period: number; + _period?: Element; + upperLimit?: number; + _upperLimit?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Signature.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Signature.ts new file mode 100644 index 0000000..5a46421 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Signature.ts @@ -0,0 +1,26 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Coding } from "../hl7-fhir-r4-core/Coding"; +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Reference } from "../hl7-fhir-r4-core/Reference"; + +export type { Coding } from "../hl7-fhir-r4-core/Coding"; +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Reference } from "../hl7-fhir-r4-core/Reference"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Signature (pkg: hl7.fhir.r4.core#4.0.1) +export interface Signature extends Element { + data?: string; + _data?: Element; + onBehalfOf?: Reference<"Device" | "Organization" | "Patient" | "Practitioner" | "PractitionerRole" | "RelatedPerson">; + sigFormat?: string; + _sigFormat?: Element; + targetFormat?: string; + _targetFormat?: Element; + type: Coding<("1.2.840.10065.1.12.1.1" | "1.2.840.10065.1.12.1.2" | "1.2.840.10065.1.12.1.3" | "1.2.840.10065.1.12.1.4" | "1.2.840.10065.1.12.1.5" | "1.2.840.10065.1.12.1.6" | "1.2.840.10065.1.12.1.7" | "1.2.840.10065.1.12.1.8" | "1.2.840.10065.1.12.1.9" | "1.2.840.10065.1.12.1.10" | "1.2.840.10065.1.12.1.11" | "1.2.840.10065.1.12.1.12" | "1.2.840.10065.1.12.1.13" | "1.2.840.10065.1.12.1.14" | "1.2.840.10065.1.12.1.15" | "1.2.840.10065.1.12.1.16" | "1.2.840.10065.1.12.1.17" | "1.2.840.10065.1.12.1.18" | string)>[]; + when: string; + _when?: Element; + who: Reference<"Device" | "Organization" | "Patient" | "Practitioner" | "PractitionerRole" | "RelatedPerson">; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Timing.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Timing.ts new file mode 100644 index 0000000..9564241 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/Timing.ts @@ -0,0 +1,45 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +import type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +import type { Duration } from "../hl7-fhir-r4-core/Duration"; +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Period } from "../hl7-fhir-r4-core/Period"; +import type { Range } from "../hl7-fhir-r4-core/Range"; + +export type { BackboneElement } from "../hl7-fhir-r4-core/BackboneElement"; +export type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +export type { Duration } from "../hl7-fhir-r4-core/Duration"; +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Period } from "../hl7-fhir-r4-core/Period"; +export type { Range } from "../hl7-fhir-r4-core/Range"; + +export interface TimingRepeat extends Element { + boundsDuration?: Duration; + boundsPeriod?: Period; + boundsRange?: Range; + count?: number; + countMax?: number; + dayOfWeek?: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[]; + duration?: number; + durationMax?: number; + durationUnit?: ("s" | "min" | "h" | "d" | "wk" | "mo" | "a"); + frequency?: number; + frequencyMax?: number; + offset?: number; + period?: number; + periodMax?: number; + periodUnit?: ("s" | "min" | "h" | "d" | "wk" | "mo" | "a"); + timeOfDay?: string[]; + when?: ("MORN" | "MORN.early" | "MORN.late" | "NOON" | "AFT" | "AFT.early" | "AFT.late" | "EVE" | "EVE.early" | "EVE.late" | "NIGHT" | "PHS" | "HS" | "WAKE" | "C" | "CM" | "CD" | "CV" | "AC" | "ACM" | "ACD" | "ACV" | "PC" | "PCM" | "PCD" | "PCV")[]; +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/Timing (pkg: hl7.fhir.r4.core#4.0.1) +export interface Timing extends BackboneElement { + code?: CodeableConcept<("BID" | "TID" | "QID" | "AM" | "PM" | "QD" | "QOD" | "Q1H" | "Q2H" | "Q3H" | "Q4H" | "Q6H" | "Q8H" | "BED" | "WK" | "MO" | string)>; + event?: string[]; + _event?: (Element | null)[]; + repeat?: TimingRepeat; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/TriggerDefinition.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/TriggerDefinition.ts new file mode 100644 index 0000000..293b3b4 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/TriggerDefinition.ts @@ -0,0 +1,31 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { DataRequirement } from "../hl7-fhir-r4-core/DataRequirement"; +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Expression } from "../hl7-fhir-r4-core/Expression"; +import type { Reference } from "../hl7-fhir-r4-core/Reference"; +import type { Timing } from "../hl7-fhir-r4-core/Timing"; + +export type { DataRequirement } from "../hl7-fhir-r4-core/DataRequirement"; +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Expression } from "../hl7-fhir-r4-core/Expression"; +export type { Reference } from "../hl7-fhir-r4-core/Reference"; +export type { Timing } from "../hl7-fhir-r4-core/Timing"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/TriggerDefinition (pkg: hl7.fhir.r4.core#4.0.1) +export interface TriggerDefinition extends Element { + condition?: Expression; + data?: DataRequirement[]; + name?: string; + _name?: Element; + timingDate?: string; + _timingDate?: Element; + timingDateTime?: string; + _timingDateTime?: Element; + timingReference?: Reference<"Schedule">; + timingTiming?: Timing; + type: ("named-event" | "periodic" | "data-changed" | "data-added" | "data-modified" | "data-removed" | "data-accessed" | "data-access-ended"); + _type?: Element; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/UsageContext.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/UsageContext.ts new file mode 100644 index 0000000..1969171 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/UsageContext.ts @@ -0,0 +1,26 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +import type { Coding } from "../hl7-fhir-r4-core/Coding"; +import type { Element } from "../hl7-fhir-r4-core/Element"; +import type { Quantity } from "../hl7-fhir-r4-core/Quantity"; +import type { Range } from "../hl7-fhir-r4-core/Range"; +import type { Reference } from "../hl7-fhir-r4-core/Reference"; + +export type { CodeableConcept } from "../hl7-fhir-r4-core/CodeableConcept"; +export type { Coding } from "../hl7-fhir-r4-core/Coding"; +export type { Element } from "../hl7-fhir-r4-core/Element"; +export type { Quantity } from "../hl7-fhir-r4-core/Quantity"; +export type { Range } from "../hl7-fhir-r4-core/Range"; +export type { Reference } from "../hl7-fhir-r4-core/Reference"; + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/UsageContext (pkg: hl7.fhir.r4.core#4.0.1) +export interface UsageContext extends Element { + code: Coding<("gender" | "age" | "focus" | "user" | "workflow" | "task" | "venue" | "species" | "program" | string)>; + valueCodeableConcept?: CodeableConcept; + valueQuantity?: Quantity; + valueRange?: Range; + valueReference?: Reference<"Group" | "HealthcareService" | "InsurancePlan" | "Location" | "Organization" | "PlanDefinition" | "ResearchStudy">; +} diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/index.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/index.ts new file mode 100644 index 0000000..689b954 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/index.ts @@ -0,0 +1,56 @@ +export * from "./profiles"; +export type { Address } from "./Address"; +export type { Age } from "./Age"; +export type { AllergyIntolerance, AllergyIntoleranceReaction } from "./AllergyIntolerance"; +export { isAllergyIntolerance } from "./AllergyIntolerance"; +export type { Annotation } from "./Annotation"; +export type { Attachment } from "./Attachment"; +export type { BackboneElement } from "./BackboneElement"; +export type { Bundle, BundleEntry, BundleEntryRequest, BundleEntryResponse, BundleEntrySearch, BundleLink } from "./Bundle"; +export { isBundle } from "./Bundle"; +export type { CodeableConcept } from "./CodeableConcept"; +export type { Coding } from "./Coding"; +export type { ContactDetail } from "./ContactDetail"; +export type { ContactPoint } from "./ContactPoint"; +export type { Contributor } from "./Contributor"; +export type { Count } from "./Count"; +export type { DataRequirement } from "./DataRequirement"; +export type { Distance } from "./Distance"; +export type { DomainResource } from "./DomainResource"; +export { isDomainResource } from "./DomainResource"; +export type { Dosage } from "./Dosage"; +export type { Duration } from "./Duration"; +export type { Element } from "./Element"; +export type { Encounter, EncounterClassHistory, EncounterDiagnosis, EncounterHospitalization, EncounterLocation, EncounterParticipant, EncounterStatusHistory } from "./Encounter"; +export { isEncounter } from "./Encounter"; +export type { Expression } from "./Expression"; +export type { Extension } from "./Extension"; +export type { HumanName } from "./HumanName"; +export type { Identifier } from "./Identifier"; +export type { Meta } from "./Meta"; +export type { Money } from "./Money"; +export type { Narrative } from "./Narrative"; +export type { Observation, ObservationComponent, ObservationReferenceRange } from "./Observation"; +export { isObservation } from "./Observation"; +export type { OperationOutcome, OperationOutcomeIssue } from "./OperationOutcome"; +export { isOperationOutcome } from "./OperationOutcome"; +export type { ParameterDefinition } from "./ParameterDefinition"; +export type { Parameters, ParametersParameter } from "./Parameters"; +export { isParameters } from "./Parameters"; +export type { Patient, PatientCommunication, PatientContact, PatientLink } from "./Patient"; +export { isPatient } from "./Patient"; +export type { Period } from "./Period"; +export type { Provenance, ProvenanceAgent, ProvenanceEntity } from "./Provenance"; +export { isProvenance } from "./Provenance"; +export type { Quantity } from "./Quantity"; +export type { Range } from "./Range"; +export type { Ratio } from "./Ratio"; +export type { Reference } from "./Reference"; +export type { RelatedArtifact } from "./RelatedArtifact"; +export type { Resource } from "./Resource"; +export { isResource } from "./Resource"; +export type { SampledData } from "./SampledData"; +export type { Signature } from "./Signature"; +export type { Timing } from "./Timing"; +export type { TriggerDefinition } from "./TriggerDefinition"; +export type { UsageContext } from "./UsageContext"; diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_birthPlace.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_birthPlace.ts new file mode 100644 index 0000000..1dbdc3f --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_birthPlace.ts @@ -0,0 +1,97 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Address } from "../../hl7-fhir-r4-core/Address"; +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type birthPlaceProfileRaw = { + valueAddress: Address; +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/patient-birthPlace (pkg: hl7.fhir.r4.core#4.0.1) +export class birthPlaceProfile { + static readonly canonicalUrl = "http://hl7.org/fhir/StructureDefinition/patient-birthPlace"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : birthPlaceProfile { + const profile = new birthPlaceProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : birthPlaceProfile { + return new birthPlaceProfile(resource); + } + + static createResource (args: birthPlaceProfileRaw) : Extension { + const resource = buildResource( { + url: "http://hl7.org/fhir/StructureDefinition/patient-birthPlace", + valueAddress: args.valueAddress, + }) + return resource; + } + + static create (args: birthPlaceProfileRaw) : birthPlaceProfile { + return birthPlaceProfile.apply(birthPlaceProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getValueAddress () : Address | undefined { + return this.resource.valueAddress as Address | undefined; + } + + setValueAddress (value: Address) : this { + Object.assign(this.resource, { valueAddress: value }); + return this; + } + + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "birthPlace" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", birthPlaceProfile.canonicalUrl), + ...validateChoiceRequired(res, profileName, ["valueAddress"]), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_birthTime.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_birthTime.ts new file mode 100644 index 0000000..0eb6066 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_birthTime.ts @@ -0,0 +1,96 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type birthTimeProfileRaw = { + valueDateTime: string; +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/patient-birthTime (pkg: hl7.fhir.r4.core#4.0.1) +export class birthTimeProfile { + static readonly canonicalUrl = "http://hl7.org/fhir/StructureDefinition/patient-birthTime"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : birthTimeProfile { + const profile = new birthTimeProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : birthTimeProfile { + return new birthTimeProfile(resource); + } + + static createResource (args: birthTimeProfileRaw) : Extension { + const resource = buildResource( { + url: "http://hl7.org/fhir/StructureDefinition/patient-birthTime", + valueDateTime: args.valueDateTime, + }) + return resource; + } + + static create (args: birthTimeProfileRaw) : birthTimeProfile { + return birthTimeProfile.apply(birthTimeProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getValueDateTime () : string | undefined { + return this.resource.valueDateTime as string | undefined; + } + + setValueDateTime (value: string) : this { + Object.assign(this.resource, { valueDateTime: value }); + return this; + } + + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "birthTime" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", birthTimeProfile.canonicalUrl), + ...validateChoiceRequired(res, profileName, ["valueDateTime"]), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_cadavericDonor.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_cadavericDonor.ts new file mode 100644 index 0000000..98d202b --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_cadavericDonor.ts @@ -0,0 +1,96 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type cadavericDonorProfileRaw = { + valueBoolean: boolean; +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/patient-cadavericDonor (pkg: hl7.fhir.r4.core#4.0.1) +export class cadavericDonorProfile { + static readonly canonicalUrl = "http://hl7.org/fhir/StructureDefinition/patient-cadavericDonor"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : cadavericDonorProfile { + const profile = new cadavericDonorProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : cadavericDonorProfile { + return new cadavericDonorProfile(resource); + } + + static createResource (args: cadavericDonorProfileRaw) : Extension { + const resource = buildResource( { + url: "http://hl7.org/fhir/StructureDefinition/patient-cadavericDonor", + valueBoolean: args.valueBoolean, + }) + return resource; + } + + static create (args: cadavericDonorProfileRaw) : cadavericDonorProfile { + return cadavericDonorProfile.apply(cadavericDonorProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getValueBoolean () : boolean | undefined { + return this.resource.valueBoolean as boolean | undefined; + } + + setValueBoolean (value: boolean) : this { + Object.assign(this.resource, { valueBoolean: value }); + return this; + } + + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "cadavericDonor" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", cadavericDonorProfile.canonicalUrl), + ...validateChoiceRequired(res, profileName, ["valueBoolean"]), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_interpreterRequired.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_interpreterRequired.ts new file mode 100644 index 0000000..1509d84 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_interpreterRequired.ts @@ -0,0 +1,96 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type interpreterRequiredProfileRaw = { + valueBoolean: boolean; +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/patient-interpreterRequired (pkg: hl7.fhir.r4.core#4.0.1) +export class interpreterRequiredProfile { + static readonly canonicalUrl = "http://hl7.org/fhir/StructureDefinition/patient-interpreterRequired"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : interpreterRequiredProfile { + const profile = new interpreterRequiredProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : interpreterRequiredProfile { + return new interpreterRequiredProfile(resource); + } + + static createResource (args: interpreterRequiredProfileRaw) : Extension { + const resource = buildResource( { + url: "http://hl7.org/fhir/StructureDefinition/patient-interpreterRequired", + valueBoolean: args.valueBoolean, + }) + return resource; + } + + static create (args: interpreterRequiredProfileRaw) : interpreterRequiredProfile { + return interpreterRequiredProfile.apply(interpreterRequiredProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getValueBoolean () : boolean | undefined { + return this.resource.valueBoolean as boolean | undefined; + } + + setValueBoolean (value: boolean) : this { + Object.assign(this.resource, { valueBoolean: value }); + return this; + } + + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "interpreterRequired" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", interpreterRequiredProfile.canonicalUrl), + ...validateChoiceRequired(res, profileName, ["valueBoolean"]), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_proficiency.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_proficiency.ts new file mode 100644 index 0000000..e882647 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/Extension_proficiency.ts @@ -0,0 +1,145 @@ +// WARNING: This file is autogenerated by @atomic-ehr/codegen. +// GitHub: https://github.com/atomic-ehr/codegen +// Any manual changes made to this file may be overwritten. + +import type { Coding } from "../../hl7-fhir-r4-core/Coding"; +import type { Extension } from "../../hl7-fhir-r4-core/Extension"; + +import { + buildResource, + isRawExtensionInput, + isExtension, + getExtensionValue, + pushExtension, + validateRequired, + validateExcluded, + validateFixedValue, + validateSliceCardinality, + validateEnum, + validateReference, + validateChoiceRequired, + validateMustSupport, +} from "../../profile-helpers"; + +export type proficiencyProfileRaw = { + extension?: Extension[]; +} + +export type proficiencyProfileFlat = { + level?: Coding; + type?: Coding[]; +} + +// CanonicalURL: http://hl7.org/fhir/StructureDefinition/patient-proficiency (pkg: hl7.fhir.r4.core#4.0.1) +export class proficiencyProfile { + static readonly canonicalUrl = "http://hl7.org/fhir/StructureDefinition/patient-proficiency"; + + private resource: Extension; + + constructor (resource: Extension) { + this.resource = resource; + } + + static from (resource: Extension) : proficiencyProfile { + const profile = new proficiencyProfile(resource); + const { errors } = profile.validate(); + if (errors.length > 0) throw new Error(errors.join("; ")) + return profile; + } + + static apply (resource: Extension) : proficiencyProfile { + return new proficiencyProfile(resource); + } + + private static resolveInput (args: proficiencyProfileRaw | proficiencyProfileFlat) : Extension[] { + if (isRawExtensionInput(args)) { + return args.extension ?? []; + } else { + const result: Extension[] = []; + if (args.level !== undefined) { + result.push({ url: "level", valueCoding: args.level } as Extension); + } + if (args.type) { + for (const item of args.type) { + result.push({ url: "type", valueCoding: item } as Extension); + } + } + return result; + } + } + + static createResource (args?: proficiencyProfileRaw | proficiencyProfileFlat) : Extension { + const resolvedExtensions = proficiencyProfile.resolveInput(args ?? {}); + + const resource = buildResource( { + url: "http://hl7.org/fhir/StructureDefinition/patient-proficiency", + extension: resolvedExtensions, + }) + return resource; + } + + static create (args?: proficiencyProfileRaw | proficiencyProfileFlat) : proficiencyProfile { + return proficiencyProfile.apply(proficiencyProfile.createResource(args)); + } + + toResource () : Extension { + return this.resource; + } + + // Field accessors + getUrl () : string | undefined { + return this.resource.url as string | undefined; + } + + setUrl (value: string) : this { + Object.assign(this.resource, { url: value }); + return this; + } + + // Extensions + public setLevel (value: Coding): this { + pushExtension(this.resource, { url: "level", valueCoding: value } as Extension) + return this + } + + public getLevel(mode: 'flat'): Coding | undefined; + public getLevel(mode: 'raw'): Extension | undefined; + public getLevel(): Coding | undefined; + public getLevel (mode: 'flat' | 'raw' = 'flat'): Coding | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "level") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue(ext, "valueCoding") + } + + public setType (value: Coding): this { + pushExtension(this.resource, { url: "type", valueCoding: value } as Extension) + return this + } + + public getType(mode: 'flat'): Coding | undefined; + public getType(mode: 'raw'): Extension | undefined; + public getType(): Coding | undefined; + public getType (mode: 'flat' | 'raw' = 'flat'): Coding | Extension | undefined { + const ext = this.resource.extension?.find(e => e.url === "type") + if (!ext) return undefined + if (mode === 'raw') return ext + return getExtensionValue(ext, "valueCoding") + } + + // Slices + // Validation + validate(): { errors: string[]; warnings: string[] } { + const profileName = "proficiency" + const res = this.resource + return { + errors: [ + ...validateRequired(res, profileName, "url"), + ...validateFixedValue(res, profileName, "url", proficiencyProfile.canonicalUrl), + ], + warnings: [], + } + } + +} + diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/index.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/index.ts new file mode 100644 index 0000000..148d533 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/hl7-fhir-r4-core/profiles/index.ts @@ -0,0 +1,5 @@ +export { birthPlaceProfile } from "./Extension_birthPlace"; +export { birthTimeProfile } from "./Extension_birthTime"; +export { cadavericDonorProfile } from "./Extension_cadavericDonor"; +export { interpreterRequiredProfile } from "./Extension_interpreterRequired"; +export { proficiencyProfile } from "./Extension_proficiency"; diff --git a/aidbox-features/aidbox-orchestration-service/src/fhir-types/profile-helpers.ts b/aidbox-features/aidbox-orchestration-service/src/fhir-types/profile-helpers.ts new file mode 100644 index 0000000..9191c8f --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/fhir-types/profile-helpers.ts @@ -0,0 +1,412 @@ +/** + * Runtime helpers for generated FHIR profile classes. + * + * This file is copied verbatim into every generated TypeScript output and + * imported by profile modules. It provides: + * + * - **Slice helpers** – match, get, set, and default-fill array slices + * defined by a FHIR StructureDefinition. + * - **Extension helpers** – read complex (nested) FHIR extensions into + * plain objects. + * - **Choice-type helpers** – wrap/unwrap polymorphic `value[x]` fields so + * profile classes can expose a flat API. + * - **Validation helpers** – lightweight structural checks that profile + * classes call from their `validate()` method. + * - **Misc utilities** – deep-match, deep-merge, path navigation. + */ + +// --------------------------------------------------------------------------- +// General utilities +// --------------------------------------------------------------------------- + +/** Type guard: `value` is a non-null, non-array plain object. */ +export const isRecord = (value: unknown): value is Record => { + return value !== null && typeof value === "object" && !Array.isArray(value); +}; + +/** + * Walk `path` segments from `root`, creating intermediate objects (or using + * the first element of an existing array) as needed. Returns the leaf object. + * + * Used by extension setters to reach a nested target inside a resource. + * + * @example + * ensurePath(resource, ["contact", "telecom"]) + * // → resource.contact.telecom (created if absent) + */ +export const ensurePath = (root: Record, path: string[]): Record => { + let current: Record = root; + for (const segment of path) { + if (Array.isArray(current[segment])) { + const list = current[segment] as unknown[]; + if (list.length === 0) { + list.push({}); + } + current = list[0] as Record; + } else { + if (!isRecord(current[segment])) { + current[segment] = {}; + } + current = current[segment] as Record; + } + } + return current; +}; + +// --------------------------------------------------------------------------- +// Deep match / merge +// --------------------------------------------------------------------------- + +/** + * Deep-merge `match` into `target`, mutating `target` in place. + * Skips prototype-pollution keys. Used internally by {@link applySliceMatch}. + */ +export const mergeMatch = (target: Record, match: Record): void => { + for (const [key, matchValue] of Object.entries(match)) { + if (key === "__proto__" || key === "constructor" || key === "prototype") { + continue; + } + if (isRecord(matchValue)) { + if (isRecord(target[key])) { + mergeMatch(target[key] as Record, matchValue); + } else { + target[key] = { ...matchValue }; + } + } else { + target[key] = matchValue; + } + } +}; + +/** + * Shallow-clone `input` then deep-merge the slice discriminator values from + * `match` on top, returning a complete slice element ready for insertion. + * + * @example + * applySliceMatch({ text: "hi" }, { coding: { code: "vital-signs", system: "…" } }) + * // → { text: "hi", coding: { code: "vital-signs", system: "…" } } + */ +export const applySliceMatch = (input: Partial, match: Partial>): T => { + const result = { ...input } as Record; + mergeMatch(result, match); + return result as T; +}; + +/** + * Recursively test whether `value` structurally contains everything in + * `match`. Arrays are matched with "every match item has a corresponding + * value item" semantics; objects are matched key-by-key; primitives use `===`. + * + * This is the core discriminator check used to identify which array element + * belongs to a given FHIR slice. + */ +export const matchesValue = (value: unknown, match: unknown): boolean => { + if (Array.isArray(match)) { + if (!Array.isArray(value)) { + return false; + } + return match.every((matchItem) => value.some((item) => matchesValue(item, matchItem))); + } + if (isRecord(match)) { + if (!isRecord(value)) { + return false; + } + for (const [key, matchValue] of Object.entries(match)) { + if (!matchesValue((value as Record)[key], matchValue)) { + return false; + } + } + return true; + } + return value === match; +}; + +/** + * Type guard that discriminates a raw extension input (with an `extension` + * array) from a flat-API input object. Using a custom type guard instead of + * a bare `"extension" in args` lets TypeScript narrow *both* branches of the + * union — the plain `in` check cannot eliminate a type whose `extension` + * property is optional. + */ +export const isRawExtensionInput = (input: object): input is TRaw => "extension" in input; + +/** + * Type guard that tests whether an unknown setter input is a raw Extension + * (i.e. an object with a `url` property). When `url` is provided, also + * checks that the extension's URL matches the expected value. + */ +export const isExtension = (input: unknown, url?: string): input is E => + typeof input === "object" && input !== null && "url" in input && (url === undefined || input.url === url); + +/** + * Read a single typed value field from an Extension, returning `undefined` + * when the extension itself is absent or the field is not set. + * + * This avoids the double-cast `(ext as Record<…>)?.field as T` that would + * otherwise be needed for value fields not declared on the base Extension type. + */ +export const getExtensionValue = (ext: { url?: string } | undefined, field: string): T | undefined => { + if (!ext) return undefined; + return (ext as Record)[field] as T | undefined; +}; + +/** + * Push an extension onto `target.extension`, creating the array if absent. + */ +export const pushExtension = (target: { extension?: E[] }, ext: E): void => { + (target.extension ??= []).push(ext); +}; + +// --------------------------------------------------------------------------- +// Extension helpers +// --------------------------------------------------------------------------- + +/** + * Read a complex (nested) FHIR extension into a plain key/value object. + * + * Each entry in `config` describes one sub-extension by URL, the name of its + * value field (e.g. `"valueString"`), and whether it may repeat. + * + * @returns A record keyed by sub-extension URL, or `undefined` if the + * extension has no nested children. + */ +export const extractComplexExtension = >( + extension: { extension?: Array<{ url?: string }> } | undefined, + config: Array<{ name: string; valueField: string; isArray: boolean }>, +): T | undefined => { + if (!extension?.extension) return undefined; + const result: Record = {}; + for (const { name, valueField, isArray } of config) { + const subExts = extension.extension.filter((e) => e.url === name); + if (isArray) { + result[name] = subExts.map((e) => (e as Record)[valueField]); + } else if (subExts[0]) { + result[name] = (subExts[0] as Record)[valueField]; + } + } + return result as T; +}; + +// --------------------------------------------------------------------------- +// Slice helpers +// --------------------------------------------------------------------------- + +/** + * Remove discriminator keys from a slice element, returning only the + * user-supplied portion. Used by slice getters so callers see a clean object + * without the fixed discriminator values baked in. + */ +export const stripMatchKeys = (slice: object, matchKeys: string[]): T => { + const result = { ...slice } as Record; + for (const key of matchKeys) { + delete result[key]; + } + return result as T; +}; + +/** + * Wrap a flat input object under a choice-type key before inserting into a + * slice. For example, a Quantity value destined for `valueQuantity` is + * wrapped as `{ valueQuantity: { ...input } }`. + * + * No-op when `input` is empty (the slice will contain only discriminator + * defaults). + */ +export const wrapSliceChoice = (input: object, choiceVariant: string): Partial => { + if (Object.keys(input).length === 0) return input as Partial; + return { [choiceVariant]: input } as Partial; +}; + +/** + * Inverse of {@link wrapSliceChoice}: strip discriminator keys, then hoist + * the value inside `choiceVariant` up to the top level. + * + * @example + * unwrapSliceChoice(raw, ["code"], "valueQuantity") + * // removes "code", moves raw.valueQuantity.* to top level + */ +export const unwrapSliceChoice = (slice: object, matchKeys: string[], choiceVariant: string): T => { + const result = { ...slice } as Record; + for (const key of matchKeys) { + delete result[key]; + } + const variantValue = result[choiceVariant]; + delete result[choiceVariant]; + if (isRecord(variantValue)) { + Object.assign(result, variantValue); + } + return result as T; +}; + +/** + * Ensure that every required slice has at least a stub element in the array. + * Each `match` is a discriminator pattern; if no existing item satisfies it, + * a deep clone of the pattern is appended. + * + * Called in `createResource` so that required slices are always present even + * when the caller omits them. + */ +export const ensureSliceDefaults = (items: T[], ...matches: Record[]): T[] => { + for (const match of matches) { + if (!items.some((item) => matchesValue(item, match))) { + items.push(structuredClone(match) as T); + } + } + return items; +}; + +/** + * Cast an object literal to a FHIR resource type. This centralises the single + * `as unknown as T` that is unavoidable when constructing a resource from a + * plain object (deep inheritance prevents direct structural compatibility). + */ +export const buildResource = (obj: object): T => obj as unknown as T; + +/** + * Add `canonicalUrl` to `resource.meta.profile` if not already present. + * Creates `meta` and `profile` when missing. + */ +export const ensureProfile = (resource: { meta?: { profile?: string[] } }, canonicalUrl: string): void => { + const meta = (resource.meta ??= {}); + const profiles = (meta.profile ??= []); + if (!profiles.includes(canonicalUrl)) profiles.push(canonicalUrl); +}; + +/** + * Find or insert a slice element in `list`. If an element matching `match` + * already exists it is replaced in place; otherwise `value` is appended. + */ +export const setArraySlice = (list: T[], match: Record, value: T): void => { + const index = list.findIndex((item) => matchesValue(item, match)); + if (index === -1) { + list.push(value); + } else { + list[index] = value; + } +}; + +/** Return the first element in `list` that satisfies the slice discriminator `match`. */ +export const getArraySlice = (list: readonly T[] | undefined, match: Record): T | undefined => { + if (!list) return undefined; + return list.find((item) => matchesValue(item, match)); +}; + +// --------------------------------------------------------------------------- +// Validation helpers +// +// Each function returns an array of human-readable error strings (empty = ok). +// Profile classes spread them all into a single array from `validate()`. +// --------------------------------------------------------------------------- + +/** Checks that `field` is present (not `undefined` or `null`). */ +export const validateRequired = (res: object, profileName: string, field: string): string[] => { + const rec = res as Record; + return rec[field] === undefined || rec[field] === null + ? [`${profileName}: required field '${field}' is missing`] + : []; +}; + +/** Checks that a must-support field is populated (warning, not error). */ +export const validateMustSupport = (res: object, profileName: string, field: string): string[] => { + const rec = res as Record; + return rec[field] === undefined || rec[field] === null + ? [`${profileName}: must-support field '${field}' is not populated`] + : []; +}; + +/** Checks that `field` is absent (profiles may exclude base fields). */ +export const validateExcluded = (res: object, profileName: string, field: string): string[] => { + return (res as Record)[field] !== undefined + ? [`${profileName}: field '${field}' must not be present`] + : []; +}; + +/** Checks that `field` structurally contains the expected fixed value. */ +export const validateFixedValue = (res: object, profileName: string, field: string, expected: unknown): string[] => { + return matchesValue((res as Record)[field], expected) + ? [] + : [`${profileName}: field '${field}' does not match expected fixed value`]; +}; + +/** + * Checks that the number of array elements matching `match` (a slice + * discriminator) falls within [`min`, `max`]. Pass `max = 0` for unbounded. + */ +export const validateSliceCardinality = ( + res: object, + profileName: string, + field: string, + match: Record, + sliceName: string, + min: number, + max: number, +): string[] => { + const items = (res as Record)[field] as unknown[] | undefined; + const count = (items ?? []).filter((item) => matchesValue(item, match)).length; + const errors: string[] = []; + if (count < min) { + errors.push(`${profileName}.${field}: slice '${sliceName}' requires at least ${min} item(s), found ${count}`); + } + if (max > 0 && count > max) { + errors.push(`${profileName}.${field}: slice '${sliceName}' allows at most ${max} item(s), found ${count}`); + } + return errors; +}; + +/** + * Checks that at least one of the listed choice-type variants is present. + * E.g. `["effectiveDateTime", "effectivePeriod"]`. + */ +export const validateChoiceRequired = (res: object, profileName: string, choices: string[]): string[] => { + const rec = res as Record; + return choices.some((c) => rec[c] !== undefined) + ? [] + : [`${profileName}: at least one of ${choices.join(", ")} is required`]; +}; + +/** + * Checks that the value of `field` has a code within `allowed`. + * Handles plain strings, Coding objects, and CodeableConcept objects. + * Skips validation when the field is absent. + */ +export const validateEnum = (res: object, profileName: string, field: string, allowed: string[]): string[] => { + const value = (res as Record)[field]; + if (value === undefined || value === null) return []; + if (typeof value === "string") { + return allowed.includes(value) + ? [] + : [`${profileName}: field '${field}' value '${value}' is not in allowed values`]; + } + const rec = value as Record; + // Coding + if (typeof rec.code === "string" && rec.system !== undefined) { + return allowed.includes(rec.code) + ? [] + : [`${profileName}: field '${field}' code '${rec.code}' is not in allowed values`]; + } + // CodeableConcept + if (Array.isArray(rec.coding)) { + const codes = (rec.coding as Record[]).map((c) => c.code as string).filter(Boolean); + const hasValid = codes.some((c) => allowed.includes(c)); + return hasValid ? [] : [`${profileName}: field '${field}' has no coding with an allowed code`]; + } + return []; +}; + +/** + * Checks that a Reference field points to one of the `allowed` resource + * types. Extracts the type from the `reference` string (the part before + * the first `/`). Skips validation when the field or reference is absent. + */ +export const validateReference = (res: object, profileName: string, field: string, allowed: string[]): string[] => { + const value = (res as Record)[field]; + if (value === undefined || value === null) return []; + const ref = (value as Record).reference as string | undefined; + if (!ref) return []; + const slashIdx = ref.indexOf("/"); + if (slashIdx === -1) return []; + const refType = ref.slice(0, slashIdx); + return allowed.includes(refType) + ? [] + : [`${profileName}: field '${field}' references '${refType}' but only ${allowed.join(", ")} are allowed`]; +}; diff --git a/aidbox-features/aidbox-orchestration-service/src/index.ts b/aidbox-features/aidbox-orchestration-service/src/index.ts new file mode 100644 index 0000000..21ec893 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/index.ts @@ -0,0 +1,207 @@ +/** + * FHIR Orchestration Service + * Exposes $getstructuredrecord operation that fetches from multiple sources, + * deduplicates, stores with provenance, and returns merged bundle. + */ + +import { + SmartBackendServicesAuthProvider, + BasicAuthProvider, + importPrivateKey, + type FhirSource, +} from "./fhir-clients"; +import { orchestrate, parseNhsNumberFromParameters } from "./orchestration"; +import type { Parameters, OperationOutcome } from "./fhir-types/hl7-fhir-r4-core"; + +// ============ Configuration ============ + +// Environment variables with defaults +const PORT = parseInt(process.env.PORT ?? "3000"); +const FHIR_SERVER_URL = process.env.FHIR_SERVER_URL ?? "http://localhost:8080"; +const GENERAL_PRACTICE_URL = process.env.GENERAL_PRACTICE_URL ?? "http://localhost:8081"; +const HOSPITAL_URL = process.env.HOSPITAL_URL ?? "http://localhost:8082"; + +// SMART Backend Services credentials +const SMART_PRIVATE_KEY_PEM = process.env.SMART_PRIVATE_KEY ?? ""; +const SMART_KEY_ID = process.env.SMART_KEY_ID ?? "test-key-001"; +const SMART_CLIENT_ID = process.env.SMART_CLIENT_ID ?? "orchestration-service"; + +// ============ Auth Providers (initialized async) ============ + +const mainFhirAuth = new BasicAuthProvider(FHIR_SERVER_URL, "root", "secret"); +const hospitalAuth = new BasicAuthProvider(HOSPITAL_URL, "orchestration-service", "basic-auth-secret"); + +let sources: FhirSource[] = []; + +async function initializeAuthProviders(): Promise { + if (!SMART_PRIVATE_KEY_PEM) { + throw new Error("SMART_PRIVATE_KEY environment variable is required"); + } + + const privateKey = await importPrivateKey(SMART_PRIVATE_KEY_PEM); + + const generalPracticeAuth = new SmartBackendServicesAuthProvider({ + baseUrl: GENERAL_PRACTICE_URL, + clientId: SMART_CLIENT_ID, + privateKey, + keyId: SMART_KEY_ID, + scope: "system/*.read", + allowInsecureRequests: true, + }); + + sources = [ + { name: "gp", auth: generalPracticeAuth }, + { name: "hospital", auth: hospitalAuth }, + ]; +} + +// ============ Error Response Helpers ============ + +type IssueCode = "invalid" | "structure" | "required" | "value" | "invariant" | "security" | "login" | "unknown" | "expired" | "forbidden" | "suppressed" | "processing" | "not-supported" | "duplicate" | "multiple-matches" | "not-found" | "deleted" | "too-long" | "code-invalid" | "extension" | "too-costly" | "business-rule" | "conflict" | "transient" | "lock-error" | "no-store" | "exception" | "timeout" | "incomplete" | "throttled" | "informational"; + +function operationOutcome( + severity: "error" | "warning" | "information" | "fatal", + code: IssueCode, + diagnostics: string +): OperationOutcome { + return { + resourceType: "OperationOutcome", + issue: [ + { + severity, + code, + diagnostics, + }, + ], + }; +} + +function jsonResponse(data: unknown, status = 200): Response { + return new Response(JSON.stringify(data, null, 2), { + status, + headers: { "Content-Type": "application/fhir+json" }, + }); +} + +// ============ Request Handlers ============ + +async function handleHealthCheck(): Promise { + return new Response(JSON.stringify({ status: "ok" }), { + headers: { "Content-Type": "application/json" }, + }); +} + +async function handleGetStructuredRecord(req: Request): Promise { + if (req.method !== "POST") { + return jsonResponse( + operationOutcome("error", "not-supported", "Method not supported"), + 405 + ); + } + + try { + const body = await req.json() as Parameters; + + if (body.resourceType !== "Parameters") { + return jsonResponse( + operationOutcome("error", "invalid", "Request body must be a Parameters resource"), + 400 + ); + } + + const nhsNumber = parseNhsNumberFromParameters(body); + + if (!nhsNumber) { + return jsonResponse( + operationOutcome("error", "required", "Missing required parameter: patientNHSNumber"), + 400 + ); + } + + if (!/^\d{10}$/.test(nhsNumber)) { + return jsonResponse( + operationOutcome("error", "value", "Invalid NHS Number format. Must be 10 digits."), + 400 + ); + } + + console.log(`[Orchestration] NHS Number: ${nhsNumber}`); + + const result = await orchestrate(nhsNumber, { + sources, + mainFhirAuth, + }); + + if (!result.success) { + return jsonResponse( + operationOutcome("error", "exception", result.error ?? "Orchestration failed"), + 500 + ); + } + + return jsonResponse(result.bundle); + } catch (error) { + console.error("[Orchestration] Error:", error); + return jsonResponse( + operationOutcome("error", "exception", "Internal server error"), + 500 + ); + } +} + +// ============ Router ============ + +async function handleRequest(req: Request): Promise { + const url = new URL(req.url); + const path = url.pathname; + const method = req.method; + + console.log(`${method} ${path}`); + + // Health check + if (path === "/health" || path === "/") { + return handleHealthCheck(); + } + + // $getstructuredrecord operation + if (path === "/fhir/Patient/$getstructuredrecord") { + return handleGetStructuredRecord(req); + } + + // Not found + return jsonResponse( + operationOutcome("error", "not-found", `Endpoint not found: ${path}`), + 404 + ); +} + +// ============ Server ============ + +async function startServer(): Promise { + console.log(`FHIR Orchestration Service starting...`); + console.log(` Main FHIR: ${FHIR_SERVER_URL}`); + console.log(` General Practice: ${GENERAL_PRACTICE_URL}`); + console.log(` Hospital: ${HOSPITAL_URL}`); + + await initializeAuthProviders(); + console.log(`Auth providers initialized`); + + const server = Bun.serve({ + port: PORT, + fetch: handleRequest, + }); + + console.log(`Server listening on http://localhost:${server.port}`); + console.log(`\nEndpoints:`); + console.log(` GET /health`); + console.log(` POST /fhir/Patient/$getstructuredrecord`); + console.log(`\nExample:`); + console.log(` curl -X POST http://localhost:${PORT}/fhir/Patient/\\$getstructuredrecord \\`); + console.log(` -H "Content-Type: application/fhir+json" \\`); + console.log(` -d '{"resourceType":"Parameters","parameter":[{"name":"patientNHSNumber","valueIdentifier":{"system":"https://fhir.nhs.uk/Id/nhs-number","value":"9876543210"}}]}'`); +} + +startServer().catch((error) => { + console.error("Failed to start server:", error); + process.exit(1); +}); diff --git a/aidbox-features/aidbox-orchestration-service/src/orchestration.ts b/aidbox-features/aidbox-orchestration-service/src/orchestration.ts new file mode 100644 index 0000000..6be5c6d --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/orchestration.ts @@ -0,0 +1,302 @@ +/** + * Main orchestration logic + * Fetches from multiple sources, deduplicates, stores with provenance, returns merged bundle + */ + +import type { + Bundle, + BundleEntry, + Patient, + AllergyIntolerance, + Observation, + Encounter, + Provenance, + Parameters, + ParametersParameter, +} from "./fhir-types/hl7-fhir-r4-core"; +import { + type AuthProvider, + type FhirSource, + type SourceBundle, + fetchPatientData, +} from "./fhir-clients"; +import { deduplicateResources, getNhsNumber } from "./deduplication"; +import { + generateBundleId, + createProvenance, +} from "./provenance"; + +const NHS_NUMBER_SYSTEM = "https://fhir.nhs.uk/Id/nhs-number"; + +// ============ Parameters Parsing ============ + +export function parseNhsNumberFromParameters(params: Parameters): string | null { + const nhsParam = params.parameter?.find( + (p: ParametersParameter) => + p.name === "patientNHSNumber" || p.name === "nhs-number" + ); + + if (!nhsParam) return null; + + // valueIdentifier format (preferred) + if (nhsParam.valueIdentifier) { + if (nhsParam.valueIdentifier.system === NHS_NUMBER_SYSTEM) { + return nhsParam.valueIdentifier.value ?? null; + } + // Accept any identifier if system not specified + return nhsParam.valueIdentifier.value ?? null; + } + + // Simple valueString format + if (nhsParam.valueString) { + return nhsParam.valueString; + } + + return null; +} + +// ============ Store Bundle ============ + +async function storeBundle( + mainFhirAuth: AuthProvider, + bundle: Bundle, + bundleId: string +): Promise { + const bundleWithId: Bundle = { ...bundle, id: bundleId }; + + const response = await mainFhirAuth.fetch( + `${mainFhirAuth.baseUrl}/fhir/Bundle/${bundleId}`, + { + method: "PUT", + headers: { "Content-Type": "application/fhir+json" }, + body: JSON.stringify(bundleWithId), + } + ); + + if (!response.ok) { + const error = await response.text(); + throw new Error(`Failed to store bundle ${bundleId}: ${error}`); + } +} + +/** + * Store merged resources via transaction bundle. + * This creates the actual resources on the server (not just a Bundle document). + */ +async function storeMergedResourcesAsTransaction( + mainFhirAuth: AuthProvider, + entries: BundleEntry[] +): Promise { + const transactionBundle: Bundle = { + resourceType: "Bundle", + type: "transaction", + entry: entries.map((entry) => { + const resource = entry.resource; + if (!resource) return entry; + + return { + resource, + request: { + method: "PUT" as const, + url: `${resource.resourceType}/${resource.id}`, + }, + }; + }), + }; + + const response = await mainFhirAuth.fetch( + `${mainFhirAuth.baseUrl}/fhir`, + { + method: "POST", + headers: { "Content-Type": "application/fhir+json" }, + body: JSON.stringify(transactionBundle), + } + ); + + if (!response.ok) { + const error = await response.text(); + throw new Error(`Failed to store merged resources: ${error}`); + } +} + +async function storeProvenance( + mainFhirAuth: AuthProvider, + provenance: Provenance +): Promise { + const response = await mainFhirAuth.fetch( + `${mainFhirAuth.baseUrl}/fhir/Provenance/${provenance.id}`, + { + method: "PUT", + headers: { "Content-Type": "application/fhir+json" }, + body: JSON.stringify(provenance), + } + ); + + if (!response.ok) { + const error = await response.text(); + throw new Error(`Failed to store provenance ${provenance.id}: ${error}`); + } +} + +// ============ Main Orchestration ============ + +export interface OrchestrationConfig { + sources: FhirSource[]; + mainFhirAuth: AuthProvider; +} + +export interface OrchestrationResult { + success: boolean; + bundle?: Bundle; + error?: string; + sourceResults?: { + source: string; + bundleId: string; + provenanceId: string; + }[]; +} + +export async function orchestrate( + nhsNumber: string, + config: OrchestrationConfig +): Promise { + const { sources, mainFhirAuth } = config; + + try { + // Generate date for deterministic IDs (YYYY-MM-DD) + const date = new Date().toISOString().split("T")[0]!; + + // 1. Fetch from all sources in parallel + console.log(`Fetching data for NHS Number: ${nhsNumber}`); + const sourceResults = await Promise.all( + sources.map((source) => fetchPatientData(source, nhsNumber)) + ); + + // 2. Generate deterministic bundle IDs + const gpBundleId = generateBundleId("gp", nhsNumber, date); + const hospitalBundleId = generateBundleId("hospital", nhsNumber, date); + const mergedBundleId = generateBundleId("merged", nhsNumber, date); + + // Map source names to bundle IDs + const sourceBundleIds: Record = { + gp: gpBundleId, + hospital: hospitalBundleId, + }; + + // 3. Store source bundles + console.log("Storing source bundles..."); + await Promise.all( + sourceResults.map((result) => { + const bundleId = sourceBundleIds[result.source]; + if (!bundleId) { + throw new Error(`Unknown source: ${result.source}`); + } + return storeBundle(mainFhirAuth, result.bundle, bundleId); + }) + ); + + // 4. Collect all resources for deduplication + const patients: Patient[] = sourceResults + .map((r) => r.patient) + .filter((p): p is Patient => p !== null); + + const allergies: AllergyIntolerance[] = sourceResults.flatMap( + (r) => r.allergies + ); + + const observations: Observation[] = sourceResults.flatMap( + (r) => r.observations + ); + + const encounters: Encounter[] = sourceResults.flatMap((r) => r.encounters); + + // 5. Deduplicate + console.log("Deduplicating resources..."); + const deduped = await deduplicateResources( + { patients, allergies, observations, encounters }, + mainFhirAuth + ); + + // 6. Build merged bundle + const entries: BundleEntry[] = []; + + if (deduped.patient) { + entries.push({ resource: deduped.patient }); + } + + for (const allergy of deduped.allergies) { + entries.push({ resource: allergy }); + } + + for (const observation of deduped.observations) { + entries.push({ resource: observation }); + } + + for (const encounter of deduped.encounters) { + entries.push({ resource: encounter }); + } + + // 7. Store merged resources via transaction (creates actual resources on server) + console.log("Storing merged resources..."); + await storeMergedResourcesAsTransaction(mainFhirAuth, entries); + + // 8. Store merged bundle document (for audit/provenance) + const mergedBundle: Bundle = { + resourceType: "Bundle", + id: mergedBundleId, + type: "collection", + entry: entries, + }; + await storeBundle(mainFhirAuth, mergedBundle, mergedBundleId); + + // 9. Create and store Provenance + const provenance = createProvenance( + mergedBundleId, + [ + { name: "General Practice", identifier: "gp", bundleId: gpBundleId }, + { name: "Hospital", identifier: "hospital", bundleId: hospitalBundleId }, + ], + nhsNumber, + date + ); + + await storeProvenance(mainFhirAuth, provenance); + + console.log(`Provenance created: Provenance/${provenance.id}`); + + // 10. Build response bundle (Provenance stored but not returned to client) + const responseBundle: Bundle = { + resourceType: "Bundle", + id: mergedBundleId, + meta: { + profile: ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle"], + }, + type: "collection", + entry: entries, + }; + + console.log( + `Orchestration complete: ${patients.length} patients -> 1, ` + + `${allergies.length} allergies -> ${deduped.allergies.length}, ` + + `${observations.length} observations -> ${deduped.observations.length}, ` + + `${encounters.length} encounters (no dedup)` + ); + + return { + success: true, + bundle: responseBundle, + sourceResults: sourceResults.map((result) => ({ + source: result.source, + bundleId: sourceBundleIds[result.source]!, + provenanceId: provenance.id!, + })), + }; + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + console.error("Orchestration failed:", message); + return { + success: false, + error: message, + }; + } +} diff --git a/aidbox-features/aidbox-orchestration-service/src/provenance.ts b/aidbox-features/aidbox-orchestration-service/src/provenance.ts new file mode 100644 index 0000000..5822e4b --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/src/provenance.ts @@ -0,0 +1,79 @@ +/** + * Provenance resource creation for tracking data sources. + * Creates single Provenance per operation that tracks: + * - Target: merged bundle + * - Agent: Orchestration Service + * - Entities: source bundles with their respective agents + */ + +import type { Provenance } from "./fhir-types/hl7-fhir-r4-core"; + +export interface SourceInfo { + name: string; + identifier: string; + bundleId: string; +} + +/** + * Generate deterministic bundle ID based on source, NHS number, and date. + * Ensures idempotent storage (same data = same ID = upsert). + */ +export function generateBundleId( + source: "gp" | "hospital" | "merged", + nhsNumber: string, + date: string +): string { + return `${source}-bundle-${nhsNumber}-${date}`; +} + +/** + * Create single Provenance for the orchestration operation. + * - Targets the merged bundle + * - Main agent is Orchestration Service + * - Each source bundle is an entity with its own agent + */ +export function createProvenance( + mergedBundleId: string, + sources: SourceInfo[], + nhsNumber: string, + date: string +): Provenance { + const now = new Date().toISOString(); + + return { + resourceType: "Provenance", + id: `provenance-${nhsNumber}-${date}`, + target: [ + { reference: `Bundle/${mergedBundleId}` }, + ] as unknown as Provenance["target"], + recorded: now, + agent: [ + { + who: { + display: "Orchestration Service", + identifier: { + system: "http://example.org/services", + value: "orchestration", + }, + }, + }, + ], + entity: sources.map((source) => ({ + role: "source" as const, + what: { + reference: `Bundle/${source.bundleId}`, + }, + agent: [ + { + who: { + display: source.name, + identifier: { + system: "http://example.org/sources", + value: source.identifier, + }, + }, + }, + ], + })) as unknown as Provenance["entity"], + }; +} diff --git a/aidbox-features/aidbox-orchestration-service/tsconfig.json b/aidbox-features/aidbox-orchestration-service/tsconfig.json new file mode 100644 index 0000000..7664559 --- /dev/null +++ b/aidbox-features/aidbox-orchestration-service/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "lib": ["ESNext"], + "target": "ESNext", + "module": "Preserve", + "moduleDetection": "force", + "jsx": "react-jsx", + "allowJs": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "noEmit": true, + "strict": true, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "noPropertyAccessFromIndexSignature": false + } +}