### Install Dependencies and Start React Development Server Source: https://github.com/healthsamurai/documentation/blob/master/docs/developer-experience/use-aidbox-with-react.md Install project dependencies using npm and start the development server to run the React sample application locally. Access the app via the provided localhost URL. ```bash npm install npm run dev ``` -------------------------------- ### Install Package with Specific Version Source: https://github.com/healthsamurai/documentation/blob/master/docs/reference/package-registry-api.md Example of installing a specific version of a package from the registry. ```http POST /fhir/$fhir-package-install Content-Type: application/json { "resourceType": "Parameters", "parameter": [ { "name": "package", "valueString": "hl7.fhir.us.core@8.0.0" } ] } ``` -------------------------------- ### Start Docker Services Source: https://github.com/healthsamurai/documentation/blob/master/docs-new/blog/implementing-role-based-access-control-for-fhir-resources-with-keycloak-and-smart-on-fhir-v2/index.md Execute this command to build and start all necessary services for the example using Docker Compose. ```bash docker compose up --build ``` -------------------------------- ### Install Package with Custom Registry Source: https://github.com/healthsamurai/documentation/blob/master/docs/reference/package-registry-api.md Example of installing a package using a custom registry URL. ```http POST /fhir/$fhir-package-install Content-Type: application/json { "resourceType": "Parameters", "parameter": [ { "name": "package", "valueString": "hl7.fhir.us.core@8.0.0" }, { "name": "registry", "valueUrl": "https://simplifier.net/packages" } ] } ``` -------------------------------- ### Install Package from URL Source: https://github.com/healthsamurai/documentation/blob/master/docs/reference/package-registry-api.md Example of installing a package directly from a remote gzipped tarball URL. ```http POST /fhir/$fhir-package-install Content-Type: application/json { "resourceType": "Parameters", "parameter": [ { "name": "package", "valueString": "https://example.org/package.tgz" } ] } ``` -------------------------------- ### Install Package with Multiple Dependency Overrides Source: https://github.com/healthsamurai/documentation/blob/master/docs/reference/package-registry-api.md Example of providing multiple override parameters to control how several dependencies are resolved during package installation. ```http POST /fhir/$fhir-package-install Content-Type: application/json { "resourceType": "Parameters", "parameter": [ { "name": "package", "valueString": "hl7.fhir.us.core@8.0.0" }, { "name": "registry", "valueUrl": "https://simplifier.net/packages" }, { "name": "override", "part": [ { "name": "from", "valueString": "us.nlm.vsac@0.23.0" }, { "name": "to", "valueString": "0.17.0" } ] }, { "name": "override", "part": [ { "name": "from", "valueString": "some.other.package" }, { "name": "to", "valueString": "npm:alternative.package@2.0.0" } ] } ] } ``` -------------------------------- ### Clone Repository and Navigate to OpenTelemetry Directory Source: https://github.com/healthsamurai/documentation/blob/master/docs/modules/observability/getting-started/run-aidbox-with-opentelemetry-locally.md Clone the Aidbox examples repository and navigate to the OpenTelemetry directory to begin the setup process. ```shell git clone git@github.com:Aidbox/examples.git && cd examples/OpenTelemetry ``` -------------------------------- ### Clone and Start Growth Chart App Source: https://github.com/healthsamurai/documentation/blob/master/docs/solutions/aidbox-+-fhir-app-portal/developer-sandbox.md Use these commands to clone the Growth Chart application repository, install its dependencies, and start the development server. ```bash git clone git@github.com:smart-on-fhir/growth-chart-app.git cd growth-chart-app npm install npm start ``` -------------------------------- ### Install Package with Dependency Override (Skip) Source: https://github.com/healthsamurai/documentation/blob/master/docs/reference/package-registry-api.md Example of overriding a dependency to skip its installation entirely. This is useful when a dependency is not needed or can be provided by other means. ```http POST /fhir/$fhir-package-install Content-Type: application/json { "resourceType": "Parameters", "parameter": [ { "name": "package", "valueString": "hl7.fhir.us.core@8.0.0" }, { "name": "registry", "valueUrl": "https://simplifier.net/packages" }, { "name": "override", "part": [ { "name": "from", "valueString": "us.nlm.vsac@0.23.0" }, { "name": "to", "valueBoolean": false } ] } ] } ``` -------------------------------- ### Install Package with Dependency Override (Replace Package) Source: https://github.com/healthsamurai/documentation/blob/master/docs/reference/package-registry-api.md Example of overriding a dependency to use an entirely different package. This is useful when a dependency needs to be replaced with an alternative. ```http POST /fhir/$fhir-package-install Content-Type: application/json { "resourceType": "Parameters", "parameter": [ { "name": "package", "valueString": "hl7.fhir.us.core@8.0.0" }, { "name": "registry", "valueUrl": "https://simplifier.net/packages" }, { "name": "override", "part": [ { "name": "from", "valueString": "us.nlm.vsac@0.23.0" }, { "name": "to", "valueString": "npm:my.custom.vsac@1.0.0" } ] } ] } ``` -------------------------------- ### Create Directory Structure Source: https://github.com/healthsamurai/documentation/blob/master/docs/tutorials/subscriptions-tutorials/aidboxtopicsubscription-sns-tutorial.md Create a new directory for the tutorial and navigate into it. ```bash mkdir sns-tutorial && cd sns-tutorial ``` -------------------------------- ### Example GET Request for Patient $dump Source: https://github.com/healthsamurai/documentation/blob/master/docs/api/bulk-api/dump.md An example of a GET request to dump all Patient resources. ```typescript GET /Patient/$dump ``` -------------------------------- ### Permitted Request Example (HTTP GET) Source: https://github.com/healthsamurai/documentation/blob/master/docs/access-control/authorization/smart-on-fhir/smart-scopes-for-limiting-access.md This example shows an HTTP GET request that is permitted because the JWT access token includes the necessary 'patient/Patient.read' scope. ```http GET /fhir/Patient/test-pt-1 content-type: application/json accept: application/json // Token with "patient/Patient.read patient/Observation.read" scopes Authorization: "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdHYiOjIsImF1ZCI6Imh0dHBzOi8vZzEwdGVzdC5lZGdlLmFpZGJveC5hcHAvZmhpciIsInN1YiI6IjNkMGVmYjgwLTkwMTktNDdhMS1iMzYxLWUwNDUzOGQ4NzFmZSIsImlzcyI6Imh0dHBzOi8vYXV0aC5leGFtcGxlLmNvbSIsImV4cCI6MTczMzIzNDk0ODQsInNjb3BlIjoibGF1bmNoL3BhdGllbnQgb3BlbmlkIGZoaXJVc2VyIG9mZmxpbmVfYWNjZXNzIHBhdGllbnQvUGF0aWVudC5yZWFkIHBhdGllbnQvT2JzZXJ2YXRpb24ucmVhZCIsImp0aSI6IjUzZWQ1MTZhLTNjODEtNGRjZC05NTUxLTdlOTUzYTkzZmMwZSIsImNvbnRleHQiOnsicGF0aWVudCI6InRlc3QtcHQtMSJ9LCJpYXQiOjE3MzMyMzQ2NDh9.PsYalqkaN-6V0tBqLn_9pkDrR0cLmEg237W8xz5Ymdo" ``` -------------------------------- ### Set up .NET Project Source: https://github.com/healthsamurai/documentation/blob/master/docs/getting-started/csharp.md Commands to create a new .NET console application and add necessary packages for Aidbox integration. ```bash dotnet new console -n MyApp cd MyApp dotnet add package System.Text.Json dotnet add package Microsoft.Extensions.DependencyInjection ``` -------------------------------- ### Denied Request Example (HTTP GET) Source: https://github.com/healthsamurai/documentation/blob/master/docs/access-control/authorization/smart-on-fhir/smart-scopes-for-limiting-access.md This example demonstrates an HTTP GET request that is denied because the JWT access token lacks the necessary 'patient/Appointment.read' scope. ```http GET /fhir/Appointment/my-appointment content-type: application/json accept: application/json // Token with "patient/Patient.read patient/Observation.read" scopes Authorization: "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdHYiOjIsImF1ZCI6Imh0dHBzOi8vZzEwdGVzdC5lZGdlLmFpZGJveC5hcHAvZmhpciIsInN1YiI6IjNkMGVmYjgwLTkwMTktNDdhMS1iMzYxLWUwNDUzOGQ4NzFmZSIsImlzcyI6Imh0dHBzOi8vYXV0aC5leGFtcGxlLmNvbSIsImV4cCI6MTczMzIzNDk0ODQsInNjb3BlIjoibGF1bmNoL3BhdGllbnQgb3BlbmlkIGZoaXJVc2VyIG9mZmxpbmVfYWNjZXNzIHBhdGllbnQvUGF0aWVudC5yZWFkIHBhdGllbnQvT2JzZXJ2YXRpb24ucmVhZCIsImp0aSI6IjUzZWQ1MTZhLTNjODEtNGRjZC05NTUxLTdlOTUzYTkzZmMwZSIsImNvbnRleHQiOnsicGF0aWVudCI6InRlc3QtcHQtMSJ9LCJpYXQiOjE3MzMyMzQ2NDh9.PsYalqkaN-6V0tBqLn_9pkDrR0cLmEg237W8xz5Ymdo" ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/healthsamurai/documentation/blob/master/docs/access-control/authorization/smart-on-fhir/example-smart-app-launch-using-smartbox-and-keycloak.md Clone the Aidbox examples repository and navigate to the smart-app-launch-smartbox directory to set up the demo environment. ```sh git clone git@github.com:Aidbox/examples.git && cd examples/aidbox-features/smart-app-launch-smartbox ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/healthsamurai/documentation/blob/master/docs/access-control/authorization/smart-on-fhir/example-smart-app-launch-using-aidbox-and-keycloak.md Clone the Aidbox examples repository and navigate to the smart-app-launch directory. This sets up the necessary files for the example. ```sh git clone git@github.com:Aidbox/examples.git && cd examples/smart-app-launch ``` -------------------------------- ### Navigate to Example Directory Source: https://github.com/healthsamurai/documentation/blob/master/docs-new/blog/implementing-role-based-access-control-for-fhir-resources-with-keycloak-and-smart-on-fhir-v2/index.md Use this command to change your current directory to the location of the example project. ```bash cd aidbox-features/smart-keycloak-roles ``` -------------------------------- ### Start Aidbox and Demo Components with Docker Compose Source: https://github.com/healthsamurai/documentation/blob/master/docs/modules/observability/getting-started/run-aidbox-with-opentelemetry-locally.md Use Docker Compose to initiate Aidbox and all necessary demo components. Ensure all components are pulled and started before proceeding. ```shell docker compose up --force-recreate ``` -------------------------------- ### Example of a Conflicting SearchParameter Request Source: https://github.com/healthsamurai/documentation/blob/master/docs-new/blog/resolve-fhir-searchparameters-conflicting/index.md This example demonstrates how a SearchParameter with a potentially conflicting name is used in a GET request. ```javascript GET /fhir/Patient?USCorePatientName=John ``` -------------------------------- ### Set Up Python Virtual Environment and Install Dependencies Source: https://github.com/healthsamurai/documentation/blob/master/docs/getting-started/python.md Creates a Python virtual environment named 'venv', activates it, and installs project dependencies from the generated 'requirements.txt' file. ```bash python3 -m venv venv source venv/bin/activate pip install -r aidbox/requirements.txt ``` -------------------------------- ### Positive Test Request (GET) Source: https://github.com/healthsamurai/documentation/blob/master/docs/tutorials/security-access-control-tutorials/create-and-test-access-control.md Example of a GET request to a FHIR resource, expected to succeed with the defined access policy. ```http GET {{base}}/fhir/Patient ``` -------------------------------- ### Simple Query Example Source: https://github.com/healthsamurai/documentation/blob/master/docs/api/graphql-api.md Example of a simple GraphQL query to get IDs of two Patients, similar to a FHIR query. ```APIDOC ## Simple query Get IDs of two Patients. This query is similar to FHIR query ``` GET /fhir/Patient?_count=3 ``` Request: ```graphql POST /$graphql content-type: text/yaml accept: text/yaml query: | query { PatientList(_count: 3) { id } } ``` Response: ```yaml data: PatientList: - id: patient-1 - id: patient-2 - id: patient-3 ``` ``` -------------------------------- ### Run Demo Components with Docker Compose Source: https://github.com/healthsamurai/documentation/blob/master/docs/access-control/authorization/smart-on-fhir/example-smart-app-launch-using-aidbox-and-keycloak.md Start all the required demo components (Aidbox, Keycloak, Growth Chart app, Demo Launcher Page) using Docker Compose. Ensure all components are running before proceeding. ```sh docker compose up ``` -------------------------------- ### Install Multiple FHIR Packages Source: https://github.com/healthsamurai/documentation/blob/master/docs/reference/package-registry-api.md Use the `$fhir-package-install` endpoint to install multiple FHIR Implementation Guide packages simultaneously. The request body should be a Parameters resource specifying the packages to install. ```http POST /fhir/$fhir-package-install Content-Type: application/json Accept: application/json { "resourceType": "Parameters", "parameter": [ { "name": "package", "valueString": "hl7.fhir.us.core@5.0.0" }, { "name": "package", "valueString": "hl7.fhir.us.mcode@2.0.0" } ] } ``` ```json { "resourceType": "Parameters", "parameter": [ { "name": "result", "valueBoolean": true }, { "name": "package", "part": [ { "name": "name", "valueString": "hl7.fhir.us.core@5.0.0" }, { "name": "installedCanonicals", "valueInteger": 194 }, { "name": "intention", "valueString": "direct" }, { "name": "source", "part": [ { "name": "type", "valueString": "npm" }, { "name": "registry", "valueString": "https://fs.get-ig.org/pkgs" } ] } ] }, { "name": "package", "part": [ { "name": "name", "valueString": "hl7.fhir.us.mcode@2.0.0" }, { "name": "installedCanonicals", "valueInteger": 153 }, { "name": "intention", "valueString": "direct" }, { "name": "source", "part": [ { "name": "type", "valueString": "npm" }, { "name": "registry", "valueString": "https://fs.get-ig.org/pkgs" } ] } ] }, { "name": "package", "part": [ { "name": "name", "valueString": "us.nlm.vsac@0.3.0" }, { "name": "installedCanonicals", "valueInteger": 20 }, { "name": "intention", "valueString": "transitive" }, { "name": "source", "part": [ { "name": "type", "valueString": "npm" }, { "name": "registry", "valueString": "https://fs.get-ig.org/pkgs" } ] } ] }, { "name": "package", "part": [ { "name": "name", "valueString": "hl7.fhir.uv.sdc@3.0.0" }, { "name": "installedCanonicals", "valueInteger": 11 }, { "name": "intention", "valueString": "transitive" }, { "name": "source", "part": [ { "name": "type", "valueString": "npm" }, { "name": "registry", "valueString": "https://fs.get-ig.org/pkgs" } ] } ] }, { "name": "package", "part": [ { "name": "name", "valueString": "hl7.terminology.r4@3.1.0" }, { "name": "installedCanonicals", "valueInteger": 7 }, { "name": "intention", "valueString": "transitive" }, { "name": "source", "part": [ { "name": "type", "valueString": "npm" }, { "name": "registry", "valueString": "https://fs.get-ig.org/pkgs" } ] } ] }, { "name": "package", "part": [ { "name": "name", "valueString": "hl7.fhir.us.core@4.0.0" }, { "name": "installedCanonicals", "valueInteger": 30 }, { "name": "intention", "valueString": "transitive" }, { "name": "source", "part": [ { "name": "type", "valueString": "npm" }, { "name": "registry", "valueString": "https://fs.get-ig.org/pkgs" } ] } ] } ] } ``` -------------------------------- ### Install Package from Default Registry Source: https://github.com/healthsamurai/documentation/blob/master/docs/reference/package-registry-api.md Shows a basic example of installing a FHIR package using the default registry without any specific overrides. ```APIDOC ## POST /fhir/$fhir-package-install ### Description Installs a specified FHIR package using the default registry. ### Method POST ### Endpoint /fhir/$fhir-package-install ### Request Body - **resourceType** (string) - Required - Must be "Parameters". - **parameter** (array) - Required - An array of parameters for the operation. - **name** (string) - Required - The name of the parameter, should be "package". - **valueString** (string) - Required - The FHIR package to install, including its version (e.g., "hl7.fhir.us.core@5.0.0"). ### Request Example ```json { "resourceType": "Parameters", "parameter": [ { "name": "package", "valueString": "hl7.fhir.us.core@5.0.0" } ] } ``` ### Response #### Success Response (200) - **resourceType** (string) - Indicates the response is of type "Parameters". - **parameter** (array) - An array of parameters detailing the installation result. - **name** (string) - The name of the parameter (e.g., "result", "package"). - **valueBoolean** (boolean) - Indicates the success of the operation (e.g., true for success). - **part** (array) - Contains details about installed packages, including name, installed canonicals, intention, and source registry. - **name** (string) - The name of the part (e.g., "name", "installedCanonicals", "intention", "source"). - **valueString** (string) - The value of the part (e.g., package name, intention, source type, registry URL). - **valueInteger** (integer) - The number of installed canonicals. #### Response Example ```json { "resourceType": "Parameters", "parameter": [ { "name": "result", "valueBoolean": true }, { "name": "package", "part": [ { "name": "name", "valueString": "hl7.fhir.us.core@5.0.0" }, { "name": "installedCanonicals", "valueInteger": 194 }, { "name": "intention", "valueString": "direct" }, { "name": "source", "part": [ { "name": "type", "valueString": "npm" }, { "name": "registry", "valueString": "https://fs.get-ig.org/pkgs" } ] } ] } ] } ``` ``` -------------------------------- ### Run Aidbox with Docker Compose Source: https://github.com/healthsamurai/documentation/blob/master/docs/getting-started/run-aidbox-locally.md Downloads the Aidbox startup script and initiates Aidbox using Docker Compose. Ensure Docker and Docker Compose are installed. ```bash curl -JO https://aidbox.app/runme && docker compose up ``` -------------------------------- ### Get Patient Request Source: https://github.com/healthsamurai/documentation/blob/master/docs/overview/aidbox-ui/rest-console.md Example of a GET request to retrieve a specific Patient resource by its ID. Appending `?_pretty=true` formats the response for readability. ```javascript GET /Patient/f8fe69db-c01c-4a3b-bf0c-0a806ea22577?_pretty=true ``` -------------------------------- ### Get by ID Query Example Source: https://github.com/healthsamurai/documentation/blob/master/docs/api/graphql-api.md Example of a GraphQL query to retrieve a resource by its ID. The 'id' argument uses the GraphQL type ID. ```APIDOC ### Get by ID Aidbox generates query with name `` This query accepts a single argument `id` and returns a resource with the specified `id`. The `id` argument uses GraphQL type **`ID`** (not `String`). When using variables, declare them as `ID` or `ID!`, e.g. `query($pid: ID!) { Patient(id: $pid) { ... } }`. #### Example The following query is similar to ``` GET /Patient/pt-1 ``` Request: ```graphql query { Patient(id: "pt-1") { id name { given } } } ``` With a variable (use type `ID`, not `String`): ```graphql query($pid: ID!) { Patient(id: $pid) { id name { given } } } ``` ``` -------------------------------- ### Example Init Bundle JSON Source: https://github.com/healthsamurai/documentation/blob/master/docs/configuration/init-bundle.md A sample JSON structure for an init bundle. This example uses a 'batch' type and includes a single entry to create an 'Observation' resource conditionally. ```json { "type": "batch", "resourceType": "Bundle", "entry": [ { "request": { "method": "POST", "url": "/Observation", "ifNoneExist": "_id=o1" }, "resource": { "id": "o1", "code": { "text": "text" }, "status": "final", "effectiveDateTime": "2000-01-01" } } ] } ``` -------------------------------- ### FHIR SubscriptionTopic Example Source: https://github.com/healthsamurai/documentation/blob/master/docs/modules/topic-based-subscriptions/fhir-topic-based-subscriptions.md This example shows a FHIR SubscriptionTopic resource as defined by the DaVinci PAS implementation guide, using a coded event trigger. ```json { "resourceType": "SubscriptionTopic", "url": "http://hl7.org/fhir/us/davinci-pas/SubscriptionTopic/PASSubscriptionTopic", "status": "active", "eventTrigger": [{ "description": "When a new result is made ready by the intermediary system", "event": { "coding": [{ "system": "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes", "code": "result-available" }] }, "resource": "http://hl7.org/fhir/StructureDefinition/ClaimResponse" }] } ``` -------------------------------- ### Example with lvl0 and lvl6 Source: https://github.com/healthsamurai/documentation/blob/master/adr/001-search-dropdown.md Demonstrates rendering results that include top-level (lvl0) and specific endpoint (lvl6) information, with distinct styling. ```clojure Input: [{ :lvl0 "AIDBOX" :lvl1 "API Reference" :lvl2 "REST" :lvl3 "Create" :lvl6 "POST /Patient" }] Output: AIDBOX (in gray, uppercase) 📄 API Reference # REST › Create `POST /Patient` (monospace, tinted bg) ``` -------------------------------- ### Start All Containers with Docker Compose Source: https://github.com/healthsamurai/documentation/blob/master/docs/solutions/aidbox-+-fhir-app-portal/getting-started/smartbox-to-aidbox-migration-guide.md Use this command to start all necessary Aidbox and Smartbox containers. Ensure all containers are running and healthy before proceeding to apply migrations. ```bash docker-compose up -d ``` -------------------------------- ### Install Package with Dependency Override (Version) Source: https://github.com/healthsamurai/documentation/blob/master/docs/reference/package-registry-api.md Example of overriding a dependency's version during package installation. This is useful when a required dependency version is unavailable. ```http POST /fhir/$fhir-package-install Content-Type: application/json { "resourceType": "Parameters", "parameter": [ { "name": "package", "valueString": "hl7.fhir.us.core@8.0.0" }, { "name": "registry", "valueUrl": "https://simplifier.net/packages" }, { "name": "override", "part": [ { "name": "from", "valueString": "us.nlm.vsac@0.23.0" }, { "name": "to", "valueString": "0.17.0" } ] } ] } ``` -------------------------------- ### Create Init Bundle File Source: https://github.com/healthsamurai/documentation/blob/master/docs/tutorials/other-tutorials/how-to-run-sql-via-init-bundle.md Create a new file named init-bundle.json to store the Init Bundle configuration. ```bash touch init-bundle.json ``` -------------------------------- ### Create GIN Index for ExampleScenario Resource Source: https://github.com/healthsamurai/documentation/blob/master/docs/deployment-and-maintenance/indexes/create-indexes-manually.md This command creates a GIN index on the 'resource' column for the ExampleScenario table, suitable for general-purpose JSON searching. ```sql CREATE INDEX CONCURRENTLY IF NOT EXISTS examplescenario_resource__gin ON "examplescenario" USING GIN (resource); ``` -------------------------------- ### Field Filtering Example Source: https://github.com/healthsamurai/documentation/blob/master/docs/api/rest-api/fhir-search/README.md Searches for Patient resources where the name starts with 'John'. ```http GET /fhir/Patient?name=John ``` -------------------------------- ### Install multiple packages Source: https://github.com/healthsamurai/documentation/blob/master/docs/reference/package-registry-api.md This endpoint allows for the installation of multiple FHIR Implementation Guide packages simultaneously. It accepts a JSON payload containing a list of package identifiers. ```APIDOC ## POST /fhir/$fhir-package-install ### Description Installs multiple FHIR Implementation Guide packages. ### Method POST ### Endpoint /fhir/$fhir-package-install ### Request Body - **resourceType** (string) - Required - Must be "Parameters". - **parameter** (array) - Required - An array of parameter objects. - **name** (string) - Required - Must be "package". - **valueString** (string) - Required - The package identifier in `@` format (e.g., `hl7.fhir.us.core@5.0.0`). ### Request Example ```json { "resourceType": "Parameters", "parameter": [ { "name": "package", "valueString": "hl7.fhir.us.core@5.0.0" }, { "name": "package", "valueString": "hl7.fhir.us.mcode@2.0.0" } ] } ``` ### Response #### Success Response (200) - **resourceType** (string) - The resource type, typically "Parameters". - **parameter** (array) - An array of parameter objects detailing the installation results. - **name** (string) - The name of the parameter, e.g., "result" or "package". - **valueBoolean** (boolean) - For "result", indicates success or failure. - **part** (array) - For "package", contains details about the installed package. - **name** (string) - The name of the package. - **installedCanonicals** (integer) - The number of canonical resources installed. - **intention** (string) - The installation intention (e.g., "direct", "transitive"). - **source** (object) - Information about the package source. - **type** (string) - The type of source (e.g., "npm"). - **registry** (string) - The registry URL. #### Response Example ```json { "resourceType": "Parameters", "parameter": [ { "name": "result", "valueBoolean": true }, { "name": "package", "part": [ { "name": "name", "valueString": "hl7.fhir.us.core@5.0.0" }, { "name": "installedCanonicals", "valueInteger": 194 }, { "name": "intention", "valueString": "direct" }, { "name": "source", "part": [ { "name": "type", "valueString": "npm" }, { "name": "registry", "valueString": "https://fs.get-ig.org/pkgs" } ] } ] } ] } ``` ``` -------------------------------- ### Create Directory Structure Source: https://github.com/healthsamurai/documentation/blob/master/docs/tutorials/subscriptions-tutorials/aws-eventbridge-aidboxtopicdestination.md Create a new directory for the EventBridge setup and navigate into it. ```bash mkdir eventbridge && cd eventbridge ``` -------------------------------- ### Token Search Example Source: https://github.com/healthsamurai/documentation/blob/master/docs/api/rest-api/fhir-search/searchparameter.md Demonstrates how a 'token' type SearchParameter is used in a GET request. This example shows a search for a Patient resource where the 'title' field exactly matches 'smith'. ```http GET /fhir/Patient?title=smith ``` -------------------------------- ### Example: Suggest Indexes for Observation Resource Source: https://github.com/healthsamurai/documentation/blob/master/docs/deployment-and-maintenance/indexes/get-suggested-indexes.md This example demonstrates how to use `aidbox.index/suggest-index-query` to find indexes for 'Observation' resources with a specific date and ID filter. ```yaml POST /rpc method: aidbox.index/suggest-index-query params: resource-type: Observation query: date=gt2022-01-01&_id=myid ``` -------------------------------- ### Install FHIR Package Source: https://github.com/healthsamurai/documentation/blob/master/docs/reference/package-registry-api.md Use this endpoint to install FHIR Implementation Guide packages. The default NPM registry URL can be changed via the FHIR NPM Package registry setting. ```http POST /fhir/$fhir-package-install ``` -------------------------------- ### Install Package with Multiple Overrides Source: https://github.com/healthsamurai/documentation/blob/master/docs/reference/package-registry-api.md Demonstrates how to combine multiple overrides in a single request to pin a specific version of a dependency and skip another. ```http POST /fhir/$fhir-package-install Content-Type: application/json Accept: application/json { "resourceType": "Parameters", "parameter": [ { "name": "package", "valueString": "hl7.fhir.us.core@8.0.0" }, { "name": "registry", "valueString": "https://packages.simplifier.net" }, { "name": "override", "part": [ { "name": "from", "valueString": "us.nlm.vsac" }, { "name": "to", "valueString": "0.17.0" } ] }, { "name": "override", "part": [ { "name": "from", "valueString": "us.cdc.phinvads" }, { "name": "valueBoolean": false } ] } ] } ``` -------------------------------- ### Example GET Request for CCD Source: https://github.com/healthsamurai/documentation/blob/master/docs/solutions/providers-or-onc-health-it-certification-program/g-9-application-access-all-data-request.md This example demonstrates how to request a CCD for a specific patient within a date range, including a desired filename. Ensure you replace `` with a valid token. ```http GET /ccda/make-doc?docdef-id=continuity-of-care&pid=amb1&start-date=2015-06-22&end-date=2015-06-25&filename=amb1.xml Authorization: Bearer ``` -------------------------------- ### Create APP Account and Signing Key Source: https://github.com/healthsamurai/documentation/blob/master/docs/tutorials/subscriptions-tutorials/aidboxtopicsubscription-nats-tutorial.md Create an 'APP' account and generate a new signing key for it. ```sh nsc add account APP nsc edit account APP --sk generate ``` -------------------------------- ### HTTP GET Request to FHIR API Source: https://github.com/healthsamurai/documentation/blob/master/docs/access-control/authorization/smart-on-fhir/smart-client-authorization/smart-app-launch.md Use this format to make a GET request to the FHIR API. Ensure the Authorization header includes your Bearer token. This example fetches 'Observation' resources. ```http GET /fhir/Observation?code=4548-4&_count=2 content-type: application/json accept: application/json authorization: "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdHYiOjIsImF1ZCI6Imh0dHBzOi8vZzEwdGVzdC5lZGdlLmFpZGJveC5hcHAvZmhpciIsInN1YiI6InRlc3QtdXNlciIsImlzcyI6Imh0dHBzOi8vZzEwdGVzdC5lZGdlLmFpZGJveC5hcHAiLCJleHAiOjE3MzQwMzQ3MTYsInNjb3BlIjoibGF1bmNoL3BhdGllbnQgb3BlbmlkIGZoaXJVc2VyIG9mZmxpbmVfYWNjZXNzIHBhdGllbnQvUGF0aWVudC5yZWFkIHBhdGllbnQvQWxsZXJneUludG9sZXJhbmNlLnJlYWQgcGF0aWVudC9DYXJlUGxhbi5yZWFkIHBhdGllbnQvQ2FyZVRlYW0ucmVhZCBwYXRpZW50L0NvbmRpdGlvbi5yZWFkIHBhdGllbnQvRGV2aWNlLnJlYWQgcGF0aWVudC9EaWFnbm9zdGljUmVwb3J0LnJlYWQgcGF0aWVudC9Eb2N1bWVudFJlZmVyZW5jZS5yZWFkIHBhdGllbnQvR29hbC5yZWFkIHBhdGllbnQvRW5jb3VudGVyLnJlYWQgcGF0aWVudC9JbW11bml6YXRpb24ucmVhZCBwYXRpZW50L01lZGljYXRpb25SZXF1ZXN0LnJlYWQgcGF0aWVudC9PYnNlcnZhdGlvbi5yZWFkIHBhdGllbnQvUHJvY2VkdXJlLnJlYWQgcGF0aWVudC9Qcm92ZW5hbmNlLnJlYWQgcGF0aWVudC9QcmFjdGl0aW9uZXIucmVhZCBwYXRpZW50L09yZ2FuaXphdGlvbi5yZWFkIHBhdGllbnQvTG9jYXRpb24ucmVhZCIsImp0aSI6IjlmMjUxODU1LWQ1MTAtNDY2Mi1iZTg2LTE5ZTljZDYzN2Y2OCIsImNvbnRleHQiOnsicGF0aWVudCI6InRlc3QtcHQtMSJ9LCJpYXQiOjE3MzQwMzQ0MTZ9.EC815f80x6QJebLLWmS0E9XjzPPee5QpIMYz0Oos9ocR_3b4FOsQalModuG4YMGkyZXJOwE29WUjv0fVVXGovdfb0a1hR3iK9_p28qUUb_OmGHo22Upt6K-smHkV8krGM5xNm6g_YPSFT1u9T4qlWoNMoCpti5UdKlmBjHdcIwXoeLb5yC9BynwkJBUpt5PTtE-_gpC_VIg6WkC1hwe2RrDwJl8qvaFl2VZEPhdLU2it3WnX1R-JR_tkXbmY8pv6UfeuPGABleR1sPweyQ-pz3coK4KmkY0tm_7OsBQGKgX9s7RIBP3ab3-dnx8XBJ_s9lw_zefIcYjCuBqZbZU12w" ``` -------------------------------- ### Path Syntax Example Source: https://github.com/healthsamurai/documentation/blob/master/docs/modules/integration-toolkit/ccda-converter/how-to-customize-conversion-rules.md Illustrates how to construct a path to navigate the intermediate tree of a C-CDA document. ```clojure [:entry.VitalSignsOrganizerV3 :* :component :* "VitalSignObservationV2" :value] ``` -------------------------------- ### Enable Specific Implementation Guide (IG) Source: https://github.com/healthsamurai/documentation/blob/master/docs/modules/profiling-and-validation/fhir-schema-validator/setup-aidbox-with-fhir-schema-validation-engine.md List the desired IGs in this environment variable, separating multiple entries with a colon. Use the format '#'. ```bash BOX_BOOTSTRAP_FHIR_PACKAGES=hl7.fhir.r4.core#4.0.1 ``` -------------------------------- ### Example $document Operation Request Source: https://github.com/healthsamurai/documentation/blob/master/docs/api/rest-api/other/document.md This is a standard GET request to the $document operation on a specific Composition resource. ```http GET /fhir/Composition//$document ``` -------------------------------- ### Initialize fhirbase and Run Python Example Source: https://github.com/healthsamurai/documentation/blob/master/docs-new/fhirbase/docs/integrations/python.md Initialize the fhirbase database with a specific version and then execute the example Python script. This requires the Docker environment to be running. ```bash docker-compose run --rm fhirbase fhirbase init 3.0.1 docker-compose run --rm fhirbasepy python examples/example.py ``` -------------------------------- ### Create init-bundle.json for Aidbox Setup Source: https://github.com/healthsamurai/documentation/blob/master/docs/solutions/CMS-0057-F/getting-started/run-aidbox-+-cms-app-locally.md This JSON bundle configures Aidbox by installing specified FHIR packages, registering the CMS App client, and setting up an access policy. It's used during the initial setup of Aidbox. ```json { "type": "transaction", "resourceType": "Bundle", "entry": [ { "request": { "method": "POST", "url": "/$fhir-package-install" }, "resource": { "resourceType": "Parameters", "parameter": [ { "name": "package", "valueString": "hl7.fhir.us.core@6.1.0" }, { "name": "package", "valueString": "hl7.fhir.us.carin-bb@2.0.0" }, { "name": "package", "valueString": "hl7.fhir.us.davinci-pdex@2.0.0" }, { "name": "package", "valueString": "hl7.fhir.us.davinci-drug-formulary@2.0.1" }, { "name": "package", "valueString": "hl7.fhir.us.davinci-pdex-plan-net@1.1.0" }, { "name": "package", "valueString": "https://storage.googleapis.com/aidbox-public/smartbox/hl7.fhir.us.davinci-pas%402.0.1.tar.gz" }, { "name": "package", "valueString": "https://storage.googleapis.com/aidbox-public/smartbox/hl7.fhir.us.davinci-dtr%402.0.1.tar.gz" }, { "name": "package", "valueString": "https://storage.googleapis.com/aidbox-public/smartbox/hl7.fhir.us.davinci-crd%402.0.1.tar.gz" } ] } }, { "request": { "method": "PUT", "url": "/Client/cms-app" }, "resource": { "resourceType": "Client", "id": "cms-app", "secret": "secret", "grant_types": ["basic"] } }, { "request": { "method": "PUT", "url": "/AccessPolicy/allow-cms-app" }, "resource": { "resourceType": "AccessPolicy", "id": "allow-cms-app", "engine": "allow", "link": [ { "reference": "Client/cms-app" } ] } } ] } ``` -------------------------------- ### $fhir-package-install Source: https://github.com/healthsamurai/documentation/blob/master/docs/reference/package-registry-api.md Installs FHIR Implementation Guide packages from a registry or direct URL. Downloads, validates, and installs packages along with their dependencies. The default NPM registry URL can be changed via the FHIR NPM Package registry setting. ```APIDOC ## POST /fhir/$fhir-package-install ### Description Installs FHIR Implementation Guide packages from a registry or direct URL, performing pinning and tree-shaking on canonicals. Automatically installs the Core package if missing and requires explicit provision of the Terminology (THO) package if needed. Only referenced canonicals from dependency packages are included, ensuring each canonical | pair is unique. ### Method POST ### Endpoint /fhir/$fhir-package-install ### Parameters #### Query Parameters - **package** (string) - Required - Package specification in one of the following formats: `@`, `https://` (remote gzipped tarball URL), or `file://` (local gzipped tarball path). - **registry** (url) - Optional - Package registry URL used for resolving non-local packages. Defaults to `https://fs.get-ig.org/pkgs`. - **override** (object) - Optional - Dependency override rule. Each `override` parameter contains two `part` elements: `from` and `to`. - **override.part:from** (string) - Required - Dependency to override. Accepts a package name (e.g., `some.package`) or a version-qualified name (e.g., `some.package@1.0.0`). - **override.part:to** (string | boolean) - Required - Override value. See [Dependency Overrides](#dependency-overrides) for accepted formats. ### Response #### Success Response (200) - **result** (boolean) - Whether the installation succeeded. - **package** (object) - Installed package information. - **package.name** (string) - Package identifier in `@` format. - **package.installedCanonicals** (integer) - Number of canonical resources installed. - **package.intention** (string) - Whether installed directly or as a dependency (`direct` or `transitive`). - **package.source.type** (string) - Source type from which the package was fetched (`npm` or `file`). - **package.source.registry** (string) - Package registry URL (optional). ### Response Example { "result": true, "package": [ { "name": "hl7.fhir.us.core@5.0.0", "installedCanonicals": 194, "intention": "direct", "source": { "type": "npm", "registry": "https://fs.get-ig.org/pkgs" } } ] } ``` -------------------------------- ### Create Project Directory Source: https://github.com/healthsamurai/documentation/blob/master/docs/solutions/CMS-0057-F/getting-started/run-aidbox-+-cms-app-locally.md Use these commands to create a new directory for your project and navigate into it. ```bash mkdir cms-0057-f cd cms-0057-f ``` -------------------------------- ### Example Access Policy for Response Manager Populating Patient Data Source: https://github.com/healthsamurai/documentation/blob/master/docs/modules/aidbox-forms/access-control-in-forms.md This AccessPolicy grants the 'sdc-response-manager' role permission to perform GET requests on 'Patient' resources when the SDC context is 'populate'. This is an example of configuring strict access control. ```yaml PUT /AccessPolicy/as-sdc-response-manager-populate-patient-data content-type: text/yaml accept: text/yaml id: as-sdc-response-manager-populate-patient-data resourceType: AccessPolicy engine: matcho matcho: user: roles: $contains: value: sdc-response-manager extra-data: sdc: context: populate uri: '#/Patient$' request-method: get ``` -------------------------------- ### Retrieve Existing Patient (Aidbox) Source: https://github.com/healthsamurai/documentation/blob/master/docs/api/rest-api/crud/read.md Example of a GET request to retrieve a specific patient resource using the Aidbox-specific path. ```http GET /Patient/17b69d79-3d9b-45f8-af79-75f958502763 ``` -------------------------------- ### Set up Environment Variables Source: https://github.com/healthsamurai/documentation/blob/master/docs/tutorials/other-tutorials/how-to-run-aidbox-in-azure-container-apps.md Define essential environment variables for resource naming, location, and credentials. Ensure you replace placeholder values like '' with strong, unique credentials. ```bash export RESOURCE_GROUP="aidbox-rg" export LOCATION="westeurope" export VNET_NAME="aidbox-vnet" export PG_SUBNET="pg-subnet" export CONTAINER_SUBNET="container-subnet" export PG_SERVER="aidbox-pg-server" export PG_USER="aidbox" export PG_PASSWORD="" export PG_DATABASE="aidbox" export CONTAINER_ENV="aidbox-env" export CONTAINER_APP="aidbox-app" ```