├── src ├── fhir-candle │ ├── wwwroot │ │ ├── css │ │ │ ├── site.css │ │ │ └── monaco.css │ │ ├── highlight │ │ │ ├── languages │ │ │ │ ├── shell.min.js │ │ │ │ ├── json.min.js │ │ │ │ ├── http.min.js │ │ │ │ └── xml.min.js │ │ │ └── styles │ │ │ │ ├── atom-one-dark.min.css │ │ │ │ ├── atom-one-light.min.css │ │ │ │ └── default.min.css │ │ └── media │ │ │ ├── github-mark.svg │ │ │ └── github-mark-white.svg │ ├── appsettings.Development.json │ ├── Globals.cs │ ├── appsettings.json │ ├── Services │ │ ├── INotificationManager.cs │ │ └── IFhirStoreManager.cs │ ├── _Imports.razor │ ├── Components │ │ ├── Routes.razor │ │ └── RI │ │ │ └── subscriptions │ │ │ ├── IndexContentR4B.razor │ │ │ ├── IndexContentR5.razor │ │ │ └── IndexContentR4.razor │ ├── Models │ │ └── IIndexContent.cs │ ├── Layout │ │ ├── MainLayout.razor.css │ │ └── NavMenu.razor │ ├── Ucum │ │ ├── UcumUtils.cs │ │ └── UCUM.g4 │ └── _ForPackages │ │ ├── ManifestDateJsonConverter.cs │ │ ├── DiskPackageCache.cs │ │ └── AuthorJsonConverter.cs ├── fhir-candle.Tests │ ├── Usings.cs │ ├── xunit.runner.json │ ├── data │ │ ├── common │ │ │ └── patient-common.json │ │ ├── r5 │ │ │ ├── encounter-virtual-planned.json │ │ │ ├── encounter-virtual-in-progress.json │ │ │ ├── encounter-virtual-completed.json │ │ │ ├── searchparameter-patient-name-use.json │ │ │ ├── searchparameter-patient-multiplebirth.json │ │ │ ├── subscription-encounter-complete-query.json │ │ │ ├── subscription-encounter-create-interaction.json │ │ │ ├── subscription-encounter-complete-fhirpath.json │ │ │ ├── Subscription-encounter-complete.json │ │ │ ├── Bundle-notification-handshake.json │ │ │ ├── patient-example-c.json │ │ │ ├── patient-example-d.json │ │ │ ├── Observation-656.json │ │ │ ├── subscriptiontopic-encounter-create-interaction.json │ │ │ ├── SubscriptionTopic-encounter-complete.json │ │ │ ├── subscriptiontopic-encounter-complete-query.json │ │ │ ├── Observation-example.json │ │ │ └── subscriptiontopic-encounter-complete-fhirpath.json │ │ ├── r4 │ │ │ ├── searchparameter-patient-name-use.json │ │ │ ├── searchparameter-patient-multiplebirth.json │ │ │ ├── Bundle-notification-handshake.json │ │ │ ├── Subscription-encounter-complete.json │ │ │ ├── patient-example-c.json │ │ │ ├── patient-example-d.json │ │ │ ├── Observation-656.json │ │ │ ├── Bundle-notification-id.json │ │ │ └── Observation-example.json │ │ ├── r4b │ │ │ ├── searchparameter-patient-name-use.json │ │ │ ├── searchparameter-patient-multiplebirth.json │ │ │ ├── Bundle-notification-handshake.json │ │ │ ├── Subscription-encounter-complete.json │ │ │ ├── patient-example-c.json │ │ │ ├── patient-example-d.json │ │ │ ├── Observation-656.json │ │ │ ├── SubscriptionTopic-encounter-complete.json │ │ │ └── Observation-example.json │ │ └── smart │ │ │ └── smart.rs384.public.json │ ├── UcumTests.cs │ └── Extensions │ │ └── ShouldlyExtensions.cs ├── FhirStore.R4 │ ├── AssemblyInfo.cs │ ├── VersionedUtils.cs │ └── FhirCandle.R4.csproj ├── FhirStore.R4B │ ├── AssemblyInfo.cs │ ├── FhirCandle.R4B.csproj │ └── VersionedUtils.cs ├── FhirStore.R5 │ ├── AssemblyInfo.cs │ ├── FhirCandle.R5.csproj │ └── VersionedUtils.cs ├── FhirCandle.Ui.Common │ ├── _Imports.razor │ ├── FhirCandle.Ui.Common.csproj │ └── Components │ │ └── CodeBlock.razor ├── FhirCandle.Ui.R4 │ ├── Components │ │ └── FhirEditorLinks.razor │ ├── _Imports.razor │ ├── Subscriptions │ │ └── TourUtils.cs │ └── FhirCandle.Ui.R4.csproj ├── FhirCandle.Ui.R5 │ ├── Components │ │ └── FhirEditorLinks.razor │ ├── _Imports.razor │ ├── Subscriptions │ │ ├── TourUtils.cs │ │ └── TourStep01.razor │ └── FhirCandle.Ui.R5.csproj ├── FhirCandle.Ui.R4B │ ├── _Imports.razor │ ├── Subscriptions │ │ ├── TourUtils.cs │ │ └── TourStep01.razor │ ├── FhirCandle.Ui.R4B.csproj │ └── Components │ │ └── FhirEditorLinks.razor ├── FhirStore.Common │ ├── Smart │ │ ├── JsonWebKeySet.cs │ │ ├── SmartClientRegistratonResponse.cs │ │ └── SmartClientRegistration.cs │ ├── Storage │ │ ├── StoreInstanceEventArgs.cs │ │ ├── InstanceTableRec.cs │ │ ├── Common.cs │ │ └── IResourceStore.cs │ ├── Ui │ │ ├── NavPageInfoRec.cs │ │ └── INavTracker.cs │ ├── Client │ │ └── ICandleClient.cs │ ├── Models │ │ ├── ReceivedSubscriptionEventArgs.cs │ │ ├── ReceivedSubscriptionChangedEventArgs.cs │ │ ├── SubscriptionChangedEventArgs.cs │ │ ├── SubscriptionSendEventArgs.cs │ │ ├── SubscriptionEvent.cs │ │ ├── IPackagePage.cs │ │ ├── FhirResponseContext.cs │ │ └── ClientInfo.cs │ ├── Configuration │ │ ├── ConfigurationOption.cs │ │ └── ConfigOptionAttribute.cs │ ├── Extensions │ │ └── FhirLiteralAttribute.cs │ └── FhirCandle.Common.csproj ├── FhirCandle.Ui.Versioned │ ├── FhirCandle.Ui.Versioned.projitems │ └── FhirCandle.Ui.Versioned.shproj └── FhirStore.CommonVersioned │ ├── FhirCandle.Versioned.shproj │ ├── FhirStore.CommonVersioned.projitems │ └── CSharpExtensions │ └── SearchParamDefinitionExtensions.cs ├── logos ├── logo-simple.png ├── logo-with-text.png ├── logo-simple-500x500.png └── logo-with-text-500x500.png ├── manual └── basics.http ├── fhirData ├── smart │ ├── r4 │ │ ├── PractitionerRole-referral-example.json │ │ ├── PractitionerRole-surgical-example.json │ │ ├── Practitioner-davinci-susan-watson.json │ │ ├── Patient-davinci-jesse-smith.json │ │ ├── Patient-davinci-joe-smith.json │ │ ├── Patient-davinci-amy-shaw.json │ │ └── Practitioner-davinci-ronald-bone.json │ └── open │ │ ├── PractitionerRole-referral-example.json │ │ ├── PractitionerRole-surgical-example.json │ │ ├── Practitioner-davinci-susan-watson.json │ │ ├── Patient-davinci-jesse-smith.json │ │ ├── Patient-davinci-joe-smith.json │ │ ├── Patient-davinci-amy-shaw.json │ │ └── Practitioner-davinci-ronald-bone.json ├── feature-cs │ └── r4 │ │ ├── PractitionerRole-referral-example.json │ │ ├── PractitionerRole-surgical-example.json │ │ ├── Practitioner-davinci-susan-watson.json │ │ ├── Patient-davinci-jesse-smith.json │ │ ├── Patient-davinci-joe-smith.json │ │ ├── Patient-davinci-amy-shaw.json │ │ └── Practitioner-davinci-ronald-bone.json ├── hl7.fhir.us.davinci-cdex │ ├── provider │ │ ├── PractitionerRole-referral-example.json │ │ ├── PractitionerRole-surgical-example.json │ │ ├── Location-davinci-example.json │ │ ├── Practitioner-davinci-susan-watson.json │ │ ├── Organization-insurer-example.json │ │ ├── Patient-davinci-jesse-smith.json │ │ ├── Patient-davinci-joe-smith.json │ │ ├── Organization-requester-example.json │ │ ├── Patient-davinci-amy-shaw.json │ │ ├── Encounter-amy-shaw-surgical.json │ │ ├── Encounter-joe-smith-surgical.json │ │ ├── Encounter-jesse-smith-surgical.json │ │ ├── Practitioner-davinci-ronald-bone.json │ │ ├── Condition-cdex-shaw-copd.json │ │ ├── Condition-cdex-shaw-ear-burn.json │ │ ├── Condition-cdex-shaw-abscess.json │ │ └── Condition-cdex-shaw-examplitis.json │ └── Encounter-surgical-example.json └── subscriptions │ ├── r4 │ └── SearchParameter-st-url.json │ ├── r4b │ └── subscriptiontopic-encounter-complete.json │ └── r5 │ └── subscriptiontopic-encounter-complete.json ├── Dockerfile ├── Dockerfile_chiseled ├── SECURITY.MD ├── fhir-candle-ui.props ├── .github └── workflows │ ├── build-and-test.yml │ ├── argo-ris.yml │ └── nuget-tool.yml ├── LICENSE ├── fhir-candle.props └── CONTRIBUTING.MD /src/fhir-candle/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; -------------------------------------------------------------------------------- /logos/logo-simple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FHIR/fhir-candle/HEAD/logos/logo-simple.png -------------------------------------------------------------------------------- /logos/logo-with-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FHIR/fhir-candle/HEAD/logos/logo-with-text.png -------------------------------------------------------------------------------- /logos/logo-simple-500x500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FHIR/fhir-candle/HEAD/logos/logo-simple-500x500.png -------------------------------------------------------------------------------- /logos/logo-with-text-500x500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FHIR/fhir-candle/HEAD/logos/logo-with-text-500x500.png -------------------------------------------------------------------------------- /src/fhir-candle.Tests/xunit.runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json" 3 | } -------------------------------------------------------------------------------- /src/FhirStore.R4/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("fhir.candle.Tests")] -------------------------------------------------------------------------------- /src/FhirStore.R4B/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("fhir.candle.Tests")] -------------------------------------------------------------------------------- /src/FhirStore.R5/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("fhir.candle.Tests")] -------------------------------------------------------------------------------- /src/fhir-candle/wwwroot/css/monaco.css: -------------------------------------------------------------------------------- 1 | .monaco-editor-container { 2 | height: calc(98vh); 3 | width: calc(100vw - 2em); 4 | margin-left: -16px; /* Remove indentation, but do not want full absolute positioning */ 5 | } 6 | -------------------------------------------------------------------------------- /src/fhir-candle/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /manual/basics.http: -------------------------------------------------------------------------------- 1 | // Configuration 2 | # @fhirUrl = http://localhost:5826/fhir/r4 3 | # @fhirUrl = http://localhost:5826/fhir/r4b 4 | @fhirUrl = http://localhost:5826/fhir/r5 5 | 6 | ### GET Metadata 7 | GET {{fhirUrl}}/metadata 8 | Accept: application/fhir+json 9 | 10 | -------------------------------------------------------------------------------- /src/fhir-candle/Globals.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | -------------------------------------------------------------------------------- /src/FhirCandle.Ui.Common/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Web 2 | @using Microsoft.JSInterop; 3 | @using FhirCandle.Models; 4 | @using FhirCandle.Storage; 5 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 6 | @using Icons = Microsoft.FluentUI.AspNetCore.Components.Icons; 7 | @* @using Emoji = Microsoft.FluentUI.AspNetCore.Components.Emoji *@ 8 | -------------------------------------------------------------------------------- /src/fhir-candle/wwwroot/highlight/languages/shell.min.js: -------------------------------------------------------------------------------- 1 | /*! `shell` grammar compiled for Highlight.js 11.8.0 */ 2 | (()=>{var s=(()=>{"use strict";return s=>({name:"Shell Session", 3 | aliases:["console","shellsession"],contains:[{className:"meta.prompt", 4 | begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/, 5 | subLanguage:"bash"}}]})})();hljs.registerLanguage("shell",s)})(); -------------------------------------------------------------------------------- /src/FhirCandle.Ui.R4/Components/FhirEditorLinks.razor: -------------------------------------------------------------------------------- 1 | @code { 2 | [Parameter] 3 | public string BaseUrl { get; set; } = string.Empty; 4 | 5 | [Parameter] 6 | public string ResourceType { get; set; } = string.Empty; 7 | 8 | [Parameter] 9 | public string Id { get; set; } = string.Empty; 10 | 11 | [Parameter] 12 | public string FhirPathLabUrl { get; set; } = string.Empty; 13 | } -------------------------------------------------------------------------------- /src/FhirCandle.Ui.R5/Components/FhirEditorLinks.razor: -------------------------------------------------------------------------------- 1 | @code { 2 | [Parameter] 3 | public string BaseUrl { get; set; } = string.Empty; 4 | 5 | [Parameter] 6 | public string ResourceType { get; set; } = string.Empty; 7 | 8 | [Parameter] 9 | public string Id { get; set; } = string.Empty; 10 | 11 | [Parameter] 12 | public string FhirPathLabUrl { get; set; } = string.Empty; 13 | } -------------------------------------------------------------------------------- /src/fhir-candle/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Listen_Port": "", 3 | "Public_Url": "", 4 | "Zulip_Email": "", 5 | "Zulip_Key": "", 6 | "Zulip_Url": "", 7 | "SMTP_Host": "", 8 | "SMTP_Port": "", 9 | "SMTP_User": "", 10 | "SMTP_Password": "", 11 | "FHIRPath_Lab_Url": "", 12 | "Logging": { 13 | "LogLevel": { 14 | "Default": "Information", 15 | "Microsoft.AspNetCore": "Warning" 16 | } 17 | }, 18 | "AllowedHosts": "*" 19 | } 20 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/common/patient-common.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "common", 4 | "meta": { 5 | "tag": [ 6 | { 7 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 8 | "code": "HTEST", 9 | "display": "test health data" 10 | } 11 | ] 12 | }, 13 | "active": true, 14 | "name": [ 15 | { 16 | "use": "official", 17 | "family": "Common" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/encounter-virtual-planned.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "virtual-planned", 4 | "status": "planned", 5 | "class": [ 6 | { 7 | "coding": [ 8 | { 9 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", 10 | "code": "VR", 11 | "display": "virtual" 12 | } 13 | ] 14 | } 15 | ], 16 | "subject": { 17 | "reference": "Patient/example" 18 | } 19 | } -------------------------------------------------------------------------------- /src/FhirCandle.Ui.R4/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Routing; 2 | @using Microsoft.AspNetCore.Components.Web 3 | @using Microsoft.AspNetCore.Http; 4 | @using Microsoft.JSInterop; 5 | @using FhirCandle.Ui; 6 | @using FhirCandle.Models; 7 | @using FhirCandle.Storage; 8 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 9 | @using Icons = Microsoft.FluentUI.AspNetCore.Components.Icons; 10 | @* @using Emoji = Microsoft.FluentUI.AspNetCore.Components.Emoji *@ 11 | -------------------------------------------------------------------------------- /src/FhirCandle.Ui.R4B/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Routing; 2 | @using Microsoft.AspNetCore.Components.Web 3 | @using Microsoft.AspNetCore.Http; 4 | @using Microsoft.JSInterop; 5 | @using FhirCandle.Ui; 6 | @using FhirCandle.Models; 7 | @using FhirCandle.Storage; 8 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 9 | @using Icons = Microsoft.FluentUI.AspNetCore.Components.Icons; 10 | @* @using Emoji = Microsoft.FluentUI.AspNetCore.Components.Emoji *@ 11 | -------------------------------------------------------------------------------- /src/FhirCandle.Ui.R5/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Routing; 2 | @using Microsoft.AspNetCore.Components.Web 3 | @using Microsoft.AspNetCore.Http; 4 | @using Microsoft.JSInterop; 5 | @using FhirCandle.Ui; 6 | @using FhirCandle.Models; 7 | @using FhirCandle.Storage; 8 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 9 | @using Icons = Microsoft.FluentUI.AspNetCore.Components.Icons; 10 | @* @using Emoji = Microsoft.FluentUI.AspNetCore.Components.Emoji *@ 11 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/encounter-virtual-in-progress.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "virtual-in-progress", 4 | "status": "in-progress", 5 | "class": [ 6 | { 7 | "coding": [ 8 | { 9 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", 10 | "code": "VR", 11 | "display": "virtual" 12 | } 13 | ] 14 | } 15 | ], 16 | "subject": { 17 | "reference": "Patient/example" 18 | } 19 | } -------------------------------------------------------------------------------- /fhirData/smart/r4/PractitionerRole-referral-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "PractitionerRole", 3 | "id" : "ReferralPractitionerRoleExample", 4 | "meta" : { 5 | "profile" : [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitionerrole" 7 | ] 8 | }, 9 | "practitioner" : { 10 | "reference" : "Practitioner/davinci-susan-watson" 11 | }, 12 | "location" : [ 13 | { 14 | "reference" : "Location/davinci-example-location" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /fhirData/smart/r4/PractitionerRole-surgical-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "PractitionerRole", 3 | "id" : "SurgicalPractitionerRoleExample", 4 | "meta" : { 5 | "profile" : [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitionerrole" 7 | ] 8 | }, 9 | "practitioner" : { 10 | "reference" : "Practitioner/davinci-susan-watson" 11 | }, 12 | "location" : [ 13 | { 14 | "reference" : "Location/davinci-example-location" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /fhirData/feature-cs/r4/PractitionerRole-referral-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "PractitionerRole", 3 | "id" : "ReferralPractitionerRoleExample", 4 | "meta" : { 5 | "profile" : [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitionerrole" 7 | ] 8 | }, 9 | "practitioner" : { 10 | "reference" : "Practitioner/davinci-susan-watson" 11 | }, 12 | "location" : [ 13 | { 14 | "reference" : "Location/davinci-example-location" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /fhirData/feature-cs/r4/PractitionerRole-surgical-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "PractitionerRole", 3 | "id" : "SurgicalPractitionerRoleExample", 4 | "meta" : { 5 | "profile" : [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitionerrole" 7 | ] 8 | }, 9 | "practitioner" : { 10 | "reference" : "Practitioner/davinci-susan-watson" 11 | }, 12 | "location" : [ 13 | { 14 | "reference" : "Location/davinci-example-location" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /fhirData/smart/open/PractitionerRole-referral-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "PractitionerRole", 3 | "id" : "ReferralPractitionerRoleExample", 4 | "meta" : { 5 | "profile" : [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitionerrole" 7 | ] 8 | }, 9 | "practitioner" : { 10 | "reference" : "Practitioner/davinci-susan-watson" 11 | }, 12 | "location" : [ 13 | { 14 | "reference" : "Location/davinci-example-location" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /fhirData/smart/open/PractitionerRole-surgical-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "PractitionerRole", 3 | "id" : "SurgicalPractitionerRoleExample", 4 | "meta" : { 5 | "profile" : [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitionerrole" 7 | ] 8 | }, 9 | "practitioner" : { 10 | "reference" : "Practitioner/davinci-susan-watson" 11 | }, 12 | "location" : [ 13 | { 14 | "reference" : "Location/davinci-example-location" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/PractitionerRole-referral-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "PractitionerRole", 3 | "id" : "ReferralPractitionerRoleExample", 4 | "meta" : { 5 | "profile" : [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitionerrole" 7 | ] 8 | }, 9 | "practitioner" : { 10 | "reference" : "Practitioner/davinci-susan-watson" 11 | }, 12 | "location" : [ 13 | { 14 | "reference" : "Location/davinci-example-location" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/PractitionerRole-surgical-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "PractitionerRole", 3 | "id" : "SurgicalPractitionerRoleExample", 4 | "meta" : { 5 | "profile" : [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitionerrole" 7 | ] 8 | }, 9 | "practitioner" : { 10 | "reference" : "Practitioner/davinci-susan-watson" 11 | }, 12 | "location" : [ 13 | { 14 | "reference" : "Location/davinci-example-location" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4/searchparameter-patient-name-use.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "SearchParameter", 3 | "id": "Patient-name-use", 4 | "url": "http://hl7.org/fhir/SearchParameter/patient-name-use", 5 | "version": "1", 6 | "name": "Patient-name-use", 7 | "status": "draft", 8 | "experimental": true, 9 | "description": "Search by patient.name.use", 10 | "purpose": "Need to search by a name use", 11 | "code": "name-use", 12 | "base": [ "Patient" ], 13 | "type": "token", 14 | "expression": "Patient.name.use" 15 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4b/searchparameter-patient-name-use.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "SearchParameter", 3 | "id": "Patient-name-use", 4 | "url": "http://hl7.org/fhir/SearchParameter/patient-name-use", 5 | "version": "1", 6 | "name": "Patient-name-use", 7 | "status": "draft", 8 | "experimental": true, 9 | "description": "Search by patient.name.use", 10 | "purpose": "Need to search by a name use", 11 | "code": "name-use", 12 | "base": [ "Patient" ], 13 | "type": "token", 14 | "expression": "Patient.name.use" 15 | } -------------------------------------------------------------------------------- /src/fhir-candle/wwwroot/highlight/languages/json.min.js: -------------------------------------------------------------------------------- 1 | /*! `json` grammar compiled for Highlight.js 11.8.0 */ 2 | (()=>{var e=(()=>{"use strict";return e=>{const a=["true","false","null"],n={ 3 | scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",keywords:{ 4 | literal:a},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/, 5 | relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0 6 | },e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE], 7 | illegal:"\\S"}}})();hljs.registerLanguage("json",e)})(); -------------------------------------------------------------------------------- /src/FhirCandle.Ui.Common/FhirCandle.Ui.Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/encounter-virtual-completed.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "virtual-completed", 4 | "status": "completed", 5 | "class": [ 6 | { 7 | "coding": [ 8 | { 9 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", 10 | "code": "VR", 11 | "display": "virtual" 12 | } 13 | ] 14 | } 15 | ], 16 | "subject": { 17 | "reference": "Patient/example", 18 | "identifier": { 19 | "system": "urn:oid:1.2.36.146.595.217.0.1", 20 | "value": "12345" 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4/searchparameter-patient-multiplebirth.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "SearchParameter", 3 | "id": "Patient-multiplebirth", 4 | "url": "http://hl7.org/fhir/SearchParameter/patient-multiplebirth", 5 | "version": "1", 6 | "name": "Patient-multiplebirth", 7 | "status": "draft", 8 | "experimental": true, 9 | "description": "Search by patient.multipleBirthInteger", 10 | "purpose": "Need to search by multiple birth integer", 11 | "code": "multiplebirth", 12 | "base": [ "Patient" ], 13 | "type": "number", 14 | "expression": "(Patient.multipleBirth as integer)" 15 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4b/searchparameter-patient-multiplebirth.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "SearchParameter", 3 | "id": "Patient-multiplebirth", 4 | "url": "http://hl7.org/fhir/SearchParameter/patient-multiplebirth", 5 | "version": "1", 6 | "name": "Patient-multiplebirth", 7 | "status": "draft", 8 | "experimental": true, 9 | "description": "Search by patient.multipleBirthInteger", 10 | "purpose": "Need to search by multiple birth integer", 11 | "code": "multiplebirth", 12 | "base": [ "Patient" ], 13 | "type": "number", 14 | "expression": "(Patient.multipleBirth as integer)" 15 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/searchparameter-patient-name-use.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "SearchParameter", 3 | "id": "Patient-name-use", 4 | "url": "http://hl7.org/fhir/SearchParameter/patient-name-use", 5 | "version": "1", 6 | "name": "Patient-name-use", 7 | "title": "Patient Name Use", 8 | "status": "draft", 9 | "experimental": true, 10 | "description": "Search by patient.name.use", 11 | "purpose": "Need to search by a name use", 12 | "code": "name-use", 13 | "base": [ "Patient" ], 14 | "type": "token", 15 | "expression": "Patient.name.use", 16 | "processingMode": "normal" 17 | } -------------------------------------------------------------------------------- /src/FhirStore.R5/FhirCandle.R5.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/fhir-candle/Services/INotificationManager.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | using FhirCandle.Models; 7 | using FhirCandle.Storage; 8 | using Microsoft.Extensions.Hosting; 9 | 10 | namespace fhir.candle.Services; 11 | 12 | /// Interface for notification manager. 13 | public interface INotificationManager : IHostedService, IDisposable 14 | { 15 | } 16 | -------------------------------------------------------------------------------- /src/FhirStore.R4/VersionedUtils.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Versioned; 7 | 8 | /// A versioned utilities. 9 | internal static class VersionedUtils 10 | { 11 | /// Gets the type to use for int64 elements. 12 | internal static Hl7.Fhir.Model.FHIRAllTypes GetInt64Type => Hl7.Fhir.Model.FHIRAllTypes.String; 13 | } 14 | -------------------------------------------------------------------------------- /src/FhirStore.R4B/FhirCandle.R4B.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/FhirStore.R4B/VersionedUtils.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Versioned; 7 | 8 | /// A versioned utilities. 9 | internal static class VersionedUtils 10 | { 11 | /// Gets the type to use for int64 elements. 12 | internal static Hl7.Fhir.Model.FHIRAllTypes GetInt64Type => Hl7.Fhir.Model.FHIRAllTypes.String; 13 | } 14 | -------------------------------------------------------------------------------- /src/FhirStore.R5/VersionedUtils.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Versioned; 7 | 8 | /// A versioned utilities. 9 | internal static class VersionedUtils 10 | { 11 | /// Gets the type to use for int64 elements. 12 | internal static Hl7.Fhir.Model.FHIRAllTypes GetInt64Type => Hl7.Fhir.Model.FHIRAllTypes.Integer64; 13 | } 14 | -------------------------------------------------------------------------------- /src/fhir-candle/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Routing 2 | @using Microsoft.AspNetCore.Components.Web 3 | @using Microsoft.JSInterop 4 | @using fhir.candle; 5 | @using fhir.candle.Models; 6 | @using fhir.candle.Services; 7 | @using FhirCandle.Ui; 8 | @using FhirCandle.Models; 9 | @using FhirCandle.Storage; 10 | @using FhirCandle.Utils; 11 | @* @using Microsoft.FluentUI.AspNetCore.Components; *@ 12 | @* @using MudBlazor; *@ 13 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 14 | @using Icons = Microsoft.FluentUI.AspNetCore.Components.Icons; 15 | @* @using Emoji = Microsoft.FluentUI.AspNetCore.Components.Emoji *@ 16 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/smart/smart.rs384.public.json: -------------------------------------------------------------------------------- 1 | { 2 | "keys": [ 3 | { 4 | "kty": "RSA", 5 | "alg": "RS384", 6 | "n": "wJq2RHIA-7RT6q4go7wjcbHdW7ck7Kz22A8wf-kN7Wi5CWvhFG2_Y7nQp1lDpb2IKMQr-Q4n_vgJ6d5rWPspJpSPY7iffUK4ipQCEbzID5DJ6fQMBZOfCTXyxkuMh3jYGKEF3Ziw2oxbM1H9j-eJAPtrj5stUG6kVoXowegdox-bSjWP0iI5PnkwUNzcekLMug4M3LRluEQgGR9O_BAML6-w3igZ_rZA_gunyrLAMbfmCVaceW5ohLp679kyM7U6W2gDK_NbkDKcINUakVmPeoG5h8RzgGzvGrySR0k0VDFiZv60Ua07DqHTeDGH9e4NV07AECae-oykIj5NDCs3pw", 7 | "e": "AQAB", 8 | "key_ops": [ 9 | "verify" 10 | ], 11 | "ext": true, 12 | "kid": "eee9f17a3b598fd86417a980b591fbe6" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/searchparameter-patient-multiplebirth.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "SearchParameter", 3 | "id": "Patient-multiplebirth", 4 | "url": "http://hl7.org/fhir/SearchParameter/patient-multiplebirth", 5 | "version": "5.0.0", 6 | "name": "Patient-multiplebirth", 7 | "title": "Patient Multiple Birth", 8 | "status": "draft", 9 | "experimental": true, 10 | "description": "Search by patient.multipleBirthInteger", 11 | "purpose": "Need to search by multiple birth integer", 12 | "code": "multiplebirth", 13 | "base": [ "Patient" ], 14 | "type": "number", 15 | "expression": "(Patient.multipleBirth as integer)", 16 | "processingMode": "normal" 17 | } -------------------------------------------------------------------------------- /src/FhirStore.R4/FhirCandle.R4.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/FhirStore.Common/Smart/JsonWebKeySet.cs: -------------------------------------------------------------------------------- 1 | //// 2 | //// Copyright (c) Microsoft Corporation. All rights reserved. 3 | //// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | //// 5 | 6 | //using System.Text.Json.Serialization; 7 | 8 | //namespace FhirCandle.Smart; 9 | 10 | ///// A JSON web key set. 11 | //public class JsonWebKeySet 12 | //{ 13 | // /// Gets or sets the keys. 14 | // [JsonPropertyName("keys")] 15 | // public IEnumerable Keys { get; set; } = Enumerable.Empty(); 16 | 17 | //} 18 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env 2 | ARG TARGETPLATFORM 3 | ARG BUILDPLATFORM 4 | ARG TARGETARCH 5 | 6 | WORKDIR /app 7 | 8 | # Copy everything else and build 9 | COPY . ./ 10 | 11 | RUN dotnet restore --ucr -a $TARGETARCH src/fhir-candle/fhir-candle.csproj 12 | RUN dotnet publish --framework net9.0 -a $TARGETARCH src/fhir-candle/fhir-candle.csproj -c Release -o out --no-restore 13 | 14 | # Build runtime image 15 | #FROM mcr.microsoft.com/dotnet/aspnet:9.0-noble-chiseled 16 | FROM mcr.microsoft.com/dotnet/aspnet:9.0 17 | EXPOSE 5826 18 | WORKDIR /app 19 | COPY --from=build-env /app/out . 20 | ENTRYPOINT ["dotnet", "fhir-candle.dll"] 21 | CMD ["-m", "1000"] 22 | -------------------------------------------------------------------------------- /src/FhirStore.Common/Storage/StoreInstanceEventArgs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | 7 | namespace FhirCandle.Storage; 8 | 9 | public class StoreInstanceEventArgs : EventArgs 10 | { 11 | /// Gets or initializes the type of the resource. 12 | public required string ResourceType { get; init; } 13 | 14 | /// Gets or initializes the identifier of the resource. 15 | public required string ResourceId { get; init; } 16 | } 17 | -------------------------------------------------------------------------------- /src/FhirStore.Common/Ui/NavPageInfoRec.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Ui; 7 | 8 | /// Information about the navigation page information. 9 | public readonly record struct NavPageInfoRec 10 | { 11 | /// Gets or initializes the display. 12 | public required string Display { get; init; } 13 | 14 | /// Gets or initializes the link. 15 | public required string Link { get; init; } 16 | } 17 | -------------------------------------------------------------------------------- /Dockerfile_chiseled: -------------------------------------------------------------------------------- 1 | FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0-noble AS build-env 2 | ARG TARGETPLATFORM 3 | ARG BUILDPLATFORM 4 | ARG TARGETARCH 5 | 6 | WORKDIR /app 7 | 8 | # Copy everything else and build 9 | COPY . ./ 10 | 11 | RUN dotnet restore --ucr -a $TARGETARCH src/fhir-candle-minimal/fhir-candle-minimal.csproj 12 | RUN dotnet publish --framework net9.0 -a $TARGETARCH src/fhir-candle-minimal/fhir-candle-minimal.csproj -c Release -o out --no-restore 13 | 14 | # Build runtime image 15 | FROM mcr.microsoft.com/dotnet/aspnet:9.0-noble-chiseled 16 | EXPOSE 5826 17 | WORKDIR /app 18 | COPY --from=build-env /app/out . 19 | ENTRYPOINT ["dotnet", "fhir-candle-minimal.dll"] 20 | CMD ["-m", "1000"] 21 | -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Location-davinci-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "Location", 3 | "id" : "davinci-example-location", 4 | "meta" : { 5 | "profile" : [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-locaation" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "name" : "REFERRAL CLINIC", 17 | "address" : { 18 | "line" : [ 19 | "111 1ST STREET" 20 | ], 21 | "city" : "SAN DIEGO", 22 | "state" : "CA", 23 | "postalCode" : "92101", 24 | "country" : "US" 25 | } 26 | } -------------------------------------------------------------------------------- /src/FhirStore.Common/Client/ICandleClient.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | using FhirCandle.Client; 7 | 8 | namespace FhirStore.Client; 9 | 10 | /// Interface for candle client. 11 | public interface ICandleClient 12 | { 13 | /// Gets or initializes URL of the FHIR server. 14 | string FhirServerUrl { get; init; } 15 | 16 | /// Gets or initializes options for controlling this client. 17 | CandleClientSettings Settings { get; init; } 18 | } 19 | -------------------------------------------------------------------------------- /SECURITY.MD: -------------------------------------------------------------------------------- 1 | # Reporting Security Issues 2 | 3 | While this repository contains tooling for developers and testing, we take security bugs seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions. 4 | 5 | To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/ginocanessa/fhir-candle/security/advisories/new) tab. 6 | 7 | The team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance. 8 | 9 | Report security bugs in third-party modules to the person or team maintaining the module. 10 | -------------------------------------------------------------------------------- /src/FhirCandle.Ui.R4/Subscriptions/TourUtils.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Ui.R4.Subscriptions; 7 | 8 | /// Utilities and constants for the Subscriptions Tour. 9 | public static class TourUtils 10 | { 11 | public const string EncounterJson = """" 12 | { 13 | "resourceType": "Encounter", 14 | "status": "finished", 15 | "class": { 16 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", 17 | "code": "VR", 18 | "display": "virtual" 19 | }, 20 | "subject": { "reference": "Patient/example" } 21 | } 22 | """"; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/FhirCandle.Ui.R4B/Subscriptions/TourUtils.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Ui.R4B.Subscriptions; 7 | 8 | /// Utilities and constants for the Subscriptions Tour. 9 | public static class TourUtils 10 | { 11 | public const string EncounterJson = """" 12 | { 13 | "resourceType": "Encounter", 14 | "status": "finished", 15 | "class": { 16 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", 17 | "code": "VR", 18 | "display": "virtual" 19 | }, 20 | "subject": { "reference": "Patient/example" } 21 | } 22 | """"; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/FhirCandle.Ui.Common/Components/CodeBlock.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.JSInterop; 2 | @inject IJSRuntime JS 3 | 4 |

 5 |     @ChildContent
 6 | 
7 | 8 | @code { 9 | /// Gets or sets the child content. 10 | [Parameter] 11 | public RenderFragment ChildContent { get; set; } = null!; 12 | 13 | /// Gets or sets the language. 14 | [Parameter] 15 | public string Language { get; set; } = "json"; 16 | 17 | /// Executes the after render asynchronous action. 18 | /// True to first render. 19 | /// An asynchronous result. 20 | protected override async Task OnAfterRenderAsync(bool firstRender) 21 | { 22 | await JS.InvokeVoidAsync("highlightSnippet"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/FhirCandle.Ui.R5/Subscriptions/TourUtils.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Ui.R5.Subscriptions; 7 | 8 | /// Utilities and constants for the Subscriptions Tour. 9 | public static class TourUtils 10 | { 11 | public const string EncounterJson = """" 12 | { 13 | "resourceType": "Encounter", 14 | "status": "completed", 15 | "class": [{ 16 | "coding": [{ 17 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", 18 | "code": "VR", 19 | "display": "virtual" 20 | }] 21 | }], 22 | "subject": { "reference": "Patient/example" } 23 | } 24 | """"; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /fhirData/smart/open/Practitioner-davinci-susan-watson.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "Practitioner", 3 | "id" : "davinci-susan-watson", 4 | "meta" : { 5 | "profile" : [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitioner" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier" : [ 17 | { 18 | "system" : "http://hl7.org/fhir/sid/us-npi", 19 | "value" : "987654321" 20 | } 21 | ], 22 | "name" : [ 23 | { 24 | "family" : "WATSON", 25 | "given" : [ 26 | "SUSAN" 27 | ] 28 | } 29 | ], 30 | "telecom" : [ 31 | { 32 | "system" : "phone", 33 | "value" : "4029993456" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /fhirData/smart/r4/Practitioner-davinci-susan-watson.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "Practitioner", 3 | "id" : "davinci-susan-watson", 4 | "meta" : { 5 | "profile" : [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitioner" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier" : [ 17 | { 18 | "system" : "http://hl7.org/fhir/sid/us-npi", 19 | "value" : "987654321" 20 | } 21 | ], 22 | "name" : [ 23 | { 24 | "family" : "WATSON", 25 | "given" : [ 26 | "SUSAN" 27 | ] 28 | } 29 | ], 30 | "telecom" : [ 31 | { 32 | "system" : "phone", 33 | "value" : "4029993456" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /fhirData/feature-cs/r4/Practitioner-davinci-susan-watson.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "Practitioner", 3 | "id" : "davinci-susan-watson", 4 | "meta" : { 5 | "profile" : [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitioner" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier" : [ 17 | { 18 | "system" : "http://hl7.org/fhir/sid/us-npi", 19 | "value" : "987654321" 20 | } 21 | ], 22 | "name" : [ 23 | { 24 | "family" : "WATSON", 25 | "given" : [ 26 | "SUSAN" 27 | ] 28 | } 29 | ], 30 | "telecom" : [ 31 | { 32 | "system" : "phone", 33 | "value" : "4029993456" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /src/fhir-candle/wwwroot/highlight/styles/atom-one-dark.min.css: -------------------------------------------------------------------------------- 1 | pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#abb2bf;background:#282c34}.hljs-comment,.hljs-quote{color:#5c6370;font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#c678dd}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#e06c75}.hljs-literal{color:#56b6c2}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#98c379}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#d19a66}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#61aeee}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_{color:#e6c07b}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline} -------------------------------------------------------------------------------- /src/FhirCandle.Ui.R4/FhirCandle.Ui.R4.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/FhirCandle.Ui.R4B/FhirCandle.Ui.R4B.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/fhir-candle/wwwroot/highlight/styles/atom-one-light.min.css: -------------------------------------------------------------------------------- 1 | pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#383a42;background:#fafafa}.hljs-comment,.hljs-quote{color:#a0a1a7;font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#e45649}.hljs-literal{color:#0184bb}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#50a14f}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#986801}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#4078f2}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_{color:#c18401}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline} -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Practitioner-davinci-susan-watson.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "Practitioner", 3 | "id" : "davinci-susan-watson", 4 | "meta" : { 5 | "profile" : [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitioner" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier" : [ 17 | { 18 | "system" : "http://hl7.org/fhir/sid/us-npi", 19 | "value" : "987654321" 20 | } 21 | ], 22 | "name" : [ 23 | { 24 | "family" : "WATSON", 25 | "given" : [ 26 | "SUSAN" 27 | ] 28 | } 29 | ], 30 | "telecom" : [ 31 | { 32 | "system" : "phone", 33 | "value" : "4029993456" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /fhirData/smart/r4/Patient-davinci-jesse-smith.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "davinci-jesse-smith", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-beneficiary" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier": [ 17 | { 18 | "system": "http://example.org/MIN", 19 | "value": "12345678902" 20 | } 21 | ], 22 | "name": [ 23 | { 24 | "family": "SMITH", 25 | "given": [ 26 | "JESSE" 27 | ] 28 | } 29 | ], 30 | "gender": "female", 31 | "birthDate": "1947-01-18", 32 | "address": [ 33 | { 34 | "country": "US" 35 | } 36 | ], 37 | "multipleBirthInteger": 1 38 | } -------------------------------------------------------------------------------- /fhirData/feature-cs/r4/Patient-davinci-jesse-smith.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "davinci-jesse-smith", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-beneficiary" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier": [ 17 | { 18 | "system": "http://example.org/MIN", 19 | "value": "12345678902" 20 | } 21 | ], 22 | "name": [ 23 | { 24 | "family": "SMITH", 25 | "given": [ 26 | "JESSE" 27 | ] 28 | } 29 | ], 30 | "gender": "female", 31 | "birthDate": "1947-01-18", 32 | "address": [ 33 | { 34 | "country": "US" 35 | } 36 | ], 37 | "multipleBirthInteger": 1 38 | } -------------------------------------------------------------------------------- /fhirData/smart/open/Patient-davinci-jesse-smith.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "davinci-jesse-smith", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-beneficiary" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier": [ 17 | { 18 | "system": "http://example.org/MIN", 19 | "value": "12345678902" 20 | } 21 | ], 22 | "name": [ 23 | { 24 | "family": "SMITH", 25 | "given": [ 26 | "JESSE" 27 | ] 28 | } 29 | ], 30 | "gender": "female", 31 | "birthDate": "1947-01-18", 32 | "address": [ 33 | { 34 | "country": "US" 35 | } 36 | ], 37 | "multipleBirthInteger": 1 38 | } -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Organization-insurer-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "Organization", 3 | "id" : "InsurerExample", 4 | "meta" : { 5 | "profile" : [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-insurer" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier" : [ 17 | { 18 | "system" : "http://hl7.org/fhir/sid/us-npi", 19 | "value" : "789312" 20 | } 21 | ], 22 | "active" : true, 23 | "type" : [ 24 | { 25 | "coding" : [ 26 | { 27 | "system" : "https://codesystem.x12.org/005010/98", 28 | "code" : "PR" 29 | } 30 | ] 31 | } 32 | ], 33 | "name" : "MARYLAND CAPITAL INSURANCE COMPANY" 34 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/subscription-encounter-complete-query.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Subscription", 3 | "id": "encounter-complete-query", 4 | "name": "EncounterCompleteQuery", 5 | "status": "active", 6 | "topic": "http://example.org/FHIR/R5/SubscriptionTopic/encounter-complete-query", 7 | "reason": "Test subscription for encounter completion using query triggers", 8 | "filterBy": [ 9 | { 10 | "filterParameter": "patient", 11 | "value": "Patient/example" 12 | } 13 | ], 14 | "channelType": { 15 | "code": "rest-hook" 16 | }, 17 | "endpoint": "https://example.org/Endpoints/P123", 18 | "parameter": [ 19 | { 20 | "name": "Authorization", 21 | "value": "Bearer secret-token-abc-123" 22 | } 23 | ], 24 | "heartbeatPeriod": 600, 25 | "timeout": 5, 26 | "contentType": "application/fhir+json", 27 | "content": "id-only", 28 | "maxCount": 100 29 | } -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Patient-davinci-jesse-smith.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "davinci-jesse-smith", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-beneficiary" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier": [ 17 | { 18 | "system": "http://example.org/MIN", 19 | "value": "12345678902" 20 | } 21 | ], 22 | "name": [ 23 | { 24 | "family": "SMITH", 25 | "given": [ 26 | "JESSE" 27 | ] 28 | } 29 | ], 30 | "gender": "female", 31 | "birthDate": "1947-01-18", 32 | "address": [ 33 | { 34 | "country": "US" 35 | } 36 | ], 37 | "multipleBirthInteger": 1 38 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/subscription-encounter-create-interaction.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Subscription", 3 | "id": "encounter-create-interaction", 4 | "name": "EncounterCreateInteraction", 5 | "status": "active", 6 | "topic": "http://example.org/FHIR/R5/SubscriptionTopic/encounter-create-interaction", 7 | "reason": "Test subscription for encounter create using interaction", 8 | "filterBy": [ 9 | { 10 | "filterParameter": "patient", 11 | "value": "Patient/example" 12 | } 13 | ], 14 | "channelType": { 15 | "code": "rest-hook" 16 | }, 17 | "endpoint": "https://example.org/Endpoints/P123", 18 | "parameter": [ 19 | { 20 | "name": "Authorization", 21 | "value": "Bearer secret-token-abc-123" 22 | } 23 | ], 24 | "heartbeatPeriod": 600, 25 | "timeout": 5, 26 | "contentType": "application/fhir+json", 27 | "content": "id-only", 28 | "maxCount": 100 29 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/subscription-encounter-complete-fhirpath.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Subscription", 3 | "id": "encounter-complete-fhirpath", 4 | "name": "EncounterCompleteFhirpath", 5 | "status": "active", 6 | "topic": "http://example.org/FHIR/R5/SubscriptionTopic/encounter-complete-fhirpath", 7 | "reason": "Test subscription for encounter completion using fhirpath triggers", 8 | "filterBy": [ 9 | { 10 | "filterParameter": "patient", 11 | "value": "Patient/example" 12 | } 13 | ], 14 | "channelType": { 15 | "code": "rest-hook" 16 | }, 17 | "endpoint": "https://example.org/Endpoints/P123", 18 | "parameter": [ 19 | { 20 | "name": "Authorization", 21 | "value": "Bearer secret-token-abc-123" 22 | } 23 | ], 24 | "heartbeatPeriod": 600, 25 | "timeout": 5, 26 | "contentType": "application/fhir+json", 27 | "content": "id-only", 28 | "maxCount": 100 29 | } -------------------------------------------------------------------------------- /src/FhirStore.Common/Models/ReceivedSubscriptionEventArgs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Models; 7 | 8 | /// Additional information for received subscription events. 9 | public class ReceivedSubscriptionEventArgs : EventArgs 10 | { 11 | /// Gets the tenant. 12 | public required TenantConfiguration Tenant { get; init; } 13 | 14 | /// 15 | /// Gets the BundleId that contains this notification. 16 | /// 17 | public required string BundleId { get; init; } 18 | 19 | /// Gets or initializes the status. 20 | public required ParsedSubscriptionStatus Status { get; init; } 21 | } 22 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4b/Bundle-notification-handshake.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Bundle", 3 | "id": "24dd1ba8-d569-418f-96d8-e304433f9424", 4 | "meta": { 5 | "versionId": "1", 6 | "lastUpdated": "2023-08-30T17:41:54.7737765+00:00" 7 | }, 8 | "type": "history", 9 | "timestamp": "2023-08-30T17:41:54.7725947+00:00", 10 | "entry": [ 11 | { 12 | "fullUrl": "urn:uuid:32f88124-963c-4249-bac1-960214bbcb42", 13 | "resource": { 14 | "resourceType": "SubscriptionStatus", 15 | "id": "32f88124-963c-4249-bac1-960214bbcb42", 16 | "status": "active", 17 | "type": "handshake", 18 | "eventsSinceSubscriptionStart": "0", 19 | "subscription": { 20 | "reference": "https://subscriptions.argo.run/fhir/r4b/Subscription/db4ce0bb-fa9c-4092-9f75-34772dc85590" 21 | }, 22 | "topic": "http://example.org/FHIR/SubscriptionTopic/encounter-complete" 23 | } 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /src/FhirStore.Common/Configuration/ConfigurationOption.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Configuration; 7 | 8 | public record class ConfigurationOption 9 | { 10 | /// Gets or initializes the name. 11 | public required string Name { get; init; } 12 | 13 | /// Gets or sets the name of the environment variable name. 14 | public string EnvVarName { get; init; } = string.Empty; 15 | 16 | /// Gets or sets the default value. 17 | public required object DefaultValue { get; init; } 18 | 19 | /// Gets or initializes the CLI option. 20 | public required System.CommandLine.Option CliOption { get; init; } 21 | } 22 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/Subscription-encounter-complete.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Subscription", 3 | "id": "e1f461cb-f41c-470e-aa75-d5223b2c943a", 4 | "meta": { 5 | "versionId": "1", 6 | "lastUpdated": "2023-08-30T17:58:03.4621201+00:00" 7 | }, 8 | "status": "requested", 9 | "topic": "http://example.org/FHIR/SubscriptionTopic/encounter-complete", 10 | "end": "2023-08-30T18:07:58.8651326+00:00", 11 | "reason": "Test subscription for walkthrough", 12 | "filterBy": [ 13 | { 14 | "resourceType": "Encounter", 15 | "filterParameter": "patient", 16 | "value": "Patient/example" 17 | } 18 | ], 19 | "channelType": { 20 | "system": "http://terminology.hl7.org/CodeSystem/subscription-channel-type", 21 | "code": "rest-hook" 22 | }, 23 | "endpoint": "https://subscriptions.argo.run/fhir/r5/$subscription-hook", 24 | "heartbeatPeriod": 120, 25 | "contentType": "application/fhir+json", 26 | "content": "id-only" 27 | } -------------------------------------------------------------------------------- /src/FhirCandle.Ui.R5/FhirCandle.Ui.R5.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/fhir-candle/wwwroot/media/github-mark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/Bundle-notification-handshake.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Bundle", 3 | "id": "1d2910b6-ccd4-402d-bde3-912d2b4e439f", 4 | "meta": { 5 | "versionId": "1", 6 | "lastUpdated": "2023-08-30T17:58:03.788006+00:00" 7 | }, 8 | "type": "subscription-notification", 9 | "timestamp": "2023-08-30T17:58:03.7722833+00:00", 10 | "entry": [ 11 | { 12 | "fullUrl": "urn:uuid:c4e05a01-63b8-45a1-9924-387fe06bd690", 13 | "resource": { 14 | "resourceType": "SubscriptionStatus", 15 | "id": "c4e05a01-63b8-45a1-9924-387fe06bd690", 16 | "status": "active", 17 | "type": "handshake", 18 | "eventsSinceSubscriptionStart": "0", 19 | "subscription": { 20 | "reference": "https://subscriptions.argo.run/fhir/r5/Subscription/e1f461cb-f41c-470e-aa75-d5223b2c943a" 21 | }, 22 | "topic": "http://example.org/FHIR/SubscriptionTopic/encounter-complete" 23 | } 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /src/fhir-candle/wwwroot/media/github-mark-white.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/fhir-candle/wwwroot/highlight/languages/http.min.js: -------------------------------------------------------------------------------- 1 | /*! `http` grammar compiled for Highlight.js 11.8.0 */ 2 | (()=>{var e=(()=>{"use strict";return e=>{const n="HTTP/([32]|1\\.[01])",a={ 3 | className:"attribute", 4 | begin:e.regex.concat("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{ 5 | contains:[{className:"punctuation",begin:/: /,relevance:0,starts:{end:"$", 6 | relevance:0}}]}},s=[a,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0} 7 | }];return{name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{ 8 | begin:"^(?="+n+" \\d{3})",end:/$/,contains:[{className:"meta",begin:n},{ 9 | className:"number",begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/, 10 | contains:s}},{begin:"(?=^[A-Z]+ (.*?) "+n+"$)",end:/$/,contains:[{ 11 | className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{ 12 | className:"meta",begin:n},{className:"keyword",begin:"[A-Z]+"}],starts:{ 13 | end:/\b\B/,illegal:/\S/,contains:s}},e.inherit(a,{relevance:0})]}}})() 14 | ;hljs.registerLanguage("http",e)})(); -------------------------------------------------------------------------------- /src/FhirStore.Common/Extensions/FhirLiteralAttribute.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Extensions; 7 | 8 | /// Attribute for FHIR enum values to link strings and .Net equivalents. 9 | [AttributeUsage(AttributeTargets.Field)] 10 | public class FhirLiteralAttribute : Attribute 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | /// The FHIR literal. 16 | public FhirLiteralAttribute(string fhirLiteral) 17 | { 18 | FhirLiteral = fhirLiteral; 19 | } 20 | 21 | /// Gets or sets the FHIR literal. 22 | public string FhirLiteral { get; protected set; } 23 | } 24 | -------------------------------------------------------------------------------- /src/FhirStore.Common/FhirCandle.Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | enable 6 | enable 7 | FhirCandle 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/FhirCandle.Ui.Versioned/FhirCandle.Ui.Versioned.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | ec6c9e23-56a7-470b-95d9-59d8cccf942c 7 | 8 | 9 | FhirCandle.Ui.Versioned 10 | 11 | 12 | 13 | true 14 | 15 | 16 | true 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/fhir-candle/Components/Routes.razor: -------------------------------------------------------------------------------- 1 | @using fhir.candle 2 | @using fhir.candle.Layout 3 | 4 | @namespace fhir.candle.Components 5 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | Not found 17 | 18 |

Sorry, there's nothing at this address.

19 |
20 |
21 |
22 | -------------------------------------------------------------------------------- /fhir-candle-ui.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 25 | 26 | -------------------------------------------------------------------------------- /src/fhir-candle/Models/IIndexContent.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | using Microsoft.AspNetCore.Components; 7 | 8 | namespace fhir.candle.Models; 9 | 10 | /// Information about the index content. 11 | /// The content for package. 12 | /// The FHIR version literal. 13 | public record struct IndexContentInfo( 14 | string ContentFor, 15 | string FhirVersionLiteral); 16 | 17 | /// Interface for index content. 18 | public interface IIndexContent 19 | { 20 | /// Gets the content for package. 21 | public static virtual string ContentFor => string.Empty; 22 | 23 | /// Gets the FHIR version literal. 24 | public static virtual string FhirVersionLiteral => string.Empty; 25 | } -------------------------------------------------------------------------------- /fhirData/smart/r4/Patient-davinci-joe-smith.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "davinci-joe-smith", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-subscriber" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "extension": [ 17 | { 18 | "url": "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-militaryStatus", 19 | "valueCodeableConcept": { 20 | "coding": [ 21 | { 22 | "system": "https://codesystem.x12.org/005010/584", 23 | "code": "RU" 24 | } 25 | ] 26 | } 27 | } 28 | ], 29 | "identifier": [ 30 | { 31 | "system": "http://example.org/MIN", 32 | "value": "12345678901" 33 | } 34 | ], 35 | "name": [ 36 | { 37 | "family": "SMITH", 38 | "given": [ 39 | "JOE" 40 | ] 41 | } 42 | ], 43 | "gender": "male" 44 | } -------------------------------------------------------------------------------- /fhirData/feature-cs/r4/Patient-davinci-joe-smith.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "davinci-joe-smith", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-subscriber" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "extension": [ 17 | { 18 | "url": "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-militaryStatus", 19 | "valueCodeableConcept": { 20 | "coding": [ 21 | { 22 | "system": "https://codesystem.x12.org/005010/584", 23 | "code": "RU" 24 | } 25 | ] 26 | } 27 | } 28 | ], 29 | "identifier": [ 30 | { 31 | "system": "http://example.org/MIN", 32 | "value": "12345678901" 33 | } 34 | ], 35 | "name": [ 36 | { 37 | "family": "SMITH", 38 | "given": [ 39 | "JOE" 40 | ] 41 | } 42 | ], 43 | "gender": "male" 44 | } -------------------------------------------------------------------------------- /fhirData/smart/open/Patient-davinci-joe-smith.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "davinci-joe-smith", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-subscriber" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "extension": [ 17 | { 18 | "url": "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-militaryStatus", 19 | "valueCodeableConcept": { 20 | "coding": [ 21 | { 22 | "system": "https://codesystem.x12.org/005010/584", 23 | "code": "RU" 24 | } 25 | ] 26 | } 27 | } 28 | ], 29 | "identifier": [ 30 | { 31 | "system": "http://example.org/MIN", 32 | "value": "12345678901" 33 | } 34 | ], 35 | "name": [ 36 | { 37 | "family": "SMITH", 38 | "given": [ 39 | "JOE" 40 | ] 41 | } 42 | ], 43 | "gender": "male" 44 | } -------------------------------------------------------------------------------- /src/FhirStore.Common/Models/ReceivedSubscriptionChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Models; 7 | 8 | /// Additional information for subscription changed events. 9 | public class ReceivedSubscriptionChangedEventArgs 10 | { 11 | /// Gets or initializes the tenant. 12 | public required TenantConfiguration Tenant { get; init; } 13 | 14 | /// Gets or initializes the identifier of the subscription. 15 | public required string SubscriptionReference { get; init; } 16 | 17 | /// Gets or initializes the number of current bundles. 18 | public required int CurrentBundleCount { get; init; } 19 | 20 | /// Gets or initializes a value indicating whether the removed. 21 | public required bool Removed { get; init; } 22 | } 23 | -------------------------------------------------------------------------------- /.github/workflows/build-and-test.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | # Basics from https://learn.microsoft.com/en-us/dotnet/devops/dotnet-test-github-action 3 | on: 4 | push: 5 | branches: [ main ] 6 | paths: 7 | - '**.cs' 8 | - '**.csproj' 9 | pull_request: 10 | branches: [ main ] 11 | paths: 12 | - '**.cs' 13 | - '**.csproj' 14 | 15 | # env: 16 | # DOTNET_VERSION: '9' # The .NET SDK version to use 17 | 18 | jobs: 19 | build-and-test: 20 | 21 | name: build-and-test-${{matrix.os}} 22 | runs-on: ${{ matrix.os }} 23 | strategy: 24 | matrix: 25 | os: [ubuntu-latest, windows-latest, macOS-latest] 26 | 27 | steps: 28 | - uses: actions/checkout@v4 29 | 30 | - uses: actions/setup-dotnet@v4 31 | with: 32 | dotnet-version: | 33 | 9.0 34 | 8.0 35 | 36 | - name: Install dependencies 37 | run: dotnet restore 38 | 39 | - name: Build 40 | run: dotnet build --configuration Release --no-restore 41 | 42 | - name: Test 43 | run: dotnet test --configuration Release --no-restore --verbosity normal 44 | -------------------------------------------------------------------------------- /src/FhirStore.Common/Models/SubscriptionChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Models; 7 | 8 | /// Additional information for subscription changed events. 9 | public class SubscriptionChangedEventArgs 10 | { 11 | /// Gets or initializes the tenant. 12 | public required TenantConfiguration Tenant { get; init; } 13 | 14 | /// Gets or initializes the subscription. 15 | public ParsedSubscription? ChangedSubscription { get; init; } = null; 16 | 17 | /// Gets or initializes the identifier of the removed subscription. 18 | public string? RemovedSubscriptionId { get; init; } = string.Empty; 19 | 20 | /// Gets or initializes a value indicating whether the send handshake. 21 | public bool SendHandshake { get; init; } = false; 22 | } 23 | -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Patient-davinci-joe-smith.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "davinci-joe-smith", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-subscriber" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "extension": [ 17 | { 18 | "url": "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-militaryStatus", 19 | "valueCodeableConcept": { 20 | "coding": [ 21 | { 22 | "system": "https://codesystem.x12.org/005010/584", 23 | "code": "RU" 24 | } 25 | ] 26 | } 27 | } 28 | ], 29 | "identifier": [ 30 | { 31 | "system": "http://example.org/MIN", 32 | "value": "12345678901" 33 | } 34 | ], 35 | "name": [ 36 | { 37 | "family": "SMITH", 38 | "given": [ 39 | "JOE" 40 | ] 41 | } 42 | ], 43 | "gender": "male" 44 | } -------------------------------------------------------------------------------- /src/FhirCandle.Ui.Versioned/FhirCandle.Ui.Versioned.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ec6c9e23-56a7-470b-95d9-59d8cccf942c 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/FhirStore.CommonVersioned/FhirCandle.Versioned.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 05dd03de-a22d-4fd8-a8a8-06fd05f20a18 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /fhirData/subscriptions/r4/SearchParameter-st-url.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "SearchParameter", 3 | "id": "Basic-SubscriptionTopic-Url", 4 | "url": "http://hl7.org/fhir/uv/subscriptions-backport/SearchParameter/SubscriptionTopic-url", 5 | "version": "1.2.0", 6 | "name": "Basic-SubscriptionTopic-Url-SearchParameter", 7 | "status": "draft", 8 | "date": "2025-02-10T00:00:00+00:00", 9 | "publisher": "HL7 FHIR Infrastructure WG", 10 | "description": "This SearchParameter enables query of backported Subscription Topics by canonical url.", 11 | "jurisdiction": [ 12 | { 13 | "coding": [ 14 | { 15 | "system": "http://unstats.un.org/unsd/methods/m49/m49.htm", 16 | "code": "001", 17 | "display": "World" 18 | } 19 | ] 20 | } 21 | ], 22 | "code": "subscriptiontopic-url", 23 | "base": [ 24 | "Basic" 25 | ], 26 | "type": "uri", 27 | "expression": "Basic.extension('http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.url').value", 28 | "xpathUsage": "normal" 29 | } 30 | -------------------------------------------------------------------------------- /src/FhirCandle.Ui.R4B/Components/FhirEditorLinks.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.FluentUI.AspNetCore.Components; 2 | 3 | @if (!string.IsNullOrEmpty(FhirPathLabUrl)) 4 | { 5 | 6 | 7 | @* Size="Size.Small" *@ 8 | 9 | @switch (ResourceType) 10 | { 11 | case "SearchParameter": 12 | case "SubscriptionTopic": 13 | case "StructureMap": 14 | case "StructureDefinition": 15 | case "Questionnaire": 16 | case "Library": 17 | Edit in FHIRPath Lab 21 | break; 22 | } 23 | 24 | 25 | } 26 | 27 | @code { 28 | [Parameter] 29 | public string BaseUrl { get; set; } = string.Empty; 30 | 31 | [Parameter] 32 | public string ResourceType { get; set; } = string.Empty; 33 | 34 | [Parameter] 35 | public string Id { get; set; } = string.Empty; 36 | 37 | [Parameter] 38 | public string FhirPathLabUrl { get; set; } = string.Empty; 39 | } -------------------------------------------------------------------------------- /src/FhirStore.Common/Models/SubscriptionSendEventArgs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Models; 7 | 8 | /// Additional information for subscription events. 9 | public class SubscriptionSendEventArgs : EventArgs 10 | { 11 | /// Gets the tenant. 12 | public required TenantConfiguration Tenant { get; init; } 13 | 14 | /// Gets the parsed subscription. 15 | public required ParsedSubscription Subscription { get; init; } 16 | 17 | /// Gets or initializes the notification events. 18 | public IEnumerable NotificationEvents { get; init; } = Array.Empty(); 19 | 20 | /// Gets or initializes the type of the notification. 21 | public ParsedSubscription.NotificationTypeCodes NotificationType { get; init; } = ParsedSubscription.NotificationTypeCodes.EventNotification; 22 | } 23 | -------------------------------------------------------------------------------- /src/FhirStore.Common/Configuration/ConfigOptionAttribute.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Configuration; 7 | 8 | /// Attribute for configuration option. 9 | public class ConfigOptionAttribute : Attribute 10 | { 11 | /// Gets or sets the name of the environment variable name. 12 | public string EnvName { get; set; } = string.Empty; 13 | 14 | /// Gets or sets the name of the argument. 15 | public string ArgName { get; set; } = string.Empty; 16 | 17 | /// Gets or sets the argument aliases. 18 | public string[] ArgAliases { get; set; } = []; 19 | 20 | /// Gets or sets the description. 21 | public string Description { get; set; } = string.Empty; 22 | 23 | /// Gets or sets the arity, specified as a FHIR Cardinality string. 24 | public string ArgArity { get; set; } = "0..1"; 25 | } 26 | -------------------------------------------------------------------------------- /src/fhir-candle/wwwroot/highlight/styles/default.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | Theme: Default 3 | Description: Original highlight.js style 4 | Author: (c) Ivan Sagalaev 5 | Maintainer: @highlightjs/core-team 6 | Website: https://highlightjs.org/ 7 | License: see project LICENSE 8 | Touched: 2021 9 | */pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#f3f3f3;color:#444}.hljs-comment{color:#697070}.hljs-punctuation,.hljs-tag{color:#444a}.hljs-tag .hljs-attr,.hljs-tag .hljs-name{color:#444}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-link,.hljs-operator,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#ab5656}.hljs-literal{color:#695}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#38a}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Gino Canessa. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Organization-requester-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Organization", 3 | "id": "UMOExample", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-requestor" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier": [ 17 | { 18 | "system": "http://hl7.org/fhir/sid/us-npi", 19 | "value": "8189991234" 20 | } 21 | ], 22 | "active": true, 23 | "type": [ 24 | { 25 | "coding": [ 26 | { 27 | "system": "https://codesystem.x12.org/005010/98", 28 | "code": "X3" 29 | } 30 | ] 31 | } 32 | ], 33 | "name": "DR. JOE SMITH CORPORATION", 34 | "address": [ 35 | { 36 | "line": [ 37 | "111 1ST STREET" 38 | ], 39 | "city": "SAN DIEGO", 40 | "state": "CA", 41 | "postalCode": "92101", 42 | "country": "US" 43 | } 44 | ] 45 | } -------------------------------------------------------------------------------- /fhirData/smart/open/Patient-davinci-amy-shaw.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "davinci-amy-shaw", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-cdex/StructureDefinition/cdex-patient-demographics" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier": [ 17 | { 18 | "use": "usual", 19 | "type": { 20 | "coding": [ 21 | { 22 | "system": "http://hl7.org/fhir/us/davinci-hrex/CodeSystem/hrex-temp", 23 | "code": "UMB", 24 | "display": "Member Number" 25 | } 26 | ], 27 | "text": "Member Number" 28 | }, 29 | "system": "http://example.org/cdex/payer/member-ids", 30 | "value": "Member123" 31 | } 32 | ], 33 | "name": [ 34 | { 35 | "family": "Shaw", 36 | "given": [ 37 | "Amy" 38 | ] 39 | } 40 | ], 41 | "birthDate": "1987-02-20" 42 | } -------------------------------------------------------------------------------- /fhirData/smart/r4/Patient-davinci-amy-shaw.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "davinci-amy-shaw", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-cdex/StructureDefinition/cdex-patient-demographics" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier": [ 17 | { 18 | "use": "usual", 19 | "type": { 20 | "coding": [ 21 | { 22 | "system": "http://hl7.org/fhir/us/davinci-hrex/CodeSystem/hrex-temp", 23 | "code": "UMB", 24 | "display": "Member Number" 25 | } 26 | ], 27 | "text": "Member Number" 28 | }, 29 | "system": "http://example.org/cdex/payer/member-ids", 30 | "value": "Member123" 31 | } 32 | ], 33 | "name": [ 34 | { 35 | "family": "Shaw", 36 | "given": [ 37 | "Amy" 38 | ] 39 | } 40 | ], 41 | "birthDate": "1987-02-20" 42 | } -------------------------------------------------------------------------------- /fhirData/feature-cs/r4/Patient-davinci-amy-shaw.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "davinci-amy-shaw", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-cdex/StructureDefinition/cdex-patient-demographics" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier": [ 17 | { 18 | "use": "usual", 19 | "type": { 20 | "coding": [ 21 | { 22 | "system": "http://hl7.org/fhir/us/davinci-hrex/CodeSystem/hrex-temp", 23 | "code": "UMB", 24 | "display": "Member Number" 25 | } 26 | ], 27 | "text": "Member Number" 28 | }, 29 | "system": "http://example.org/cdex/payer/member-ids", 30 | "value": "Member123" 31 | } 32 | ], 33 | "name": [ 34 | { 35 | "family": "Shaw", 36 | "given": [ 37 | "Amy" 38 | ] 39 | } 40 | ], 41 | "birthDate": "1987-02-20" 42 | } -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Patient-davinci-amy-shaw.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "davinci-amy-shaw", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-cdex/StructureDefinition/cdex-patient-demographics" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier": [ 17 | { 18 | "use": "usual", 19 | "type": { 20 | "coding": [ 21 | { 22 | "system": "http://hl7.org/fhir/us/davinci-hrex/CodeSystem/hrex-temp", 23 | "code": "UMB", 24 | "display": "Member Number" 25 | } 26 | ], 27 | "text": "Member Number" 28 | }, 29 | "system": "http://example.org/cdex/payer/member-ids", 30 | "value": "Member123" 31 | } 32 | ], 33 | "name": [ 34 | { 35 | "family": "Shaw", 36 | "given": [ 37 | "Amy" 38 | ] 39 | } 40 | ], 41 | "birthDate": "1987-02-20" 42 | } -------------------------------------------------------------------------------- /src/FhirStore.Common/Storage/InstanceTableRec.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Storage; 7 | 8 | /// 9 | /// Represents a record in the instance table. 10 | /// 11 | public record class InstanceTableRec 12 | { 13 | /// 14 | /// Gets or sets the ID of the instance. 15 | /// 16 | public required string Id { get; init; } 17 | 18 | /// 19 | /// Gets or sets the name of the instance. 20 | /// 21 | public string Name { get; init; } = string.Empty; 22 | 23 | /// 24 | /// Gets or sets the URL of the instance. 25 | /// 26 | public string Url { get; init; } = string.Empty; 27 | 28 | /// 29 | /// Gets or sets the description of the instance. 30 | /// 31 | public string Description { get; init; } = string.Empty; 32 | 33 | /// 34 | /// Gets or sets the identifiers of the instance. 35 | /// 36 | public string Identifiers { get; init; } = string.Empty; 37 | } 38 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4/Bundle-notification-handshake.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Bundle", 3 | "id": "64578ab3-2bf6-497a-a873-7c29fa2090d6", 4 | "meta": { 5 | "versionId": "1", 6 | "lastUpdated": "2023-08-30T16:59:28.7896182+00:00" 7 | }, 8 | "type": "history", 9 | "timestamp": "2023-08-30T16:59:28.7767539+00:00", 10 | "entry": [ 11 | { 12 | "fullUrl": "urn:uuid:a3671fee-b159-478b-9a96-335376d006e9", 13 | "resource": { 14 | "resourceType": "Parameters", 15 | "id": "a3671fee-b159-478b-9a96-335376d006e9", 16 | "parameter": [ 17 | { 18 | "name": "subscription", 19 | "valueString": "https://subscriptions.argo.run/fhir/r4/Subscription/383c610b-8a8b-4173-b363-7b811509aadd" 20 | }, 21 | { 22 | "name": "topic", 23 | "valueCanonical": "http://example.org/FHIR/SubscriptionTopic/encounter-complete" 24 | }, 25 | { 26 | "name": "status", 27 | "valueCode": "active" 28 | }, 29 | { 30 | "name": "type", 31 | "valueCode": "handshake" 32 | }, 33 | { 34 | "name": "events-since-subscription-start", 35 | "valueString": "0" 36 | } 37 | ] 38 | } 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /.github/workflows/argo-ris.yml: -------------------------------------------------------------------------------- 1 | name: Restart Deployment 2 | on: 3 | workflow_dispatch: 4 | workflow_run: 5 | workflows: ['Publish on GitHub Container Registry'] 6 | types: [completed] 7 | branches: 8 | - main 9 | 10 | jobs: 11 | restart_deployment: 12 | runs-on: ubuntu-latest 13 | if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} 14 | 15 | steps: 16 | - name: Configure Kubectl 17 | env: 18 | KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} 19 | run: | 20 | mkdir -p $HOME/.kube 21 | KUBE_TOKEN=$(echo $KUBE_CONFIG | jq -r .KUBE_TOKEN) 22 | KUBE_CERTIFICATE=$(echo $KUBE_CONFIG | jq -r .KUBE_CERTIFICATE) 23 | KUBE_SERVER=$(echo $KUBE_CONFIG | jq -r .KUBE_SERVER) 24 | echo "$KUBE_CERTIFICATE" | base64 --decode > $HOME/.kube/ca.crt 25 | kubectl config set-cluster argocluster-doks --server="$KUBE_SERVER" --certificate-authority=$HOME/.kube/ca.crt 26 | kubectl config set-credentials github-actions-deployer --token="$KUBE_TOKEN" 27 | kubectl config set-context argo --cluster=argocluster-doks --user=github-actions-deployer --namespace=subscriptions-ri 28 | kubectl config use-context argo 29 | - name: Restart Deployment 30 | run: | 31 | kubectl -n subscriptions-ri rollout restart deployment 32 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4/Subscription-encounter-complete.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Subscription", 3 | "id": "383c610b-8a8b-4173-b363-7b811509aadd", 4 | "meta": { 5 | "versionId": "1", 6 | "lastUpdated": "2023-08-30T16:59:28.5793088+00:00" 7 | }, 8 | "status": "requested", 9 | "end": "2023-08-30T17:06:34.7431722+00:00", 10 | "reason": "Test subscription for walkthrough", 11 | "criteria": "http://example.org/FHIR/SubscriptionTopic/encounter-complete", 12 | "_criteria": { 13 | "extension": [ 14 | { 15 | "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-filter-criteria", 16 | "valueString": "Encounter?patient=Patient/example" 17 | } 18 | ] 19 | }, 20 | "channel": { 21 | "extension": [ 22 | { 23 | "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-heartbeat-period", 24 | "valueInteger": 120 25 | } 26 | ], 27 | "type": "rest-hook", 28 | "endpoint": "https://subscriptions.argo.run/fhir/r4/$subscription-hook", 29 | "payload": "application/fhir+json", 30 | "_payload": { 31 | "extension": [ 32 | { 33 | "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-payload-content", 34 | "valueCode": "id-only" 35 | } 36 | ] 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4b/Subscription-encounter-complete.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Subscription", 3 | "id": "db4ce0bb-fa9c-4092-9f75-34772dc85590", 4 | "meta": { 5 | "versionId": "1", 6 | "lastUpdated": "2023-08-30T17:41:54.6882171+00:00" 7 | }, 8 | "status": "requested", 9 | "end": "2023-08-30T17:51:49.4137027+00:00", 10 | "reason": "Test subscription for walkthrough", 11 | "criteria": "http://example.org/FHIR/SubscriptionTopic/encounter-complete", 12 | "_criteria": { 13 | "extension": [ 14 | { 15 | "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-filter-criteria", 16 | "valueString": "Encounter?patient=Patient/example" 17 | } 18 | ] 19 | }, 20 | "channel": { 21 | "extension": [ 22 | { 23 | "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-heartbeat-period", 24 | "valueInteger": 120 25 | } 26 | ], 27 | "type": "rest-hook", 28 | "endpoint": "https://subscriptions.argo.run/fhir/r4b/$subscription-hook", 29 | "payload": "application/fhir+json", 30 | "_payload": { 31 | "extension": [ 32 | { 33 | "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-payload-content", 34 | "valueCode": "id-only" 35 | } 36 | ] 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4/patient-example-c.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "pat3", 4 | "text": { 5 | "status": "generated", 6 | "div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003e\n \n \u003cp\u003ePatient Simon Notsowell @ Acme Healthcare, Inc. MR \u003d 123457, DECEASED\u003c/p\u003e\n \n \u003c/div\u003e" 7 | }, 8 | "identifier": [ 9 | { 10 | "use": "usual", 11 | "type": { 12 | "coding": [ 13 | { 14 | "system": "http://terminology.hl7.org/CodeSystem/v2-0203", 15 | "code": "MR" 16 | } 17 | ] 18 | }, 19 | "system": "urn:oid:0.1.2.3.4.5.6.7", 20 | "value": "123457" 21 | } 22 | ], 23 | "active": true, 24 | "name": [ 25 | { 26 | "use": "official", 27 | "family": "Notsowell", 28 | "given": [ 29 | "Simon" 30 | ] 31 | } 32 | ], 33 | "gender": "male", 34 | "birthDate": "1982-01-23", 35 | "deceasedDateTime": "2015-02-14T13:42:00+10:00", 36 | "managingOrganization": { 37 | "reference": "Organization/1", 38 | "display": "ACME Healthcare, Inc" 39 | }, 40 | "meta": { 41 | "tag": [ 42 | { 43 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 44 | "code": "HTEST", 45 | "display": "test health data" 46 | } 47 | ] 48 | } 49 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4/patient-example-d.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "pat4", 4 | "text": { 5 | "status": "generated", 6 | "div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003e\n\t\t\t\u003cp\u003ePatient Sandy Notsowell @ Acme Healthcare, Inc. MR \u003d 123458, DECEASED\u003c/p\u003e\n\t\t\u003c/div\u003e" 7 | }, 8 | "identifier": [ 9 | { 10 | "use": "usual", 11 | "type": { 12 | "coding": [ 13 | { 14 | "system": "http://terminology.hl7.org/CodeSystem/v2-0203", 15 | "code": "MR" 16 | } 17 | ] 18 | }, 19 | "system": "urn:oid:0.1.2.3.4.5.6.7", 20 | "value": "123458" 21 | } 22 | ], 23 | "active": true, 24 | "name": [ 25 | { 26 | "use": "official", 27 | "family": "Notsowell", 28 | "given": [ 29 | "Sandy" 30 | ] 31 | } 32 | ], 33 | "gender": "female", 34 | "birthDate": "1982-08-02", 35 | "deceasedBoolean": true, 36 | "multipleBirthInteger": 3, 37 | "managingOrganization": { 38 | "reference": "Organization/1", 39 | "display": "ACME Healthcare, Inc" 40 | }, 41 | "meta": { 42 | "tag": [ 43 | { 44 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 45 | "code": "HTEST", 46 | "display": "test health data" 47 | } 48 | ] 49 | } 50 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4b/patient-example-c.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "pat3", 4 | "text": { 5 | "status": "generated", 6 | "div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003e\n \n \u003cp\u003ePatient Simon Notsowell @ Acme Healthcare, Inc. MR \u003d 123457, DECEASED\u003c/p\u003e\n \n \u003c/div\u003e" 7 | }, 8 | "identifier": [ 9 | { 10 | "use": "usual", 11 | "type": { 12 | "coding": [ 13 | { 14 | "system": "http://terminology.hl7.org/CodeSystem/v2-0203", 15 | "code": "MR" 16 | } 17 | ] 18 | }, 19 | "system": "urn:oid:0.1.2.3.4.5.6.7", 20 | "value": "123457" 21 | } 22 | ], 23 | "active": true, 24 | "name": [ 25 | { 26 | "use": "official", 27 | "family": "Notsowell", 28 | "given": [ 29 | "Simon" 30 | ] 31 | } 32 | ], 33 | "gender": "male", 34 | "birthDate": "1982-01-23", 35 | "deceasedDateTime": "2015-02-14T13:42:00+10:00", 36 | "managingOrganization": { 37 | "reference": "Organization/1", 38 | "display": "ACME Healthcare, Inc" 39 | }, 40 | "meta": { 41 | "tag": [ 42 | { 43 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 44 | "code": "HTEST", 45 | "display": "test health data" 46 | } 47 | ] 48 | } 49 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4b/patient-example-d.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "pat4", 4 | "text": { 5 | "status": "generated", 6 | "div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003e\n\t\t\t\u003cp\u003ePatient Sandy Notsowell @ Acme Healthcare, Inc. MR \u003d 123458, DECEASED\u003c/p\u003e\n\t\t\u003c/div\u003e" 7 | }, 8 | "identifier": [ 9 | { 10 | "use": "usual", 11 | "type": { 12 | "coding": [ 13 | { 14 | "system": "http://terminology.hl7.org/CodeSystem/v2-0203", 15 | "code": "MR" 16 | } 17 | ] 18 | }, 19 | "system": "urn:oid:0.1.2.3.4.5.6.7", 20 | "value": "123458" 21 | } 22 | ], 23 | "active": true, 24 | "name": [ 25 | { 26 | "use": "official", 27 | "family": "Notsowell", 28 | "given": [ 29 | "Sandy" 30 | ] 31 | } 32 | ], 33 | "gender": "female", 34 | "birthDate": "1982-08-02", 35 | "deceasedBoolean": true, 36 | "multipleBirthInteger": 3, 37 | "managingOrganization": { 38 | "reference": "Organization/1", 39 | "display": "ACME Healthcare, Inc" 40 | }, 41 | "meta": { 42 | "tag": [ 43 | { 44 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 45 | "code": "HTEST", 46 | "display": "test health data" 47 | } 48 | ] 49 | } 50 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/patient-example-c.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "pat3", 4 | "text": { 5 | "status": "generated", 6 | "div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003e\n \n \u003cp\u003ePatient Simon Notsowell @ Acme Healthcare, Inc. MR \u003d 123457, DECEASED\u003c/p\u003e\n \n \u003c/div\u003e" 7 | }, 8 | "identifier": [ 9 | { 10 | "use": "usual", 11 | "type": { 12 | "coding": [ 13 | { 14 | "system": "http://terminology.hl7.org/CodeSystem/v2-0203", 15 | "code": "MR" 16 | } 17 | ] 18 | }, 19 | "system": "urn:oid:0.1.2.3.4.5.6.7", 20 | "value": "123457" 21 | } 22 | ], 23 | "active": true, 24 | "name": [ 25 | { 26 | "use": "official", 27 | "family": "Notsowell", 28 | "given": [ 29 | "Simon" 30 | ] 31 | } 32 | ], 33 | "gender": "male", 34 | "birthDate": "1982-01-23", 35 | "deceasedDateTime": "2015-02-14T13:42:00+10:00", 36 | "managingOrganization": { 37 | "reference": "Organization/1", 38 | "display": "ACME Healthcare, Inc" 39 | }, 40 | "meta": { 41 | "tag": [ 42 | { 43 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 44 | "code": "HTEST", 45 | "display": "test health data" 46 | } 47 | ] 48 | } 49 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/patient-example-d.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Patient", 3 | "id": "pat4", 4 | "text": { 5 | "status": "generated", 6 | "div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003e\n\t\t\t\u003cp\u003ePatient Sandy Notsowell @ Acme Healthcare, Inc. MR \u003d 123458, DECEASED\u003c/p\u003e\n\t\t\u003c/div\u003e" 7 | }, 8 | "identifier": [ 9 | { 10 | "use": "usual", 11 | "type": { 12 | "coding": [ 13 | { 14 | "system": "http://terminology.hl7.org/CodeSystem/v2-0203", 15 | "code": "MR" 16 | } 17 | ] 18 | }, 19 | "system": "urn:oid:0.1.2.3.4.5.6.7", 20 | "value": "123458" 21 | } 22 | ], 23 | "active": true, 24 | "name": [ 25 | { 26 | "use": "official", 27 | "family": "Notsowell", 28 | "given": [ 29 | "Sandy" 30 | ] 31 | } 32 | ], 33 | "gender": "female", 34 | "birthDate": "1982-08-02", 35 | "deceasedBoolean": true, 36 | "multipleBirthInteger": 3, 37 | "managingOrganization": { 38 | "reference": "Organization/1", 39 | "display": "ACME Healthcare, Inc" 40 | }, 41 | "meta": { 42 | "tag": [ 43 | { 44 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 45 | "code": "HTEST", 46 | "display": "test health data" 47 | } 48 | ] 49 | } 50 | } -------------------------------------------------------------------------------- /src/FhirStore.Common/Ui/INavTracker.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Ui; 7 | 8 | /// Interface for navigation tracker. 9 | public interface INavTracker 10 | { 11 | /// Occurs when On Theme Changed. 12 | event EventHandler? OnThemeChanged; 13 | 14 | /// Gets a value indicating whether this object is dark mode. 15 | bool IsDarkMode { get; } 16 | 17 | /// Notifies a navigation. 18 | /// The pages. 19 | void NotifyNav(NavPageInfoRec[] pages); 20 | 21 | /// Logs to the JavaScript console. 22 | /// The message. 23 | /// This call does not need to be awaited, but needs to be async so that it can resolve the JS runtime call. 24 | Task JsLogAsync(string message); 25 | 26 | /// Uses JS navigator.clipboard.writeText to copy contents to the clipboard. 27 | /// The content. 28 | /// An asynchronous result. 29 | Task JsClipboardCopy(string content); 30 | } 31 | -------------------------------------------------------------------------------- /.github/workflows/nuget-tool.yml: -------------------------------------------------------------------------------- 1 | name: Publish dotnet tool 2 | # Basics from https://docs.microsoft.com/en-us/azure/dev-spaces/how-to/github-actions 3 | on: 4 | workflow_dispatch: 5 | workflow_run: 6 | workflows: ['Tests'] 7 | types: [completed] 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} 15 | 16 | steps: 17 | - uses: actions/checkout@v4 18 | 19 | - uses: actions/setup-dotnet@v4 20 | with: 21 | dotnet-version: | 22 | 9.0 23 | 8.0 24 | 25 | - name: Build and Publish 26 | run: | 27 | dotnet restore src/fhir-candle/fhir-candle.csproj 28 | dotnet pack -c Release ./src/fhir-candle/fhir-candle.csproj 29 | mv ./src/fhir-candle/bin/Release/net8.0/publish/wwwroot ./src/fhir-candle/bin/Release/net8.0/publish/staticwebassets 30 | mv ./src/fhir-candle/bin/Release/net9.0/publish/wwwroot ./src/fhir-candle/bin/Release/net9.0/publish/staticwebassets 31 | 7z a ./nupkg/*.nupkg ./src/fhir-candle/bin/Release/net8.0/publish/staticwebassets/ 32 | 7z a ./nupkg/*.nupkg ./src/fhir-candle/bin/Release/net9.0/publish/staticwebassets/ 33 | dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.GINOC_NUGET }} --source https://api.nuget.org/v3/index.json 34 | -------------------------------------------------------------------------------- /src/FhirStore.Common/Smart/SmartClientRegistratonResponse.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | using System.Text.Json.Serialization; 7 | 8 | namespace FhirCandle.Smart; 9 | 10 | /// A smart client registraton response. 11 | public class SmartClientRegistratonResponse 12 | { 13 | /// Gets or sets the identifier of the client. 14 | [JsonPropertyName("client_id")] 15 | public string ClientId { get; set; } = string.Empty; 16 | 17 | 18 | /// Gets or sets the issued at (seconds UNIX time). 19 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 20 | [JsonPropertyName("client_id_issued_at")] 21 | public long? IssuedAt { get; set; } = null; 22 | 23 | /// Gets or sets the client secret. 24 | [JsonPropertyName("client_secret")] 25 | public string ClientSecret { get; set;} = string.Empty; 26 | 27 | /// Gets or sets the secret expires at. 28 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 29 | [JsonPropertyName("client_secret_expires_at")] 30 | public long? SecretExpiresAt { get; set; } = null; 31 | } 32 | -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/Encounter-surgical-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "pas-example-surgical-encounter", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-encounter" 7 | ] 8 | }, 9 | "extension": [ 10 | { 11 | "url": "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-patientStatus", 12 | "valueCodeableConcept": { 13 | "coding": [ 14 | { 15 | "system": "https://www.nubc.org/CodeSystem/PatDischargeStatus", 16 | "code": "30", 17 | "display": "Still a patient" 18 | } 19 | ] 20 | } 21 | } 22 | ], 23 | "status": "planned", 24 | "class": { 25 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", 26 | "code": "AMB" 27 | }, 28 | "type": [ 29 | { 30 | "coding": [ 31 | { 32 | "system": "https://www.nubc.org/CodeSystem/PriorityTypeOfAdmitOrVisit", 33 | "code": "2" 34 | } 35 | ] 36 | } 37 | ], 38 | "subject": { 39 | "reference": "Patient/davinci-joe-smith" 40 | }, 41 | "period": { 42 | "start": "2020-07-02", 43 | "end": "2020-07-09" 44 | }, 45 | "hospitalization": { 46 | "admitSource": { 47 | "coding": [ 48 | { 49 | "system": "https://www.nubc.org/CodeSystem/PointOfOrigin", 50 | "code": "5" 51 | } 52 | ] 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /src/FhirStore.Common/Models/SubscriptionEvent.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | namespace FhirCandle.Models; 7 | 8 | /// A subscription event. 9 | public record class SubscriptionEvent 10 | { 11 | /// Gets or initializes the subscription id. 12 | public required string SubscriptionId { get; init; } 13 | 14 | /// Gets or initializes subscription topic url. 15 | public required string TopicUrl { get; init; } 16 | 17 | /// Gets or initializes the event number. 18 | public required long EventNumber { get; init; } 19 | 20 | /// Gets or initializes date/time when this event was generated. 21 | public DateTimeOffset Timestamp { get; init; } = DateTimeOffset.Now; 22 | 23 | /// Gets or initializes the subscription status at generation (defaults to active). 24 | public string StatusAtGeneration { get; init; } = "active"; 25 | 26 | /// Gets or initializes the focus resource (versioned). 27 | public required object Focus { get; init; } 28 | 29 | /// Gets or initializes additional context (enumerable of versioned resources). 30 | public IEnumerable? AdditionalContext { get; init; } 31 | } 32 | -------------------------------------------------------------------------------- /src/fhir-candle/Layout/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | } 28 | 29 | .top-row a:first-child { 30 | overflow: hidden; 31 | text-overflow: ellipsis; 32 | } 33 | 34 | @media (max-width: 640.98px) { 35 | .top-row:not(.auth) { 36 | display: none; 37 | } 38 | 39 | .top-row.auth { 40 | justify-content: space-between; 41 | } 42 | 43 | .top-row a, .top-row .btn-link { 44 | margin-left: 0; 45 | } 46 | } 47 | 48 | @media (min-width: 641px) { 49 | .page { 50 | flex-direction: row; 51 | } 52 | 53 | .sidebar { 54 | width: 250px; 55 | height: 100vh; 56 | position: sticky; 57 | top: 0; 58 | } 59 | 60 | .top-row { 61 | position: sticky; 62 | top: 0; 63 | z-index: 1; 64 | } 65 | 66 | .top-row, article { 67 | padding-left: 2rem !important; 68 | padding-right: 1.5rem !important; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/UcumTests.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | using fhir.candle.Tests.Extensions; 7 | using fhir.candle.Ucum; 8 | using FluentAssertions; 9 | using System.Net; 10 | using Xunit.Abstractions; 11 | 12 | namespace fhir.candle.Tests; 13 | 14 | /// Unit tests core UCUM functional.ity. 15 | public class UcumTests : IDisposable 16 | { 17 | private readonly ITestOutputHelper _testOutputHelper; 18 | 19 | /// 20 | /// Initializes a new instance of the class. 21 | /// 22 | /// The test output helper. 23 | public UcumTests(ITestOutputHelper testOutputHelper) 24 | { 25 | _testOutputHelper = testOutputHelper; 26 | } 27 | 28 | /// 29 | /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged 30 | /// resources. 31 | /// 32 | public void Dispose() 33 | { 34 | // cleanup 35 | } 36 | 37 | [Fact] 38 | public void BasicParseTestAgeY() 39 | { 40 | //_testOutputHelper.WriteLine(json); 41 | 42 | string val = "1 a"; 43 | 44 | bool result = UcumUtils.isValidUcum(val); 45 | 46 | result.Should().BeTrue(); 47 | } 48 | } -------------------------------------------------------------------------------- /src/fhir-candle/Services/IFhirStoreManager.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | using FhirCandle.Models; 7 | using FhirCandle.Storage; 8 | using FhirStore.Smart; 9 | using Microsoft.Extensions.Hosting; 10 | 11 | namespace fhir.candle.Services; 12 | 13 | /// Interface for FHIR store manager. 14 | public interface IFhirStoreManager : IHostedService, IReadOnlyDictionary 15 | { 16 | /// Occurs when On Changed. 17 | event EventHandler? OnChanged; 18 | 19 | /// Initializes the FHIR Store Manager and tenants. 20 | void Init(); 21 | 22 | /// Gets the additional pages by tenant. 23 | IReadOnlyDictionary> AdditionalPagesByTenant { get; } 24 | 25 | /// Loads ri contents. 26 | /// The dir. 27 | void LoadRiContents(string dir); 28 | 29 | /// Loads requested packages. 30 | /// The supplemental root. 31 | /// True to load examples. 32 | /// An asynchronous result. 33 | Task LoadRequestedPackages(string supplementalRoot, bool loadExamples); 34 | 35 | /// State has changed. 36 | void StateHasChanged(); 37 | } 38 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4/Observation-656.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Observation", 3 | "id": "656", 4 | "text": { 5 | "status": "generated", 6 | "div": "

Generated Narrative with Details

id: 656

identifier: patientId-urn:oid:1.2.4~0000000000000000~152584~20170503155426~820

status: final

code: MDC_FLOW_AWAY_EXP_FORCED_PEAK (Details : {urn:iso:std:iso:11073:10101 code '152584' = '152584', given as 'MDC_FLOW_AWAY_EXP_FORCED_PEAK'})

subject: Patient/PatientId-patientId

effective: 03/05/2017 3:54:26 PM

performer: Patient/PatientId-patientId

value: 820 cL/s (Details: urn:iso:std:iso:11073:10101 code 265201 = '265201')

" 7 | }, 8 | "identifier": [ 9 | { 10 | "value": "patientId-urn:oid:1.2.4~0000000000000000~152584~20170503155426~820" 11 | } 12 | ], 13 | "status": "final", 14 | "code": { 15 | "coding": [ 16 | { 17 | "system": "urn:iso:std:iso:11073:10101", 18 | "code": "152584", 19 | "display": "MDC_FLOW_AWAY_EXP_FORCED_PEAK" 20 | } 21 | ] 22 | }, 23 | "subject": { 24 | "reference": "Patient/PatientId-patientId" 25 | }, 26 | "effectiveDateTime": "2017-05-03T15:54:26-04:00", 27 | "performer": [ 28 | { 29 | "reference": "Patient/PatientId-patientId" 30 | } 31 | ], 32 | "valueQuantity": { 33 | "value": 820, 34 | "unit": "cL/s", 35 | "system": "urn:iso:std:iso:11073:10101", 36 | "code": "265201" 37 | } 38 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4b/Observation-656.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Observation", 3 | "id": "656", 4 | "text": { 5 | "status": "generated", 6 | "div": "

Generated Narrative with Details

id: 656

identifier: patientId-urn:oid:1.2.4~0000000000000000~152584~20170503155426~820

status: final

code: MDC_FLOW_AWAY_EXP_FORCED_PEAK (Details : {urn:iso:std:iso:11073:10101 code '152584' = '152584', given as 'MDC_FLOW_AWAY_EXP_FORCED_PEAK'})

subject: Patient/PatientId-patientId

effective: 03/05/2017 3:54:26 PM

performer: Patient/PatientId-patientId

value: 820 cL/s (Details: urn:iso:std:iso:11073:10101 code 265201 = '265201')

" 7 | }, 8 | "identifier": [ 9 | { 10 | "value": "patientId-urn:oid:1.2.4~0000000000000000~152584~20170503155426~820" 11 | } 12 | ], 13 | "status": "final", 14 | "code": { 15 | "coding": [ 16 | { 17 | "system": "urn:iso:std:iso:11073:10101", 18 | "code": "152584", 19 | "display": "MDC_FLOW_AWAY_EXP_FORCED_PEAK" 20 | } 21 | ] 22 | }, 23 | "subject": { 24 | "reference": "Patient/PatientId-patientId" 25 | }, 26 | "effectiveDateTime": "2017-05-03T15:54:26-04:00", 27 | "performer": [ 28 | { 29 | "reference": "Patient/PatientId-patientId" 30 | } 31 | ], 32 | "valueQuantity": { 33 | "value": 820, 34 | "unit": "cL/s", 35 | "system": "urn:iso:std:iso:11073:10101", 36 | "code": "265201" 37 | } 38 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/Observation-656.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Observation", 3 | "id": "656", 4 | "text": { 5 | "status": "generated", 6 | "div": "

Generated Narrative with Details

id: 656

identifier: patientId-urn:oid:1.2.4~0000000000000000~152584~20170503155426~820

status: final

code: MDC_FLOW_AWAY_EXP_FORCED_PEAK (Details : {urn:iso:std:iso:11073:10101 code '152584' = '152584', given as 'MDC_FLOW_AWAY_EXP_FORCED_PEAK'})

subject: Patient/PatientId-patientId

effective: 03/05/2017 3:54:26 PM

performer: Patient/PatientId-patientId

value: 820 cL/s (Details: urn:iso:std:iso:11073:10101 code 265201 = '265201')

" 7 | }, 8 | "identifier": [ 9 | { 10 | "value": "patientId-urn:oid:1.2.4~0000000000000000~152584~20170503155426~820" 11 | } 12 | ], 13 | "status": "final", 14 | "code": { 15 | "coding": [ 16 | { 17 | "system": "urn:iso:std:iso:11073:10101", 18 | "code": "152584", 19 | "display": "MDC_FLOW_AWAY_EXP_FORCED_PEAK" 20 | } 21 | ] 22 | }, 23 | "subject": { 24 | "reference": "Patient/PatientId-patientId" 25 | }, 26 | "effectiveDateTime": "2017-05-03T15:54:26-04:00", 27 | "performer": [ 28 | { 29 | "reference": "Patient/PatientId-patientId" 30 | } 31 | ], 32 | "valueQuantity": { 33 | "value": 820, 34 | "unit": "cL/s", 35 | "system": "urn:iso:std:iso:11073:10101", 36 | "code": "265201" 37 | } 38 | } -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Encounter-amy-shaw-surgical.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "amy-shaw-surgical", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-encounter" 7 | ] 8 | }, 9 | "extension": [ 10 | { 11 | "url": "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-patientStatus", 12 | "valueCodeableConcept": { 13 | "coding": [ 14 | { 15 | "system": "https://www.nubc.org/CodeSystem/PatDischargeStatus", 16 | "code": "30", 17 | "display": "Still a patient" 18 | } 19 | ] 20 | } 21 | } 22 | ], 23 | "status": "planned", 24 | "class": { 25 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", 26 | "code": "AMB" 27 | }, 28 | "type": [ 29 | { 30 | "coding": [ 31 | { 32 | "system": "https://www.nubc.org/CodeSystem/PriorityTypeOfAdmitOrVisit", 33 | "code": "2" 34 | } 35 | ] 36 | } 37 | ], 38 | "subject": { 39 | "reference": "Patient/davinci-amy-shaw" 40 | }, 41 | "period": { 42 | "start": "2020-07-02", 43 | "end": "2020-07-09" 44 | }, 45 | "hospitalization": { 46 | "admitSource": { 47 | "coding": [ 48 | { 49 | "system": "https://www.nubc.org/CodeSystem/PointOfOrigin", 50 | "code": "5" 51 | } 52 | ] 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Encounter-joe-smith-surgical.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "joe-smith-surgical", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-encounter" 7 | ] 8 | }, 9 | "extension": [ 10 | { 11 | "url": "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-patientStatus", 12 | "valueCodeableConcept": { 13 | "coding": [ 14 | { 15 | "system": "https://www.nubc.org/CodeSystem/PatDischargeStatus", 16 | "code": "30", 17 | "display": "Still a patient" 18 | } 19 | ] 20 | } 21 | } 22 | ], 23 | "status": "planned", 24 | "class": { 25 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", 26 | "code": "AMB" 27 | }, 28 | "type": [ 29 | { 30 | "coding": [ 31 | { 32 | "system": "https://www.nubc.org/CodeSystem/PriorityTypeOfAdmitOrVisit", 33 | "code": "2" 34 | } 35 | ] 36 | } 37 | ], 38 | "subject": { 39 | "reference": "Patient/davinci-joe-smith" 40 | }, 41 | "period": { 42 | "start": "2020-07-02", 43 | "end": "2020-07-09" 44 | }, 45 | "hospitalization": { 46 | "admitSource": { 47 | "coding": [ 48 | { 49 | "system": "https://www.nubc.org/CodeSystem/PointOfOrigin", 50 | "code": "5" 51 | } 52 | ] 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Encounter-jesse-smith-surgical.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "jesse-smith-surgical", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-encounter" 7 | ] 8 | }, 9 | "extension": [ 10 | { 11 | "url": "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-patientStatus", 12 | "valueCodeableConcept": { 13 | "coding": [ 14 | { 15 | "system": "https://www.nubc.org/CodeSystem/PatDischargeStatus", 16 | "code": "30", 17 | "display": "Still a patient" 18 | } 19 | ] 20 | } 21 | } 22 | ], 23 | "status": "planned", 24 | "class": { 25 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", 26 | "code": "AMB" 27 | }, 28 | "type": [ 29 | { 30 | "coding": [ 31 | { 32 | "system": "https://www.nubc.org/CodeSystem/PriorityTypeOfAdmitOrVisit", 33 | "code": "2" 34 | } 35 | ] 36 | } 37 | ], 38 | "subject": { 39 | "reference": "Patient/davinci-jesse-smith" 40 | }, 41 | "period": { 42 | "start": "2020-07-02", 43 | "end": "2020-07-09" 44 | }, 45 | "hospitalization": { 46 | "admitSource": { 47 | "coding": [ 48 | { 49 | "system": "https://www.nubc.org/CodeSystem/PointOfOrigin", 50 | "code": "5" 51 | } 52 | ] 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /src/fhir-candle/Ucum/UcumUtils.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | using Antlr4.Runtime; 7 | 8 | namespace fhir.candle.Ucum; 9 | 10 | /// An ucum utilities. 11 | public static class UcumUtils 12 | { 13 | /// Query if 'val' is valid ucum. 14 | /// The value. 15 | /// True if valid ucum, false if not. 16 | public static bool isValidUcum(string val) 17 | { 18 | try 19 | { 20 | ICharStream stream = CharStreams.fromString(val); 21 | UCUMLexer lexer = new UCUMLexer(stream); 22 | //lexer.RemoveErrorListeners(); 23 | //lexer.AddErrorListener(SYNTAX_ERROR_LISTENER); 24 | 25 | CommonTokenStream tokens = new CommonTokenStream(lexer); 26 | 27 | UCUMParser parser = new UCUMParser(tokens); 28 | //parser.RemoveErrorListeners(); 29 | //parser.AddErrorListener(SYNTAX_ERROR_LISTENER); 30 | 31 | UCUMParser.MainTermContext expression = parser.mainTerm(); 32 | return expression != null; 33 | } 34 | catch (Exception ex) 35 | { 36 | Console.WriteLine($"isValidUcum <<< caught {ex.Message}"); 37 | if (ex.InnerException != null) 38 | { 39 | Console.WriteLine($" <<< {ex.InnerException.Message}"); 40 | } 41 | return false; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/fhir-candle/_ForPackages/ManifestDateJsonConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Text; 5 | using Newtonsoft.Json; 6 | 7 | namespace fhir.candle._ForPackages 8 | { 9 | internal class ManifestDateJsonConverter : JsonConverter 10 | { 11 | public override bool CanConvert(Type objectType) 12 | { 13 | return (objectType == typeof(DateTimeOffset)) || 14 | (objectType == typeof(string)); 15 | } 16 | 17 | public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer) 18 | { 19 | string? dateString = reader.Value?.ToString(); 20 | 21 | if (string.IsNullOrEmpty(dateString)) 22 | { 23 | return null; 24 | } 25 | 26 | if (DateTimeOffset.TryParseExact( 27 | dateString, 28 | "yyyyMMddHHmmss", 29 | CultureInfo.InvariantCulture.DateTimeFormat, 30 | DateTimeStyles.None, out DateTimeOffset dto)) 31 | { 32 | return dto; 33 | } 34 | 35 | return null; 36 | } 37 | 38 | public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer) 39 | { 40 | if (value is DateTimeOffset dto) 41 | { 42 | serializer.Serialize(writer, dto.ToUniversalTime().ToString("yyyyMMddHHmmss")); 43 | } 44 | else if (value != null) 45 | { 46 | serializer.Serialize(writer, value); 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /fhirData/smart/r4/Practitioner-davinci-ronald-bone.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Practitioner", 3 | "id": "davinci-ronald-bone", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier": [ 17 | { 18 | "system": "http://hl7.org/fhir/sid/us-npi", 19 | "value": "9941339100" 20 | }, 21 | { 22 | "extension": [ 23 | { 24 | "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-jurisdiction", 25 | "valueCodeableConcept": { 26 | "coding": [ 27 | { 28 | "system": "https://www.usps.com/", 29 | "code": "MA" 30 | } 31 | ], 32 | "text": "Massachusetts" 33 | } 34 | } 35 | ], 36 | "system": "http://www.acme.org/practitioners", 37 | "value": "25456" 38 | } 39 | ], 40 | "name": [ 41 | { 42 | "family": "Bone", 43 | "given": [ 44 | "Ronald" 45 | ], 46 | "prefix": [ 47 | "Dr" 48 | ] 49 | } 50 | ], 51 | "address": [ 52 | { 53 | "use": "work", 54 | "line": [ 55 | "1003 Healthcare Drive" 56 | ], 57 | "city": "Amherst", 58 | "state": "MA", 59 | "postalCode": "01002" 60 | } 61 | ] 62 | } -------------------------------------------------------------------------------- /fhirData/feature-cs/r4/Practitioner-davinci-ronald-bone.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Practitioner", 3 | "id": "davinci-ronald-bone", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier": [ 17 | { 18 | "system": "http://hl7.org/fhir/sid/us-npi", 19 | "value": "9941339100" 20 | }, 21 | { 22 | "extension": [ 23 | { 24 | "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-jurisdiction", 25 | "valueCodeableConcept": { 26 | "coding": [ 27 | { 28 | "system": "https://www.usps.com/", 29 | "code": "MA" 30 | } 31 | ], 32 | "text": "Massachusetts" 33 | } 34 | } 35 | ], 36 | "system": "http://www.acme.org/practitioners", 37 | "value": "25456" 38 | } 39 | ], 40 | "name": [ 41 | { 42 | "family": "Bone", 43 | "given": [ 44 | "Ronald" 45 | ], 46 | "prefix": [ 47 | "Dr" 48 | ] 49 | } 50 | ], 51 | "address": [ 52 | { 53 | "use": "work", 54 | "line": [ 55 | "1003 Healthcare Drive" 56 | ], 57 | "city": "Amherst", 58 | "state": "MA", 59 | "postalCode": "01002" 60 | } 61 | ] 62 | } -------------------------------------------------------------------------------- /fhirData/smart/open/Practitioner-davinci-ronald-bone.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Practitioner", 3 | "id": "davinci-ronald-bone", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier": [ 17 | { 18 | "system": "http://hl7.org/fhir/sid/us-npi", 19 | "value": "9941339100" 20 | }, 21 | { 22 | "extension": [ 23 | { 24 | "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-jurisdiction", 25 | "valueCodeableConcept": { 26 | "coding": [ 27 | { 28 | "system": "https://www.usps.com/", 29 | "code": "MA" 30 | } 31 | ], 32 | "text": "Massachusetts" 33 | } 34 | } 35 | ], 36 | "system": "http://www.acme.org/practitioners", 37 | "value": "25456" 38 | } 39 | ], 40 | "name": [ 41 | { 42 | "family": "Bone", 43 | "given": [ 44 | "Ronald" 45 | ], 46 | "prefix": [ 47 | "Dr" 48 | ] 49 | } 50 | ], 51 | "address": [ 52 | { 53 | "use": "work", 54 | "line": [ 55 | "1003 Healthcare Drive" 56 | ], 57 | "city": "Amherst", 58 | "state": "MA", 59 | "postalCode": "01002" 60 | } 61 | ] 62 | } -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Practitioner-davinci-ronald-bone.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Practitioner", 3 | "id": "davinci-ronald-bone", 4 | "meta": { 5 | "profile": [ 6 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner" 7 | ], 8 | "tag": [ 9 | { 10 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 11 | "code": "HTEST", 12 | "display": "test health data" 13 | } 14 | ] 15 | }, 16 | "identifier": [ 17 | { 18 | "system": "http://hl7.org/fhir/sid/us-npi", 19 | "value": "9941339100" 20 | }, 21 | { 22 | "extension": [ 23 | { 24 | "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-jurisdiction", 25 | "valueCodeableConcept": { 26 | "coding": [ 27 | { 28 | "system": "https://www.usps.com/", 29 | "code": "MA" 30 | } 31 | ], 32 | "text": "Massachusetts" 33 | } 34 | } 35 | ], 36 | "system": "http://www.acme.org/practitioners", 37 | "value": "25456" 38 | } 39 | ], 40 | "name": [ 41 | { 42 | "family": "Bone", 43 | "given": [ 44 | "Ronald" 45 | ], 46 | "prefix": [ 47 | "Dr" 48 | ] 49 | } 50 | ], 51 | "address": [ 52 | { 53 | "use": "work", 54 | "line": [ 55 | "1003 Healthcare Drive" 56 | ], 57 | "city": "Amherst", 58 | "state": "MA", 59 | "postalCode": "01002" 60 | } 61 | ] 62 | } -------------------------------------------------------------------------------- /src/fhir-candle/Layout/NavMenu.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.FluentUI.AspNetCore.Components; 2 | 3 | @namespace fhir.candle.Layout 4 | 5 | @implements IDialogContentComponent 6 | 7 | @inject IFhirStoreManager StoreManager 8 | @inject ISmartAuthManager AuthManager 9 | 10 | 11 | 12 | Home 13 | 14 | @if (AuthManager.IsEnabled) 15 | { 16 | SMART Clients 17 | } 18 | 19 | @foreach (string key in StoreManager.Keys.OrderBy(s => s)) 20 | { 21 | 22 | FHIR Contents 23 | Local Subscriptions 24 | Received Notifications 25 | 26 | } 27 | 28 | 29 | 30 | @GetType().Assembly.GetName().Version?.ToString() 31 | 32 | 33 | @code { 34 | [Parameter] 35 | public string Content { get; set; } = default!; 36 | } 37 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/Extensions/ShouldlyExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.CompilerServices; 3 | using Shouldly; 4 | 5 | namespace fhir.candle.Tests.Extensions; 6 | 7 | internal static class ShouldlyExtensions 8 | { 9 | [MethodImpl(MethodImplOptions.NoInlining)] 10 | public static void ShouldNotBeNullOrEmpty([NotNull] this Dictionary? actual, string? customMessage = null) 11 | where TKey : notnull 12 | { 13 | if ((actual == null) || (actual.Count == 0)) 14 | throw new ShouldAssertException(new ActualShouldlyMessage(actual, customMessage).ToString()); 15 | } 16 | 17 | [MethodImpl(MethodImplOptions.NoInlining)] 18 | public static void ShouldNotBeNullOrEmpty([NotNull] this IEnumerable? actual, string? customMessage = null) 19 | { 20 | if ((actual == null) || (!actual.Any())) 21 | throw new ShouldAssertException(new ActualShouldlyMessage(actual, customMessage).ToString()); 22 | } 23 | 24 | [MethodImpl(MethodImplOptions.NoInlining)] 25 | public static void ShouldHaveCount([NotNull] this IEnumerable? actual, int count, string? customMessage = null) 26 | { 27 | if (actual == null || actual.Count() != count) 28 | throw new ShouldAssertException(new ExpectedShouldlyMessage(actual, customMessage).ToString()); 29 | } 30 | 31 | [MethodImpl(MethodImplOptions.NoInlining)] 32 | public static void ShouldHaveCount([NotNull] this Dictionary? actual, int count, string? customMessage = null) 33 | where TKey : notnull 34 | { 35 | if (actual == null || actual.Count() != count) 36 | throw new ShouldAssertException(new ExpectedShouldlyMessage(actual, customMessage).ToString()); 37 | } 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Condition-cdex-shaw-copd.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Condition", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" 6 | ], 7 | "tag": [ 8 | { 9 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 10 | "code": "HTEST", 11 | "display": "test health data" 12 | } 13 | ] 14 | }, 15 | "extension": [ 16 | { 17 | "url": "http://hl7.org/fhir/StructureDefinition/condition-assertedDate", 18 | "valueDateTime": "2023-08-22" 19 | } 20 | ], 21 | "clinicalStatus": { 22 | "coding": [ 23 | { 24 | "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", 25 | "code": "active", 26 | "display": "Active" 27 | } 28 | ], 29 | "text": "Active" 30 | }, 31 | "verificationStatus": { 32 | "coding": [ 33 | { 34 | "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", 35 | "code": "confirmed", 36 | "display": "Confirmed" 37 | } 38 | ], 39 | "text": "Confirmed" 40 | }, 41 | "category": [ 42 | { 43 | "coding": [ 44 | { 45 | "system": "http://terminology.hl7.org/CodeSystem/condition-category", 46 | "code": "problem-list-item", 47 | "display": "Problem List Item" 48 | } 49 | ], 50 | "text": "Problem List Item" 51 | } 52 | ], 53 | "code": { 54 | "coding": [ 55 | { 56 | "system": "http://snomed.info/sct", 57 | "code": "13645005", 58 | "display": "COPD", 59 | "version": "http://snomed.info/sct/731000124108" 60 | } 61 | ], 62 | "text": "Copd" 63 | }, 64 | "subject": { 65 | "reference": "urn:uuid:81a90f68-4177-11ee-a1fc-daaf18ab2cba", 66 | "display": "Amy V. Shaw" 67 | }, 68 | "recordedDate": "2023-08-22" 69 | } -------------------------------------------------------------------------------- /fhir-candle.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13.0 6 | 7 | net9.0;net8.0 8 | enable 9 | enable 10 | $([System.DateTime]::Now.ToString("yyyy.MMdd.HHmm")) 11 | $(VersionPrefix) 12 | $(AssemblyName.Replace(' ', '_')) 13 | $([System.DateTime]::Now.ToString("0.yyyy.MMdd.HHmm")) 14 | $([System.DateTime]::Now.ToString("0.yyyy.MMdd.HHmm")) 15 | GinoCanessa 16 | FHIR Foundation Project 17 | Copyright 2022-2025 18 | git 19 | https://github.com/FHIR/fhir-candle 20 | en 21 | 22 | 23 | 24 | 25 | LICENSE 26 | 27 | 28 | README.md 29 | 30 | 31 | 32 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Condition-cdex-shaw-ear-burn.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Condition", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" 6 | ], 7 | "tag": [ 8 | { 9 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 10 | "code": "HTEST", 11 | "display": "test health data" 12 | } 13 | ] 14 | }, 15 | "extension": [ 16 | { 17 | "url": "http://hl7.org/fhir/StructureDefinition/condition-assertedDate", 18 | "valueDateTime": "2021-01-21" 19 | } 20 | ], 21 | "clinicalStatus": { 22 | "coding": [ 23 | { 24 | "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", 25 | "code": "resolved", 26 | "display": "Resolved" 27 | } 28 | ], 29 | "text": "Active" 30 | }, 31 | "verificationStatus": { 32 | "coding": [ 33 | { 34 | "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", 35 | "code": "confirmed", 36 | "display": "Confirmed" 37 | } 38 | ], 39 | "text": "Confirmed" 40 | }, 41 | "category": [ 42 | { 43 | "coding": [ 44 | { 45 | "system": "http://terminology.hl7.org/CodeSystem/condition-category", 46 | "code": "problem-list-item", 47 | "display": "Problem List Item" 48 | } 49 | ], 50 | "text": "Problem List Item" 51 | } 52 | ], 53 | "code": { 54 | "coding": [ 55 | { 56 | "system": "http://snomed.info/sct", 57 | "code": "39065001", 58 | "display": "Burn of ear", 59 | "version": "http://snomed.info/sct/731000124108" 60 | } 61 | ], 62 | "text": "Burn Of Ear" 63 | }, 64 | "subject": { 65 | "reference": "urn:uuid:81a90f68-4177-11ee-a1fc-daaf18ab2cba", 66 | "display": "Amy V. Shaw" 67 | }, 68 | "recordedDate": "2021-01-21" 69 | } -------------------------------------------------------------------------------- /src/FhirStore.CommonVersioned/FhirStore.CommonVersioned.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 05dd03de-a22d-4fd8-a8a8-06fd05f20a18 7 | 8 | 9 | FhirCandle 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Condition-cdex-shaw-abscess.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Condition", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" 6 | ], 7 | "tag": [ 8 | { 9 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 10 | "code": "HTEST", 11 | "display": "test health data" 12 | } 13 | ] 14 | }, 15 | "extension": [ 16 | { 17 | "url": "http://hl7.org/fhir/StructureDefinition/condition-assertedDate", 18 | "valueDateTime": "2018-02-02" 19 | } 20 | ], 21 | "clinicalStatus": { 22 | "coding": [ 23 | { 24 | "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", 25 | "code": "resolved", 26 | "display": "Resolved" 27 | } 28 | ], 29 | "text": "Active" 30 | }, 31 | "verificationStatus": { 32 | "coding": [ 33 | { 34 | "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", 35 | "code": "confirmed", 36 | "display": "Confirmed" 37 | } 38 | ], 39 | "text": "Confirmed" 40 | }, 41 | "category": [ 42 | { 43 | "coding": [ 44 | { 45 | "system": "http://terminology.hl7.org/CodeSystem/condition-category", 46 | "code": "problem-list-item", 47 | "display": "Problem List Item" 48 | } 49 | ], 50 | "text": "Problem List Item" 51 | } 52 | ], 53 | "code": { 54 | "coding": [ 55 | { 56 | "system": "http://snomed.info/sct", 57 | "code": "18099001", 58 | "display": "Retropharyngeal abscess", 59 | "version": "http://snomed.info/sct/731000124108" 60 | } 61 | ], 62 | "text": "Retropharyngeal Abscess" 63 | }, 64 | "subject": { 65 | "reference": "urn:uuid:81a90f68-4177-11ee-a1fc-daaf18ab2cba", 66 | "display": "Amy V. Shaw" 67 | }, 68 | "recordedDate": "2018-02-02" 69 | } -------------------------------------------------------------------------------- /fhirData/hl7.fhir.us.davinci-cdex/provider/Condition-cdex-shaw-examplitis.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Condition", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" 6 | ], 7 | "tag": [ 8 | { 9 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", 10 | "code": "HTEST", 11 | "display": "test health data" 12 | } 13 | ] 14 | }, 15 | "extension": [ 16 | { 17 | "url": "http://hl7.org/fhir/StructureDefinition/condition-assertedDate", 18 | "valueDateTime": "2023-08-21T20:16:25.019Z" 19 | } 20 | ], 21 | "clinicalStatus": { 22 | "coding": [ 23 | { 24 | "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", 25 | "code": "active", 26 | "display": "Active" 27 | } 28 | ], 29 | "text": "Active" 30 | }, 31 | "verificationStatus": { 32 | "coding": [ 33 | { 34 | "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", 35 | "code": "confirmed", 36 | "display": "Confirmed" 37 | } 38 | ], 39 | "text": "Confirmed" 40 | }, 41 | "category": [ 42 | { 43 | "coding": [ 44 | { 45 | "system": "http://terminology.hl7.org/CodeSystem/condition-category", 46 | "code": "problem-list-item", 47 | "display": "Problem List Item" 48 | } 49 | ], 50 | "text": "Problem List Item" 51 | } 52 | ], 53 | "code": { 54 | "coding": [ 55 | { 56 | "system": "http://snomed.info/sct", 57 | "code": "123456789", 58 | "display": "examplitis", 59 | "version": "http://snomed.info/sct/731000124108" 60 | } 61 | ], 62 | "text": "Examplitis" 63 | }, 64 | "subject": { 65 | "reference": "urn:uuid:81a90f68-4177-11ee-a1fc-daaf18ab2cba", 66 | "display": "Amy V. Shaw" 67 | }, 68 | "recordedDate": "2023-08-21T20:16:25.019Z" 69 | } -------------------------------------------------------------------------------- /src/FhirStore.Common/Models/IPackagePage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace FhirCandle.Models; 8 | 9 | /// Information about the package page. 10 | /// The content for. 11 | /// Name of the page. 12 | /// The description. 13 | /// Full pathname of the route file. 14 | /// The FHIR version literal. 15 | /// The FHIR version numeric. 16 | /// The only show on endpoint. 17 | public record struct PackagePageInfo( 18 | string ContentFor, 19 | string PageName, 20 | string Description, 21 | string RoutePath, 22 | string FhirVersionLiteral, 23 | string FhirVersionNumeric, 24 | string OnlyShowOnEndpoint); 25 | 26 | /// Interface for package/ri pages. 27 | public interface IPackagePage 28 | { 29 | /// Gets the package or ri name this page is for. 30 | virtual static string ContentFor => string.Empty; 31 | 32 | /// Gets the name of the page. 33 | virtual static string PageName => string.Empty; 34 | 35 | /// Gets the description. 36 | virtual static string Description => string.Empty; 37 | 38 | /// Gets the full pathname of the route file. 39 | virtual static string RoutePath => string.Empty; 40 | 41 | /// Gets the FHIR version literal. 42 | virtual static string FhirVersionLiteral => string.Empty; 43 | 44 | /// Gets the FHIR version numeric. 45 | virtual static string FhirVersionNumeric => string.Empty; 46 | 47 | /// Gets the only show on endpoint. 48 | virtual static string OnlyShowOnEndpoint => string.Empty; 49 | } 50 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/subscriptiontopic-encounter-create-interaction.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "SubscriptionTopic", 3 | "id": "encounter-create-interaction", 4 | "url": "http://example.org/FHIR/R5/SubscriptionTopic/encounter-create-interaction", 5 | "version": "1.0.0-beta.1", 6 | "title": "example", 7 | "status": "draft", 8 | "date": "2019-01-01", 9 | "description": "Example topic for all created encounters", 10 | "resourceTrigger": [ 11 | { 12 | "description": "An Encounter has been created", 13 | "resource": "http://hl7.org/fhir/StructureDefinition/Encounter", 14 | "supportedInteraction": [ 15 | "create" 16 | ] 17 | } 18 | ], 19 | "canFilterBy": [ 20 | { 21 | "description": "Filter based on the subject of an encounter.", 22 | "resource": "Encounter", 23 | "filterParameter": "subject" 24 | }, 25 | { 26 | "description": "Filter based on the group membership of the subject of an encounter.", 27 | "resource": "Encounter", 28 | "filterParameter": "_in" 29 | }, 30 | { 31 | "description": "Filter based on the length of an encounter.", 32 | "resource": "Encounter", 33 | "filterParameter": "length", 34 | "comparator": [ 35 | "gt", 36 | "lt", 37 | "ge", 38 | "le" 39 | ] 40 | }, 41 | { 42 | "description": "Filter based on the account for billing an encounter.", 43 | "resource": "Encounter", 44 | "filterParameter": "account", 45 | "modifier": [ 46 | "missing", 47 | "not", 48 | "identifier" 49 | ] 50 | } 51 | ], 52 | "notificationShape": [ 53 | { 54 | "resource": "Encounter", 55 | "include": [ 56 | "Encounter:patient&iterate=Patient.link", 57 | "Encounter:practitioner", 58 | "Encounter:service-provider", 59 | "Encounter:account", 60 | "Encounter:diagnosis", 61 | "Encounter:observation", 62 | "Encounter:location" 63 | ] 64 | } 65 | ] 66 | } -------------------------------------------------------------------------------- /CONTRIBUTING.MD: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | This document describes guidelines for contributing to this repo. 4 | 5 | ## Submitting Pull Requests 6 | 7 | - **DO** submit all changes via pull requests (PRs). They will be reviewed and potentially be merged by maintainers after a peer review that includes at least one of the team members. 8 | - **DO** give PRs short but descriptive names. 9 | - **DO** write a useful but brief description of what the PR is for. 10 | - **DO** refer to any relevant issues and use [keywords](https://help.github.com/articles/closing-issues-using-keywords/) that automatically close issues when the PR is merged. 11 | - **DO** ensure each commit successfully builds. The entire PR must pass all checks before it will be merged. 12 | - **DO** address PR feedback in additional commits instead of amending. 13 | - **DO** assume that [Squash and Merge](https://blog.github.com/2016-04-01-squash-your-commits/) will be used to merge the commits unless specifically requested otherwise. 14 | - **DO NOT** submit "work in progress" PRs. A PR should only be submitted when it is considered ready for review. 15 | - **DO NOT** mix independent and unrelated changes in one PR. 16 | 17 | ## Coding Style 18 | 19 | The coding style is enforced through [StyleCop.Analyzers](https://github.com/DotNetAnalyzers/StyleCopAnalyzers), [.editorconfig](.editorconfig), and [stylecop.json](stylecop.json). Contributors should ensure these guidelines are followed when making submissions. 20 | 21 | - **DO** address the StyleCop.Analyzers errors. 22 | - **DO** follow the [.editorconfig](.editorconfig) and [stylecop.json](stylecop.json) settings. 23 | 24 | ## Creating Issues 25 | 26 | - **DO** use a descriptive title that identifies the issue or the requested feature. 27 | - **DO** write a detailed description of the issue or the requested feature. 28 | - **DO** provide details for issues you create: 29 | - Describe the expected and actual behavior. 30 | - Provide any relevant exception message or OperationOutcome. 31 | - **DO** subscribe to notifications for created issues in case there are any follow-up questions. -------------------------------------------------------------------------------- /src/FhirCandle.Ui.R5/Subscriptions/TourStep01.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.FluentUI.AspNetCore.Components; 2 | 3 | 4 | 5 | In FHIR @Store.Config.FhirVersion, topics are discovered by searching the server for 6 | SubscriptionTopic resources. The list of topics in this 7 | tenant can be found 8 | here, 10 | or you can submit a FHIR search to: 11 | @Store.Config.BaseUrl/SubscriptionTopic. 12 | 13 | 14 | 15 | For this walkthrough, we will be using the included encounter-complete 16 | topic that has a canonical URL of http://example.org/FHIR/SubscriptionTopic/encounter-complete. 17 | The definition for this topic can be seen at 18 | here, 20 | or you can submit a FHIR read to: 21 | @Store.Config.BaseUrl/SubscriptionTopic/encounter-complete. 22 | 23 | 24 | 25 | Click next to select the encounter-complete topic. 26 | 27 | 28 | 29 | @code { 30 | /// Gets or sets the navigation tracker. 31 | [CascadingParameter] 32 | public INavTracker? NavTracker { get; set; } = null; 33 | 34 | /// Gets or sets the name of the store. 35 | [Parameter] 36 | public string StoreName { get; set; } = string.Empty; 37 | 38 | /// Gets or sets the package name. 39 | [Parameter] 40 | public IFhirStore Store { get; set; } = null!; 41 | } 42 | -------------------------------------------------------------------------------- /src/FhirCandle.Ui.R4B/Subscriptions/TourStep01.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.FluentUI.AspNetCore.Components; 2 | 3 | 4 | 5 | In FHIR @Store.Config.FhirVersion, topics are discovered by searching the server for 6 | SubscriptionTopic resources. The list of topics in this 7 | tenant can be found 8 | here, 10 | or you can submit a FHIR search to: 11 | @Store.Config.BaseUrl/SubscriptionTopic. 12 | 13 | 14 | 15 | For this walkthrough, we will be using the included encounter-complete 16 | topic that has a canonical URL of http://example.org/FHIR/SubscriptionTopic/encounter-complete. 17 | The definition for this topic can be seen at 18 | here, 20 | or you can submit a FHIR read to: 21 | @Store.Config.BaseUrl/SubscriptionTopic/encounter-complete. 22 | 23 | 24 | 25 | Click next to select the encounter-complete topic. 26 | 27 | 28 | 29 | @code { 30 | /// Gets or sets the navigation tracker. 31 | [CascadingParameter] 32 | public INavTracker? NavTracker { get; set; } = null; 33 | 34 | /// Gets or sets the name of the store. 35 | [Parameter] 36 | public string StoreName { get; set; } = string.Empty; 37 | 38 | /// Gets or sets the package name. 39 | [Parameter] 40 | public IFhirStore Store { get; set; } = null!; 41 | } 42 | -------------------------------------------------------------------------------- /src/FhirStore.Common/Models/FhirResponseContext.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | using System.Net; 7 | 8 | namespace FhirCandle.Models; 9 | 10 | /// A FHIR response context. 11 | public record class FhirResponseContext 12 | { 13 | /// Gets or initializes the status code. 14 | public HttpStatusCode? StatusCode { get; init; } 15 | 16 | /// Gets or initializes the serialized format. 17 | public string MimeType { get; init; } = string.Empty; 18 | 19 | /// Gets or initializes the resource. 20 | public object? Resource { get; init; } 21 | 22 | /// Gets or initializes the type of the resource. 23 | public string ResourceType { get; init; } = string.Empty; 24 | 25 | /// Gets or initializes the identifier. 26 | public string Id { get; init; } = string.Empty; 27 | 28 | /// Gets or initializes the serialized resource. 29 | public string SerializedResource { get; init; } = string.Empty; 30 | 31 | /// Gets or initializes the OperationOutcome. 32 | public object? Outcome { get; init; } 33 | 34 | /// Gets or initializes the serialized outcome. 35 | public string SerializedOutcome { get; init; } = string.Empty; 36 | 37 | /// Gets or initializes information describing a non-FHIR response. 38 | public object? NonFhirData { get; init; } 39 | 40 | /// Gets or initializes the tag. 41 | public string ETag { get; init; } = string.Empty; 42 | 43 | /// Gets or initializes the location. 44 | public string Location { get; init; } = string.Empty; 45 | 46 | /// Gets or initializes the last modified. 47 | public string LastModified { get; init; } = string.Empty; 48 | } 49 | -------------------------------------------------------------------------------- /fhirData/subscriptions/r4b/subscriptiontopic-encounter-complete.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "SubscriptionTopic", 3 | "id": "encounter-complete", 4 | "url": "http://example.org/FHIR/SubscriptionTopic/encounter-complete", 5 | "version": "1.0.0-fhir.r4b", 6 | "title": "encounter-complete", 7 | "status": "draft", 8 | "date": "2019-01-01", 9 | "description": "Example topic for completed encounters", 10 | "resourceTrigger": [ 11 | { 12 | "description": "An Encounter has been completed", 13 | "resource": "http://hl7.org/fhir/StructureDefinition/Encounter", 14 | "supportedInteraction": [ 15 | "create", 16 | "update" 17 | ], 18 | "queryCriteria": { 19 | "previous": "status:not=finished", 20 | "resultForCreate": "test-passes", 21 | "current": "status=finished", 22 | "resultForDelete": "test-fails", 23 | "requireBoth": true 24 | }, 25 | "fhirPathCriteria": "(%previous.id.empty() or (%previous.status != 'finished')) and (%current.status = 'finished')" 26 | } 27 | ], 28 | "canFilterBy": [ 29 | { 30 | "description": "Filter based on the subject of an encounter.", 31 | "resource": "Encounter", 32 | "filterParameter": "subject" 33 | }, 34 | { 35 | "description": "Filter based on the group membership of the subject of an encounter.", 36 | "resource": "Encounter", 37 | "filterParameter": "_in" 38 | }, 39 | { 40 | "description": "Filter based on the length of an encounter.", 41 | "resource": "Encounter", 42 | "filterParameter": "length", 43 | "modifier": [ 44 | "gt", 45 | "lt", 46 | "ge", 47 | "le" 48 | ] 49 | } 50 | ], 51 | "notificationShape": [ 52 | { 53 | "resource": "Encounter", 54 | "include": [ 55 | "Encounter:patient&iterate=Patient.link", 56 | "Encounter:practitioner", 57 | "Encounter:service-provider", 58 | "Encounter:account", 59 | "Encounter:diagnosis", 60 | "Encounter:observation", 61 | "Encounter:location" 62 | ] 63 | } 64 | ] 65 | } -------------------------------------------------------------------------------- /fhirData/subscriptions/r5/subscriptiontopic-encounter-complete.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "SubscriptionTopic", 3 | "id": "encounter-complete", 4 | "url": "http://example.org/FHIR/SubscriptionTopic/encounter-complete", 5 | "version": "1.0.0-fhir.r5", 6 | "title": "encounter-complete", 7 | "status": "draft", 8 | "date": "2019-01-01", 9 | "description": "Example topic for completed encounters", 10 | "resourceTrigger": [ 11 | { 12 | "description": "An Encounter has been completed", 13 | "resource": "http://hl7.org/fhir/StructureDefinition/Encounter", 14 | "supportedInteraction": [ 15 | "create", 16 | "update" 17 | ], 18 | "queryCriteria": { 19 | "previous": "status:not=completed", 20 | "resultForCreate": "test-passes", 21 | "current": "status=completed", 22 | "resultForDelete": "test-fails", 23 | "requireBoth": true 24 | }, 25 | "fhirPathCriteria": "(%previous.id.empty() or (%previous.status != 'completed')) and (%current.status = 'completed')" 26 | } 27 | ], 28 | "canFilterBy": [ 29 | { 30 | "description": "Filter based on the subject of an encounter.", 31 | "resource": "Encounter", 32 | "filterParameter": "patient" 33 | }, 34 | { 35 | "description": "Filter based on the group membership of the subject of an encounter.", 36 | "resource": "Encounter", 37 | "filterParameter": "_in" 38 | }, 39 | { 40 | "description": "Filter based on the length of an encounter.", 41 | "resource": "Encounter", 42 | "filterParameter": "length", 43 | "comparator": [ 44 | "gt", 45 | "lt", 46 | "ge", 47 | "le" 48 | ] 49 | } 50 | ], 51 | "notificationShape": [ 52 | { 53 | "resource": "Encounter", 54 | "include": [ 55 | "Encounter:patient&iterate=Patient.link", 56 | "Encounter:practitioner", 57 | "Encounter:service-provider", 58 | "Encounter:account", 59 | "Encounter:diagnosis", 60 | "Encounter:observation", 61 | "Encounter:location" 62 | ] 63 | } 64 | ] 65 | } -------------------------------------------------------------------------------- /src/fhir-candle/wwwroot/highlight/languages/xml.min.js: -------------------------------------------------------------------------------- 1 | /*! `xml` grammar compiled for Highlight.js 11.8.0 */ 2 | (()=>{var e=(()=>{"use strict";return e=>{ 3 | const a=e.regex,n=a.concat(/[\p{L}_]/u,a.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s={ 4 | className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},t={begin:/\s/, 5 | contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}] 6 | },i=e.inherit(t,{begin:/\(/,end:/\)/}),c=e.inherit(e.APOS_STRING_MODE,{ 7 | className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),r={ 8 | endsWithParent:!0,illegal:/`]+/}]}]}]};return{ 12 | name:"HTML, XML", 13 | aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"], 14 | case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[t,l,c,i,{begin:/\[/,end:/\]/,contains:[{ 16 | className:"meta",begin://,contains:[t,i,l,c]}]}] 17 | },e.COMMENT(//,{relevance:10}),{begin://, 18 | relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/, 19 | relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag", 20 | begin:/)/,end:/>/,keywords:{name:"style"},contains:[r],starts:{ 21 | end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag", 22 | begin:/)/,end:/>/,keywords:{name:"script"},contains:[r],starts:{ 23 | end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{ 24 | className:"tag",begin:/<>|<\/>/},{className:"tag", 25 | begin:a.concat(//,/>/,/\s/)))), 26 | end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:r}]},{ 27 | className:"tag",begin:a.concat(/<\//,a.lookahead(a.concat(n,/>/))),contains:[{ 28 | className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}} 29 | })();hljs.registerLanguage("xml",e)})(); -------------------------------------------------------------------------------- /src/FhirStore.Common/Smart/SmartClientRegistration.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | using Microsoft.IdentityModel.Tokens; 7 | using System.Text.Json.Serialization; 8 | 9 | namespace FhirCandle.Smart; 10 | 11 | /// A smart client registration. 12 | public class SmartClientRegistration 13 | { 14 | /// Gets or sets the redirect uris. 15 | [JsonPropertyName("redirect_uris")] 16 | public IEnumerable? RedirectUris { get; set; } = Array.Empty(); 17 | 18 | /// Gets or sets the name of the client. 19 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 20 | [JsonPropertyName("client_name")] 21 | public string? ClientName { get; set; } = null; 22 | 23 | /// Gets or sets the token endpoint authentication method. 24 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 25 | [JsonPropertyName("token_endpoint_auth_method")] 26 | public string? TokenEndpointAuthMethod { get; set; } = null; 27 | 28 | /// Gets or sets URI of the logo. 29 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 30 | [JsonPropertyName("logo_uri")] 31 | public string? LogoUri { get; set; } = null; 32 | 33 | /// Gets or sets URI of the policy. 34 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 35 | [JsonPropertyName("policy_uri")] 36 | public string? PolicyUri { get; set; } = null; 37 | 38 | /// Gets or sets URI of the jwks. 39 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 40 | [JsonPropertyName("jwks_uri")] 41 | public string? JwksUri { get; set; } = null; 42 | 43 | /// Gets or sets the set the key belongs to. 44 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 45 | [JsonPropertyName("keys")] 46 | public JsonWebKeySet KeySet { get; set; } = new(); 47 | } 48 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4b/SubscriptionTopic-encounter-complete.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "SubscriptionTopic", 3 | "id": "encounter-complete", 4 | "meta": { 5 | "versionId": "1", 6 | "lastUpdated": "2023-08-30T14:59:14.4230092+00:00" 7 | }, 8 | "url": "http://example.org/FHIR/SubscriptionTopic/encounter-complete", 9 | "version": "1.0.0-fhir.r4b", 10 | "title": "encounter-complete", 11 | "status": "draft", 12 | "date": "2019-01-01", 13 | "description": "Example topic for completed encounters", 14 | "resourceTrigger": [ 15 | { 16 | "description": "An Encounter has been completed", 17 | "resource": "Encounter", 18 | "supportedInteraction": [ 19 | "create", 20 | "update" 21 | ], 22 | "queryCriteria": { 23 | "previous": "status:not=finished", 24 | "resultForCreate": "test-passes", 25 | "current": "status=finished", 26 | "resultForDelete": "test-fails", 27 | "requireBoth": true 28 | }, 29 | "fhirPathCriteria": "(%previous.empty() | (%previous.status != 'finished')) and (%current.status = 'finished')" 30 | } 31 | ], 32 | "canFilterBy": [ 33 | { 34 | "description": "Filter based on the subject of an encounter.", 35 | "resource": "Encounter", 36 | "filterParameter": "subject" 37 | }, 38 | { 39 | "description": "Filter based on the group membership of the subject of an encounter.", 40 | "resource": "Encounter", 41 | "filterParameter": "_in" 42 | }, 43 | { 44 | "description": "Filter based on the length of an encounter.", 45 | "resource": "Encounter", 46 | "filterParameter": "length", 47 | "modifier": [ 48 | "gt", 49 | "lt", 50 | "ge", 51 | "le" 52 | ] 53 | } 54 | ], 55 | "notificationShape": [ 56 | { 57 | "resource": "Encounter", 58 | "include": [ 59 | "Encounter:patient&iterate=Patient.link", 60 | "Encounter:practitioner", 61 | "Encounter:service-provider", 62 | "Encounter:account", 63 | "Encounter:diagnosis", 64 | "Encounter:observation", 65 | "Encounter:location" 66 | ] 67 | } 68 | ] 69 | } -------------------------------------------------------------------------------- /src/FhirStore.Common/Storage/Common.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | using System.Text.RegularExpressions; 7 | 8 | namespace FhirCandle.Storage; 9 | 10 | /// Common functionality for FHIR Stores. 11 | public static partial class Common 12 | { 13 | 14 | /// Values that represent store interactions. 15 | public enum StoreInteractionCodes 16 | { 17 | //CompartmentOperation, // compartment operations are not defined - either they are instance operations or type operations 18 | CompartmentSearch, 19 | CompartmentTypeSearch, 20 | 21 | InstanceDelete, 22 | InstanceDeleteHistory, 23 | InstanceDeleteVersion, 24 | InstanceOperation, 25 | InstancePatch, 26 | InstancePatchConditional, 27 | InstanceRead, 28 | InstanceReadHistory, 29 | InstanceReadVersion, 30 | InstanceUpdate, 31 | InstanceUpdateConditional, 32 | 33 | TypeCreate, 34 | TypeCreateConditional, 35 | TypeDeleteConditional, 36 | TypeDeleteConditionalSingle, 37 | TypeDeleteConditionalMultiple, 38 | TypeHistory, 39 | TypeOperation, 40 | TypeSearch, 41 | 42 | SystemCapabilities, 43 | SystemBundle, 44 | SystemDeleteConditional, 45 | SystemHistory, 46 | SystemOperation, 47 | SystemSearch, 48 | } 49 | 50 | /// Values that represent hook request states. 51 | public enum HookRequestStateCodes 52 | { 53 | /// Hooks executed before a request is processed. 54 | Pre, 55 | 56 | /// Hooks executed after a request is processed. 57 | Post, 58 | 59 | ///// Hooks executed after a request is sucessfully processed. 60 | //OnSuccess, 61 | 62 | ///// Hooks executed after a request has failed. 63 | //OnFail, 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4/Bundle-notification-id.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Bundle", 3 | "id": "dd9601ba-c32e-4518-8a01-ebc624f9acf8", 4 | "meta": { 5 | "versionId": "1", 6 | "lastUpdated": "2023-08-30T17:00:57.8299003+00:00" 7 | }, 8 | "type": "history", 9 | "timestamp": "2023-08-30T17:00:57.7724061+00:00", 10 | "entry": [ 11 | { 12 | "fullUrl": "urn:uuid:190e3522-c01f-4837-8e13-f61d978aa25f", 13 | "resource": { 14 | "resourceType": "Parameters", 15 | "id": "190e3522-c01f-4837-8e13-f61d978aa25f", 16 | "parameter": [ 17 | { 18 | "name": "subscription", 19 | "valueString": "https://subscriptions.argo.run/fhir/r4/Subscription/383c610b-8a8b-4173-b363-7b811509aadd" 20 | }, 21 | { 22 | "name": "topic", 23 | "valueCanonical": "http://example.org/FHIR/SubscriptionTopic/encounter-complete" 24 | }, 25 | { 26 | "name": "status", 27 | "valueCode": "active" 28 | }, 29 | { 30 | "name": "type", 31 | "valueCode": "event-notification" 32 | }, 33 | { 34 | "name": "events-since-subscription-start", 35 | "valueString": "1" 36 | }, 37 | { 38 | "name": "notification-event", 39 | "part": [ 40 | { 41 | "name": "event-number", 42 | "valueString": "1" 43 | }, 44 | { 45 | "name": "timestamp", 46 | "valueInstant": "2023-08-30T17:00:57.2076247+00:00" 47 | }, 48 | { 49 | "name": "focus", 50 | "valueReference": { 51 | "reference": "https://subscriptions.argo.run/fhir/r4/Encounter/36e1c9d9-6878-4ef0-b1ff-9f5986e2def6" 52 | } 53 | }, 54 | { 55 | "name": "additional-context", 56 | "valueReference": { 57 | "reference": "https://subscriptions.argo.run/fhir/r4/Patient/example" 58 | } 59 | } 60 | ] 61 | } 62 | ] 63 | } 64 | } 65 | ] 66 | } -------------------------------------------------------------------------------- /src/fhir-candle/_ForPackages/DiskPackageCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics.CodeAnalysis; 4 | using System.Text; 5 | using Firely.Fhir.Packages; 6 | using Newtonsoft.Json; 7 | 8 | namespace fhir.candle._ForPackages; 9 | 10 | public class DiskPackageCache : Firely.Fhir.Packages.DiskPackageCache 11 | { 12 | public DiskPackageCache(string? rootDirectory = null) 13 | : base(rootDirectory) 14 | { 15 | } 16 | 17 | private static readonly JsonSerializerSettings SETTINGS = new() 18 | { 19 | MissingMemberHandling = MissingMemberHandling.Ignore, 20 | //Converters = new List { new AuthorJsonConverter(), new ManifestDateJsonConverter() } 21 | }; 22 | 23 | public Task ReadManifestEx(Firely.Fhir.Packages.PackageReference reference) 24 | { 25 | string folder = PackageContentFolder(reference); 26 | 27 | if (!Directory.Exists(folder)) 28 | { 29 | return Task.FromResult(null); 30 | } 31 | 32 | string path = Path.Combine(folder, Firely.Fhir.Packages.PackageFileNames.MANIFEST); 33 | if (!File.Exists(path)) 34 | { 35 | return Task.FromResult(null); 36 | } 37 | 38 | string json = File.ReadAllText(path); 39 | PackageManifest? manifest = JsonConvert.DeserializeObject(json, SETTINGS); 40 | 41 | return Task.FromResult(manifest); 42 | } 43 | 44 | 45 | /// 46 | /// Deletes a package from the disk package cache. 47 | /// 48 | /// The package reference. 49 | #pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously 50 | public async Task Delete(PackageReference reference) 51 | #pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously 52 | { 53 | var target = PackageContentFolder(reference); 54 | if (!Directory.Exists(target)) 55 | { 56 | return; 57 | } 58 | 59 | // delete the directory recursively 60 | Directory.Delete(target, true); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/FhirStore.Common/Models/ClientInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | using FhirCandle.Smart; 7 | 8 | namespace FhirCandle.Models; 9 | 10 | /// Information about the client. 11 | public class ClientInfo 12 | { 13 | /// Information about the authentication activity. 14 | public readonly record struct ClientActivityRecord 15 | { 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | public ClientActivityRecord() { } 20 | 21 | /// Gets or initializes the type of the request. 22 | public required string RequestType { get; init; } 23 | 24 | /// Gets or initializes a value indicating whether the success. 25 | public required bool Success { get; init; } 26 | 27 | /// Gets or initializes the message. 28 | public string Message { get; init; } = string.Empty; 29 | 30 | /// Gets or initializes the timestamp. 31 | public DateTimeOffset Timestamp { get; init; } = DateTimeOffset.UtcNow; 32 | } 33 | 34 | /// Gets or sets the identifier of the client. 35 | public required string ClientId { get; set; } 36 | 37 | /// Gets or sets the name of the client. 38 | public required string ClientName { get; set; } 39 | 40 | /// Gets a list of names of the tenants. 41 | public HashSet TenantNames { get; } = new(); 42 | 43 | /// Gets or sets the registration. 44 | public SmartClientRegistration? Registration { get; set; } = null; 45 | 46 | /// Gets or sets the signing keys by algorithm. 47 | public Dictionary Keys { get; } = new(); 48 | 49 | /// Gets the activity. 50 | public List Activity { get; } = new(); 51 | } 52 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/SubscriptionTopic-encounter-complete.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "SubscriptionTopic", 3 | "id": "encounter-complete", 4 | "meta": { 5 | "versionId": "1", 6 | "lastUpdated": "2023-08-30T14:59:14.5130576+00:00" 7 | }, 8 | "url": "http://example.org/FHIR/SubscriptionTopic/encounter-complete", 9 | "version": "1.0.0-fhir.r5", 10 | "title": "encounter-complete", 11 | "status": "draft", 12 | "date": "2019-01-01", 13 | "description": "Example topic for completed encounters", 14 | "resourceTrigger": [ 15 | { 16 | "description": "An Encounter has been completed", 17 | "resource": "http://hl7.org/fhir/StructureDefinition/Encounter", 18 | "supportedInteraction": [ 19 | "create", 20 | "update" 21 | ], 22 | "queryCriteria": { 23 | "previous": "status:not=completed", 24 | "resultForCreate": "test-passes", 25 | "current": "status=completed", 26 | "resultForDelete": "test-fails", 27 | "requireBoth": true 28 | }, 29 | "fhirPathCriteria": "(%previous.empty() | (%previous.status != 'completed')) and (%current.status = 'completed')" 30 | } 31 | ], 32 | "canFilterBy": [ 33 | { 34 | "description": "Filter based on the subject of an encounter.", 35 | "resource": "Encounter", 36 | "filterParameter": "patient" 37 | }, 38 | { 39 | "description": "Filter based on the group membership of the subject of an encounter.", 40 | "resource": "Encounter", 41 | "filterParameter": "_in" 42 | }, 43 | { 44 | "description": "Filter based on the length of an encounter.", 45 | "resource": "Encounter", 46 | "filterParameter": "length", 47 | "comparator": [ 48 | "gt", 49 | "lt", 50 | "ge", 51 | "le" 52 | ] 53 | } 54 | ], 55 | "notificationShape": [ 56 | { 57 | "resource": "Encounter", 58 | "include": [ 59 | "Encounter:patient&iterate=Patient.link", 60 | "Encounter:practitioner", 61 | "Encounter:service-provider", 62 | "Encounter:account", 63 | "Encounter:diagnosis", 64 | "Encounter:observation", 65 | "Encounter:location" 66 | ] 67 | } 68 | ] 69 | } -------------------------------------------------------------------------------- /src/FhirStore.Common/Storage/IResourceStore.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | using FhirCandle.Models; 7 | 8 | namespace FhirCandle.Storage; 9 | 10 | /// Interface for resource store. 11 | /// Resource type parameter. 12 | public interface IResourceStore : IDisposable, IReadOnlyDictionary 13 | { 14 | /// Occurs when On Instance Created. 15 | event EventHandler? OnInstanceCreated; 16 | 17 | /// Occurs when On Instance Updated. 18 | event EventHandler? OnInstanceUpdated; 19 | 20 | /// Occurs when On Instance Deleted. 21 | event EventHandler? OnInstanceDeleted; 22 | 23 | /// Registers the instance created. 24 | /// Identifier for the resource. 25 | void RegisterInstanceCreated(string resourceId); 26 | 27 | /// Registers the instance updated. 28 | /// Identifier for the resource. 29 | void RegisterInstanceUpdated(string resourceId); 30 | 31 | /// Registers the instance deleted. 32 | /// Identifier for the resource. 33 | void RegisterInstanceDeleted(string resourceId); 34 | 35 | /// Gets a value indicating whether this resource store contains conformance resources. 36 | bool ResourcesAreConformance { get; } 37 | 38 | /// Gets a value indicating whether the resources have an identifier that is a List of identifiers. 39 | bool ResourcesAreIdentifiable { get; } 40 | 41 | /// Gets a value indicating whether the resources have name. 42 | bool ResourcesHaveName { get; } 43 | 44 | /// Gets the instance table view. 45 | /// The instance table view. 46 | IQueryable GetInstanceTableView(); 47 | } 48 | -------------------------------------------------------------------------------- /src/fhir-candle/_ForPackages/AuthorJsonConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using Newtonsoft.Json; 5 | 6 | namespace fhir.candle._ForPackages 7 | { 8 | /// 9 | /// Only does something custom for the author element, otherwise just do the regular serialization. 10 | /// 11 | internal class AuthorJsonConverter : JsonConverter 12 | { 13 | public override bool CanConvert(Type objectType) 14 | { 15 | return objectType == typeof(AuthorInfo) || objectType == typeof(string); 16 | } 17 | 18 | public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer) 19 | { 20 | 21 | if (reader.TokenType == JsonToken.StartObject) 22 | { 23 | 24 | if (objectType == typeof(AuthorInfo)) 25 | { 26 | // Use DummyDictionary to fool JsonSerializer into not using this converter recursively 27 | var author = serializer.Deserialize(reader); 28 | return author; 29 | } 30 | } 31 | else if (reader.TokenType == JsonToken.String && reader.Path == "author") 32 | { 33 | if (reader.Value?.ToString() is { } value) 34 | { 35 | var author = AuthorSerializer.Deserialize(value); 36 | return author; 37 | } 38 | } 39 | return serializer.Deserialize(reader); 40 | } 41 | 42 | public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer) 43 | { 44 | if (value is AuthorInfo author) 45 | { 46 | serializer.Serialize(writer, author.ParsedFromString ? AuthorSerializer.Serialize(author) : value); 47 | } 48 | else 49 | { 50 | serializer.Serialize(writer, value); 51 | } 52 | } 53 | 54 | /// 55 | /// Dummy to fool JsonSerializer into not using this converter recursively 56 | /// 57 | private class DummyDictionary : AuthorInfo { } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/fhir-candle/Components/RI/subscriptions/IndexContentR4B.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.FluentUI.AspNetCore.Components; 2 | 3 | @implements IIndexContent 4 | 5 | 6 | 7 | As a reference implementation for @ContentFor, this endpoint contains some immutable records for testing: 8 | 9 | 10 |
    11 |
  • 12 | 13 | Patient/example 14 | : 15 | An example patient, loaded from the FHIR examples. 16 |
  • 17 | 18 |
  • 19 | 20 | SubscriptionTopic/encounter-complete 21 | : 22 | An example SubscriptionTopic. 23 | The topic triggers when an encounter is either created with a status of finished 24 | or updated from any other status to finished. 25 |
  • 26 |
27 |
28 | 29 | @* 30 | If you are building or testing a topic-based subscription server implementation, there is a client available 31 | here. 32 | 33 |
34 | *@ 35 | @code { 36 | /// Gets or sets the navigation tracker. 37 | [CascadingParameter] 38 | public INavTracker? NavTracker { get; set; } = null; 39 | 40 | [Parameter] 41 | public string StoreName { get; set; } = string.Empty; 42 | 43 | /// Gets or sets the store. 44 | [Parameter] 45 | public IFhirStore Store { get; set; } = null!; 46 | 47 | /// Identifies the RI literal this content applies to. 48 | public static string ContentFor => "subscriptions"; 49 | 50 | /// Gets the FHIR version literal. 51 | public static string FhirVersionLiteral => "R4B"; 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/fhir-candle/Components/RI/subscriptions/IndexContentR5.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.FluentUI.AspNetCore.Components; 2 | 3 | @implements IIndexContent 4 | 5 | 6 | 7 | As a reference implementation for @ContentFor, this endpoint contains some immutable records for testing: 8 | 9 | 10 |
    11 |
  • 12 | 13 | Patient/example 14 | : 15 | An example patient, loaded from the FHIR examples. 16 |
  • 17 | 18 |
  • 19 | 20 | SubscriptionTopic/encounter-complete 21 | : 22 | An example SubscriptionTopic. 23 | The topic triggers when an encounter is either created with a status of complete 24 | or updated from any other status to complete. 25 |
  • 26 |
27 |
28 | 29 | @* 30 | If you are building or testing a topic-based subscription server implementation, there is a client available 31 | here. 32 | 33 |
34 | *@ 35 | @code { 36 | /// Gets or sets the navigation tracker. 37 | [CascadingParameter] 38 | public INavTracker? NavTracker { get; set; } = null; 39 | 40 | [Parameter] 41 | public string StoreName { get; set; } = string.Empty; 42 | 43 | /// Gets or sets the store. 44 | [Parameter] 45 | public IFhirStore Store { get; set; } = null!; 46 | 47 | /// Identifies the RI literal this content applies to. 48 | public static string ContentFor => "subscriptions"; 49 | 50 | /// Gets the FHIR version literal. 51 | public static string FhirVersionLiteral => "R5"; 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/subscriptiontopic-encounter-complete-query.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "SubscriptionTopic", 3 | "id": "encounter-complete-query", 4 | "url": "http://example.org/FHIR/R5/SubscriptionTopic/encounter-complete-query", 5 | "version": "1.0.0-beta.1", 6 | "title": "example", 7 | "status": "draft", 8 | "date": "2019-01-01", 9 | "description": "Example topic for completed encounters, using a query trigger", 10 | "resourceTrigger": [ 11 | { 12 | "description": "An Encounter has been completed", 13 | "resource": "http://hl7.org/fhir/StructureDefinition/Encounter", 14 | "supportedInteraction": [ 15 | "create", 16 | "update" 17 | ], 18 | "queryCriteria": { 19 | "previous": "status:not=completed", 20 | "resultForCreate": "test-passes", 21 | "current": "status=completed", 22 | "resultForDelete": "test-fails", 23 | "requireBoth": true 24 | } 25 | } 26 | ], 27 | "canFilterBy": [ 28 | { 29 | "description": "Filter based on the subject of an encounter.", 30 | "resource": "Encounter", 31 | "filterParameter": "subject" 32 | }, 33 | { 34 | "description": "Filter based on the group membership of the subject of an encounter.", 35 | "resource": "Encounter", 36 | "filterParameter": "_in" 37 | }, 38 | { 39 | "description": "Filter based on the length of an encounter.", 40 | "resource": "Encounter", 41 | "filterParameter": "length", 42 | "comparator": [ 43 | "gt", 44 | "lt", 45 | "ge", 46 | "le" 47 | ] 48 | }, 49 | { 50 | "description": "Filter based on the account for billing an encounter.", 51 | "resource": "Encounter", 52 | "filterParameter": "account", 53 | "modifier": [ 54 | "missing", 55 | "not", 56 | "identifier" 57 | ] 58 | } 59 | ], 60 | "notificationShape": [ 61 | { 62 | "resource": "Encounter", 63 | "include": [ 64 | "Encounter:patient&iterate=Patient.link", 65 | "Encounter:practitioner", 66 | "Encounter:service-provider", 67 | "Encounter:account", 68 | "Encounter:diagnosis", 69 | "Encounter:observation", 70 | "Encounter:location" 71 | ] 72 | } 73 | ] 74 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4/Observation-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Observation", 3 | "id": "example", 4 | "text": { 5 | "status": "generated", 6 | "div": "

Generated Narrative with Details

id: example

status: final

category: Vital Signs (Details : {http://terminology.hl7.org/CodeSystem/observation-category code 'vital-signs' = 'Vital Signs', given as 'Vital Signs'})

code: Body Weight (Details : {LOINC code '29463-7' = 'Body weight', given as 'Body Weight'}; {LOINC code '3141-9' = 'Body weight Measured', given as 'Body weight Measured'}; {SNOMED CT code '27113001' = 'Body weight', given as 'Body weight'}; {http://acme.org/devices/clinical-codes code 'body-weight' = 'body-weight', given as 'Body Weight'})

subject: Patient/example

encounter: Encounter/example

effective: 28/03/2016

value: 185 lbs (Details: UCUM code [lb_av] = 'lb_av')

" 7 | }, 8 | "status": "final", 9 | "category": [ 10 | { 11 | "coding": [ 12 | { 13 | "system": "http://terminology.hl7.org/CodeSystem/observation-category", 14 | "code": "vital-signs", 15 | "display": "Vital Signs" 16 | } 17 | ] 18 | } 19 | ], 20 | "code": { 21 | "coding": [ 22 | { 23 | "system": "http://loinc.org", 24 | "code": "29463-7", 25 | "display": "Body Weight" 26 | }, 27 | { 28 | "system": "http://loinc.org", 29 | "code": "3141-9", 30 | "display": "Body weight Measured" 31 | }, 32 | { 33 | "system": "http://snomed.info/sct", 34 | "code": "27113001", 35 | "display": "Body weight" 36 | }, 37 | { 38 | "system": "http://acme.org/devices/clinical-codes", 39 | "code": "body-weight", 40 | "display": "Body Weight" 41 | } 42 | ] 43 | }, 44 | "subject": { 45 | "reference": "Patient/example" 46 | }, 47 | "encounter": { 48 | "reference": "Encounter/example" 49 | }, 50 | "effectiveDateTime": "2016-03-28", 51 | "valueQuantity": { 52 | "value": 185, 53 | "unit": "lbs", 54 | "system": "http://unitsofmeasure.org", 55 | "code": "[lb_av]" 56 | } 57 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r4b/Observation-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Observation", 3 | "id": "example", 4 | "text": { 5 | "status": "generated", 6 | "div": "

Generated Narrative with Details

id: example

status: final

category: Vital Signs (Details : {http://terminology.hl7.org/CodeSystem/observation-category code 'vital-signs' = 'Vital Signs', given as 'Vital Signs'})

code: Body Weight (Details : {LOINC code '29463-7' = 'Body weight', given as 'Body Weight'}; {LOINC code '3141-9' = 'Body weight Measured', given as 'Body weight Measured'}; {SNOMED CT code '27113001' = 'Body weight', given as 'Body weight'}; {http://acme.org/devices/clinical-codes code 'body-weight' = 'body-weight', given as 'Body Weight'})

subject: Patient/example

encounter: Encounter/example

effective: 28/03/2016

value: 185 lbs (Details: UCUM code [lb_av] = 'lb_av')

" 7 | }, 8 | "status": "final", 9 | "category": [ 10 | { 11 | "coding": [ 12 | { 13 | "system": "http://terminology.hl7.org/CodeSystem/observation-category", 14 | "code": "vital-signs", 15 | "display": "Vital Signs" 16 | } 17 | ] 18 | } 19 | ], 20 | "code": { 21 | "coding": [ 22 | { 23 | "system": "http://loinc.org", 24 | "code": "29463-7", 25 | "display": "Body Weight" 26 | }, 27 | { 28 | "system": "http://loinc.org", 29 | "code": "3141-9", 30 | "display": "Body weight Measured" 31 | }, 32 | { 33 | "system": "http://snomed.info/sct", 34 | "code": "27113001", 35 | "display": "Body weight" 36 | }, 37 | { 38 | "system": "http://acme.org/devices/clinical-codes", 39 | "code": "body-weight", 40 | "display": "Body Weight" 41 | } 42 | ] 43 | }, 44 | "subject": { 45 | "reference": "Patient/example" 46 | }, 47 | "encounter": { 48 | "reference": "Encounter/example" 49 | }, 50 | "effectiveDateTime": "2016-03-28", 51 | "valueQuantity": { 52 | "value": 185, 53 | "unit": "lbs", 54 | "system": "http://unitsofmeasure.org", 55 | "code": "[lb_av]" 56 | } 57 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/Observation-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Observation", 3 | "id": "example", 4 | "text": { 5 | "status": "generated", 6 | "div": "

Generated Narrative with Details

id: example

status: final

category: Vital Signs (Details : {http://terminology.hl7.org/CodeSystem/observation-category code 'vital-signs' = 'Vital Signs', given as 'Vital Signs'})

code: Body Weight (Details : {LOINC code '29463-7' = 'Body weight', given as 'Body Weight'}; {LOINC code '3141-9' = 'Body weight Measured', given as 'Body weight Measured'}; {SNOMED CT code '27113001' = 'Body weight', given as 'Body weight'}; {http://acme.org/devices/clinical-codes code 'body-weight' = 'body-weight', given as 'Body Weight'})

subject: Patient/example

encounter: Encounter/example

effective: 28/03/2016

value: 185 lbs (Details: UCUM code [lb_av] = 'lb_av')

" 7 | }, 8 | "status": "final", 9 | "category": [ 10 | { 11 | "coding": [ 12 | { 13 | "system": "http://terminology.hl7.org/CodeSystem/observation-category", 14 | "code": "vital-signs", 15 | "display": "Vital Signs" 16 | } 17 | ] 18 | } 19 | ], 20 | "code": { 21 | "coding": [ 22 | { 23 | "system": "http://loinc.org", 24 | "code": "29463-7", 25 | "display": "Body Weight" 26 | }, 27 | { 28 | "system": "http://loinc.org", 29 | "code": "3141-9", 30 | "display": "Body weight Measured" 31 | }, 32 | { 33 | "system": "http://snomed.info/sct", 34 | "code": "27113001", 35 | "display": "Body weight" 36 | }, 37 | { 38 | "system": "http://acme.org/devices/clinical-codes", 39 | "code": "body-weight", 40 | "display": "Body Weight" 41 | } 42 | ] 43 | }, 44 | "subject": { 45 | "reference": "Patient/example" 46 | }, 47 | "encounter": { 48 | "reference": "Encounter/example" 49 | }, 50 | "effectiveDateTime": "2016-03-28", 51 | "valueQuantity": { 52 | "value": 185, 53 | "unit": "lbs", 54 | "system": "http://unitsofmeasure.org", 55 | "code": "[lb_av]" 56 | } 57 | } -------------------------------------------------------------------------------- /src/fhir-candle.Tests/data/r5/subscriptiontopic-encounter-complete-fhirpath.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "SubscriptionTopic", 3 | "id": "encounter-complete-fhirpath", 4 | "url": "http://example.org/FHIR/R5/SubscriptionTopic/encounter-complete-fhirpath", 5 | "identifier": [ 6 | { 7 | "system": "urn:ietf:rfc:3986", 8 | "value": "urn:uuid:1caa02ba-051b-4602-8856-65921748ae76" 9 | } 10 | ], 11 | "version": "1.0.0-beta.1", 12 | "title": "encounter-complete-fhirpath", 13 | "status": "draft", 14 | "date": "2019-01-01", 15 | "description": "Example topic for completed encounters, using FHIRPath", 16 | "resourceTrigger": [ 17 | { 18 | "description": "An Encounter has been completed", 19 | "resource": "http://hl7.org/fhir/StructureDefinition/Encounter", 20 | "supportedInteraction": [ 21 | "create", 22 | "update" 23 | ], 24 | "fhirPathCriteria": "(%previous.empty() | (%previous.status != 'completed')) and (%current.status = 'completed')" 25 | } 26 | ], 27 | "canFilterBy": [ 28 | { 29 | "description": "Filter based on the subject of an encounter.", 30 | "resource": "Encounter", 31 | "filterParameter": "subject" 32 | }, 33 | { 34 | "description": "Filter based on the group membership of the subject of an encounter.", 35 | "resource": "Encounter", 36 | "filterParameter": "_in" 37 | }, 38 | { 39 | "description": "Filter based on the length of an encounter.", 40 | "resource": "Encounter", 41 | "filterParameter": "length", 42 | "comparator": [ 43 | "gt", 44 | "lt", 45 | "ge", 46 | "le" 47 | ] 48 | }, 49 | { 50 | "description": "Filter based on the account for billing an encounter.", 51 | "resource": "Encounter", 52 | "filterParameter": "account", 53 | "modifier": [ 54 | "missing", 55 | "not", 56 | "identifier" 57 | ] 58 | } 59 | ], 60 | "notificationShape": [ 61 | { 62 | "resource": "Encounter", 63 | "include": [ 64 | "Encounter:patient&iterate=Patient.link", 65 | "Encounter:practitioner", 66 | "Encounter:service-provider", 67 | "Encounter:account", 68 | "Encounter:diagnosis", 69 | "Encounter:observation", 70 | "Encounter:location" 71 | ] 72 | } 73 | ] 74 | } -------------------------------------------------------------------------------- /src/fhir-candle/Ucum/UCUM.g4: -------------------------------------------------------------------------------- 1 | grammar UCUM; 2 | 3 | // Pulled from LinuxForHealth/FHIR - https://github.com/LinuxForHealth/FHIR 4 | // Derived from the UCUM syntax described at: http://unitsofmeasure.org/ucum.html#section-Grammar-of-Units-and-Unit-Terms 5 | 6 | mainTerm 7 | : term EOF 8 | ; 9 | 10 | term 11 | : component 12 | | '/' term 13 | | component '/' term 14 | | component '.' term 15 | ; 16 | 17 | component 18 | : '(' term ')' 19 | | '(' term ')' annotationSymbols 20 | | annotatable annotationSymbols 21 | | annotationSymbols 22 | | annotatable 23 | | digitSymbols 24 | ; 25 | 26 | annotatable 27 | : simpleUnit 28 | | simpleUnit exponent 29 | ; 30 | 31 | simpleUnit 32 | : simpleUnitSymbols 33 | | squareBracketsSymbols 34 | | squareBracketsSymbols simpleUnitSymbols 35 | | simpleUnitSymbols squareBracketsSymbols 36 | | simpleUnitSymbols squareBracketsSymbols simpleUnitSymbols 37 | ; 38 | 39 | simpleUnitSymbols 40 | : (terminalUnitSymbol)+ 41 | ; 42 | 43 | annotationSymbols 44 | : '{' (withinCbSymbol)+ '}' 45 | ; 46 | 47 | squareBracketsSymbols 48 | : '[' (withinSbSymbol)+ ']' 49 | ; 50 | 51 | withinSbSymbol 52 | : withinCbOrSbSymbol 53 | | '{' 54 | | '}' 55 | ; 56 | 57 | withinCbSymbol 58 | : withinCbOrSbSymbol 59 | | ' ' 60 | | '[' 61 | | ']' 62 | ; 63 | 64 | withinCbOrSbSymbol 65 | : terminalUnitSymbol 66 | | '"' 67 | | '(' 68 | | ')' 69 | | '+' 70 | | '-' 71 | | '.' 72 | | '/' 73 | | '=' 74 | ; 75 | 76 | terminalUnitSymbol 77 | : NON_DIGIT_TERMINAL_UNIT_SYMBOL 78 | | DIGIT_SYMBOL 79 | ; 80 | 81 | exponent 82 | : ('+' | '-') digitSymbols 83 | | digitSymbols 84 | ; 85 | 86 | digitSymbols 87 | : (DIGIT_SYMBOL)+ 88 | ; 89 | 90 | NON_DIGIT_TERMINAL_UNIT_SYMBOL 91 | : '!' 92 | | '#' 93 | | '$' 94 | | '%' 95 | | '&' 96 | | '\'' 97 | | '*' 98 | | ',' 99 | | ':' 100 | | ';' 101 | | '<' 102 | | '>' 103 | | '?' 104 | | '@' 105 | | 'A' .. 'Z' 106 | | '\\' 107 | | '^' 108 | | '_' 109 | | '`' 110 | | 'a' .. 'z' 111 | | '|' 112 | | '~' 113 | ; 114 | 115 | DIGIT_SYMBOL 116 | : '0' .. '9' 117 | ; 118 | -------------------------------------------------------------------------------- /src/FhirStore.CommonVersioned/CSharpExtensions/SearchParamDefinitionExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. 4 | // 5 | 6 | using Hl7.Fhir.Model; 7 | 8 | namespace FhirCandle.Extensions; 9 | 10 | /// A search parameter definition extensions. 11 | public static class SearchParamDefinitionExtensions 12 | { 13 | /// 14 | /// A ModelInfo.SearchParamDefinition extension method that makes a deep copy of this object. 15 | /// 16 | /// The sp. 17 | /// A copy of this object. 18 | public static ModelInfo.SearchParamDefinition Clone(this ModelInfo.SearchParamDefinition sp) 19 | { 20 | return new() 21 | { 22 | Resource = sp.Resource, 23 | Name = sp.Name, 24 | Url = sp.Url, 25 | Description = sp.Description, 26 | Type = sp.Type, 27 | Component = sp.Component?.Select(v => v).ToArray() ?? null, 28 | Path = sp.Path?.Select(v => v).ToArray() ?? null, 29 | XPath = sp.XPath, 30 | Expression = sp.Expression, 31 | Target = sp.Target?.Select(v => v).ToArray() ?? null, 32 | }; 33 | } 34 | 35 | /// A ModelInfo.SearchParamDefinition extension method that clone with. 36 | /// The sp. 37 | /// (Optional) Target for the. 38 | /// A ModelInfo.SearchParamDefinition. 39 | public static ModelInfo.SearchParamDefinition CloneWith( 40 | this ModelInfo.SearchParamDefinition sp, 41 | ResourceType[]? target = null) 42 | { 43 | return new() 44 | { 45 | Resource = sp.Resource, 46 | Name = sp.Name, 47 | Url = sp.Url, 48 | Description = sp.Description, 49 | Type = sp.Type, 50 | Component = sp.Component?.Select(v => v).ToArray() ?? null, 51 | Path = sp.Path?.Select(v => v).ToArray() ?? null, 52 | XPath = sp.XPath, 53 | Expression = sp.Expression, 54 | Target = target, 55 | }; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/fhir-candle/Components/RI/subscriptions/IndexContentR4.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.FluentUI.AspNetCore.Components; 2 | 3 | @implements IIndexContent 4 | 5 | 6 | 7 | As a reference implementation for @ContentFor, this endpoint contains some immutable records for testing: 8 | 9 | 10 |
    11 |
  • 12 | 13 | Patient/example 14 | : 15 | An example patient, loaded from the FHIR examples. 16 |
  • 17 | 18 |
  • 19 | 20 | Basic/encounter-complete 21 | : 22 | An example topic as a Basic resource, using cross-version extensions (equivalent 23 | to the R4B and R5 encounter-complete topics). 24 | The topic triggers when an encounter is either created with a status of finished 25 | or updated from any other status to finished. 26 |
  • 27 |
28 |
29 | 30 | @* 31 | If you are building or testing a topic-based subscription server implementation, there is a client available 32 | here. 33 | 34 |
35 | *@ 36 | @code { 37 | /// Gets or sets the navigation tracker. 38 | [CascadingParameter] 39 | public INavTracker? NavTracker { get; set; } = null; 40 | 41 | [Parameter] 42 | public string StoreName { get; set; } = string.Empty; 43 | 44 | /// Gets or sets the store. 45 | [Parameter] 46 | public IFhirStore Store { get; set; } = null!; 47 | 48 | /// Identifies the RI literal this content applies to. 49 | public static string ContentFor => "subscriptions"; 50 | 51 | /// Gets the FHIR version literal. 52 | public static string FhirVersionLiteral => "R4"; 53 | 54 | } 55 | --------------------------------------------------------------------------------