From 9e6107877913ae4cd1f1adb42f00b68677dffd68 Mon Sep 17 00:00:00 2001 From: David Carlson Date: Thu, 25 Apr 2024 13:21:24 -0600 Subject: [PATCH 1/7] Display Goal lifecycleStatus and achievementStatus. In Goal list, combine Source and From into Source, using from endpoint only when Provenance is missing. Include Goal.addresses Observation. --- src/components/summaries/GoalList.tsx | 58 +- src/data-services/cql/mcc/MCCGoals.cql | 20 +- src/data-services/cql/mcc/MCCGoals.json | 15281 +++++++++++++--------- src/data-services/fhirService.ts | 10 +- src/data-services/mccCqlService.ts | 1 + src/data-services/models/cqlSummary.ts | 2 + 6 files changed, 8894 insertions(+), 6478 deletions(-) diff --git a/src/components/summaries/GoalList.tsx b/src/components/summaries/GoalList.tsx index f93869d..06397fe 100644 --- a/src/components/summaries/GoalList.tsx +++ b/src/components/summaries/GoalList.tsx @@ -87,12 +87,19 @@ const buildRows = (goal: GoalSummary, theSource?:string): SummaryRowItems => { if (targets?.length) { rows = rows.concat(targets) } + const status: SummaryRowItem = { + isHeader: false, + twoColumns: false, + data1: 'Status: ' + (goal.LifecycleStatus ?? 'Unknown') + (goal.AchievementStatus === null ? '' : ' -- ' + goal.AchievementStatus), + data2:'', + } + rows = rows.concat(status) - const addresses: SummaryRowItems | undefined = goal.Addresses?.map((concern) => ( + const addresses: SummaryRowItems | undefined = goal.Addresses?.map((focus) => ( { isHeader: false, twoColumns: false, - data1: 'Addresses: ' + (concern.DisplayName ?? 'Unknown'), + data1: 'Focus: ' + (focus.DisplayName ?? 'Unknown'), data2: '', } )) @@ -100,18 +107,20 @@ const buildRows = (goal: GoalSummary, theSource?:string): SummaryRowItems => { rows = rows.concat(addresses) } - const learnMore: SummaryRowItem = { - isHeader: false, - twoColumns: false, - data1: goal.LearnMore === undefined || goal.LearnMore === null ? '' : - { event.preventDefault(); window.open(goal.LearnMore); } - }>Learn More - , - data2: '', + if (goal.LearnMore !== undefined && goal.LearnMore !== null) { + const learnMore: SummaryRowItem = { + isHeader: false, + twoColumns: false, + data1: + { event.preventDefault(); window.open(goal.LearnMore); } + }>Learn More + , + data2: '', + } + rows.push(learnMore) } - rows.push(learnMore) const notes: SummaryRowItems | undefined = goal.Notes?.map((note) => ( { @@ -125,20 +134,10 @@ const buildRows = (goal: GoalSummary, theSource?:string): SummaryRowItems => { rows = rows.concat(notes) } - if (theSource) { - const source: SummaryRowItem = { - isHeader: false, - twoColumns: false, - data1: 'From ' + theSource, - data2: '', - } - rows.push(source) - } - const provenance: SummaryRowItems | undefined = goal.Provenance?.map((provenance) => ( { isHeader: false, - twoColumns: true, + twoColumns: false, data1: 'Source: ' + provenance.Transmitter ?? '', data2: provenance.Author ?? '', } @@ -147,6 +146,17 @@ const buildRows = (goal: GoalSummary, theSource?:string): SummaryRowItems => { rows = rows.concat(provenance) } + const hasProvenance = goal.Provenance?.length ?? 0 > 0 + if (theSource && !hasProvenance) { + const source: SummaryRowItem = { + isHeader: false, + twoColumns: false, + data1: 'Source ' + theSource, + data2: '', + } + rows.push(source) + } + return rows } diff --git a/src/data-services/cql/mcc/MCCGoals.cql b/src/data-services/cql/mcc/MCCGoals.cql index b3e4816..45aa140 100644 --- a/src/data-services/cql/mcc/MCCGoals.cql +++ b/src/data-services/cql/mcc/MCCGoals.cql @@ -15,6 +15,8 @@ export interface GoalSummary { ExpressedBy?: string, StartDate?: string, Target?: GoalTarget[], + LifecycleStatus?: string, + AchievementStatus?: string, Notes?: string[], Addresses?: ConditionSummary[], LearnMore?: string @@ -35,7 +37,7 @@ define GoalSummary: define "Active Goals": [Goal] G - where G.lifecycleStatus in {'active', 'accepted', 'planned', 'on-hold'} + where G.lifecycleStatus in {'active', 'completed', 'cancelled', 'on-hold'} define function ReportGoals(goals List): goals G @@ -49,6 +51,8 @@ define function ReportGoal(goal Goal): StartDate: ToString(goal.start), Target: if goal.target is not null then ReportGoalTargets(goal) else null, Addresses: if goal.addresses is not null then DE.DataElements(AddressesResources(goal)) else null, + LifecycleStatus: LifecycleStatusText(goal), + AchievementStatus: DE.ConceptText(goal.achievementStatus), Notes: DE.ToString(goal.note), Provenance: DE.ReportProvenance(goal), LearnMore: DE.LearnMoreURL(goal.target[0].measure), @@ -142,3 +146,17 @@ define function DueDate(goal Goal): where due is not null return due ) + +define function LifecycleStatusText(g Goal): + case + when g.lifecycleStatus.value = 'active' then + 'Active' + when g.lifecycleStatus.value = 'completed' then + 'Completed' + when g.lifecycleStatus.value = 'cancelled' then + 'Cancelled' + when g.lifecycleStatus.value = 'on-hold' then + 'On Hold' + else + 'Unknown' + end diff --git a/src/data-services/cql/mcc/MCCGoals.json b/src/data-services/cql/mcc/MCCGoals.json index de16dd0..1e8e187 100644 --- a/src/data-services/cql/mcc/MCCGoals.json +++ b/src/data-services/cql/mcc/MCCGoals.json @@ -1,12 +1,125 @@ { "library" : { + "localId" : "0", "annotation" : [ { + "translatorVersion" : "3.10.0-SNAPSHOT", "translatorOptions" : "EnableAnnotations,EnableLocators,EnableResultTypes", + "signatureLevel" : "None", "type" : "CqlToElmInfo" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "An operand identifier [goal] is hiding another identifier of the same name.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "An operand identifier [goal] is hiding another identifier of the same name.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "An operand identifier [goal] is hiding another identifier of the same name.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "An operand identifier [condition] is hiding another identifier of the same name.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "An operand identifier [condition] is hiding another identifier of the same name.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" + }, { + "message" : "The function FHIRHelpers.ToString has multiple overloads and due to the SignatureLevel setting (None), the overload signature is not being included in the output. This may result in ambiguous function resolution at runtime, consider setting the SignatureLevel to Overloads or All to ensure that the output includes sufficient information to support correct overload selection at runtime.", + "errorType" : "semantic", + "errorSeverity" : "warning", + "type" : "CqlToElmError" }, { "type" : "Annotation", "s" : { - "r" : "362", + "r" : "1373", "s" : [ { "value" : [ "","library MCCGoals version '0.1.0'" ] } ] @@ -22,10 +135,11 @@ }, "usings" : { "def" : [ { + "localId" : "1", "localIdentifier" : "System", "uri" : "urn:hl7-org:elm-types:r1" }, { - "localId" : "1", + "localId" : "206", "locator" : "3:1-3:26", "localIdentifier" : "FHIR", "uri" : "http://hl7.org/fhir", @@ -33,7 +147,7 @@ "annotation" : [ { "type" : "Annotation", "s" : { - "r" : "1", + "r" : "206", "s" : [ { "value" : [ "","using " ] }, { @@ -41,7 +155,7 @@ "value" : [ "FHIR" ] } ] }, { - "value" : [ " version ","'4.0.1'" ] + "value" : [ " version '4.0.1'" ] } ] } } ] @@ -49,7 +163,7 @@ }, "includes" : { "def" : [ { - "localId" : "2", + "localId" : "207", "locator" : "5:1-5:35", "localIdentifier" : "FHIRHelpers", "path" : "FHIRHelpers", @@ -57,7 +171,7 @@ "annotation" : [ { "type" : "Annotation", "s" : { - "r" : "2", + "r" : "207", "s" : [ { "value" : [ "","include " ] }, { @@ -70,14 +184,14 @@ } } ] }, { - "localId" : "3", + "localId" : "208", "locator" : "6:1-6:36", "localIdentifier" : "DE", "path" : "DataElementHelpers", "annotation" : [ { "type" : "Annotation", "s" : { - "r" : "3", + "r" : "208", "s" : [ { "value" : [ "","include " ] }, { @@ -90,14 +204,14 @@ } } ] }, { - "localId" : "4", + "localId" : "209", "locator" : "7:1-7:29", "localIdentifier" : "Cx", "path" : "MCCConcepts", "annotation" : [ { "type" : "Annotation", "s" : { - "r" : "4", + "r" : "209", "s" : [ { "value" : [ "","include " ] }, { @@ -113,45 +227,54 @@ }, "contexts" : { "def" : [ { + "localId" : "213", "locator" : "9:1-9:15", "name" : "Patient" } ] }, "statements" : { "def" : [ { + "localId" : "211", "locator" : "9:1-9:15", "name" : "Patient", "context" : "Patient", "expression" : { + "localId" : "212", "type" : "SingletonFrom", + "signature" : [ ], "operand" : { + "localId" : "210", "locator" : "9:1-9:15", "dataType" : "{http://hl7.org/fhir}Patient", "templateId" : "http://hl7.org/fhir/StructureDefinition/Patient", - "type" : "Retrieve" + "type" : "Retrieve", + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } } }, { - "localId" : "16", - "locator" : "36:1-38:75", + "localId" : "218", + "locator" : "38:1-40:78", "name" : "Active Goals", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "s" : { - "r" : "16", + "r" : "218", "s" : [ { "value" : [ "","define ","\"Active Goals\"",":\n " ] }, { - "r" : "15", + "r" : "238", "s" : [ { "s" : [ { - "r" : "6", + "r" : "219", "s" : [ { - "r" : "5", + "r" : "220", "s" : [ { - "r" : "5", + "r" : "220", "s" : [ { "value" : [ "[","Goal","]" ] } ] @@ -163,22 +286,22 @@ }, { "value" : [ " \n " ] }, { - "r" : "14", + "r" : "236", "s" : [ { "value" : [ "where " ] }, { - "r" : "14", + "r" : "236", "s" : [ { - "r" : "8", + "r" : "228", "s" : [ { - "r" : "7", + "r" : "227", "s" : [ { "value" : [ "G" ] } ] }, { "value" : [ "." ] }, { - "r" : "8", + "r" : "228", "s" : [ { "value" : [ "lifecycleStatus" ] } ] @@ -186,32 +309,32 @@ }, { "value" : [ " in " ] }, { - "r" : "13", + "r" : "229", "s" : [ { "value" : [ "{" ] }, { - "r" : "9", + "r" : "230", "s" : [ { "value" : [ "'active'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "10", + "r" : "231", "s" : [ { - "value" : [ "'accepted'" ] + "value" : [ "'completed'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "11", + "r" : "232", "s" : [ { - "value" : [ "'planned'" ] + "value" : [ "'cancelled'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "12", + "r" : "233", "s" : [ { "value" : [ "'on-hold'" ] } ] @@ -225,102 +348,120 @@ } } ], "resultTypeSpecifier" : { + "localId" : "2097", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2098", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "15", - "locator" : "37:3-38:75", + "localId" : "238", + "locator" : "39:3-40:78", "type" : "Query", "resultTypeSpecifier" : { + "localId" : "239", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "240", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } }, "source" : [ { - "localId" : "6", - "locator" : "37:3-37:10", + "localId" : "219", + "locator" : "39:3-39:10", "alias" : "G", "resultTypeSpecifier" : { + "localId" : "225", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "226", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "5", - "locator" : "37:3-37:8", + "localId" : "220", + "locator" : "39:3-39:8", "dataType" : "{http://hl7.org/fhir}Goal", "templateId" : "http://hl7.org/fhir/StructureDefinition/Goal", "type" : "Retrieve", "resultTypeSpecifier" : { + "localId" : "223", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "224", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } - } + }, + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } } ], + "let" : [ ], "relationship" : [ ], "where" : { - "localId" : "14", - "locator" : "38:5-38:75", + "localId" : "236", + "locator" : "40:5-40:78", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "In", + "signature" : [ ], "operand" : [ { + "localId" : "237", "name" : "ToString", "libraryName" : "FHIRHelpers", "type" : "FunctionRef", + "signature" : [ ], "operand" : [ { - "localId" : "8", - "locator" : "38:11-38:27", + "localId" : "228", + "locator" : "40:11-40:27", "resultTypeName" : "{http://hl7.org/fhir}GoalLifecycleStatus", "path" : "lifecycleStatus", "scope" : "G", "type" : "Property" } ] }, { - "localId" : "13", - "locator" : "38:32-38:75", + "localId" : "229", + "locator" : "40:32-40:78", "type" : "List", "resultTypeSpecifier" : { + "localId" : "234", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "235", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, "element" : [ { - "localId" : "9", - "locator" : "38:33-38:40", + "localId" : "230", + "locator" : "40:33-40:40", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", "value" : "active", "type" : "Literal" }, { - "localId" : "10", - "locator" : "38:43-38:52", + "localId" : "231", + "locator" : "40:43-40:53", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", - "value" : "accepted", + "value" : "completed", "type" : "Literal" }, { - "localId" : "11", - "locator" : "38:55-38:63", + "localId" : "232", + "locator" : "40:56-40:66", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", - "value" : "planned", + "value" : "cancelled", "type" : "Literal" }, { - "localId" : "12", - "locator" : "38:66-38:74", + "localId" : "233", + "locator" : "40:69-40:77", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", "value" : "on-hold", @@ -330,5986 +471,7140 @@ } } }, { - "localId" : "87", - "locator" : "138:1-144:3", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", - "name" : "DueDate", + "localId" : "263", + "locator" : "42:1-44:24", + "name" : "ReportGoals", "context" : "Patient", "accessLevel" : "Public", "type" : "FunctionDef", "annotation" : [ { "type" : "Annotation", "s" : { - "r" : "87", + "r" : "263", "s" : [ { - "value" : [ "// Returns Date from the first Goal target that has a due date.\n","define function ","DueDate","(","goal"," " ] - }, { - "r" : "72", - "s" : [ { - "value" : [ "Goal" ] - } ] + "value" : [ "","define function ReportGoals(goals List):\n " ] }, { - "value" : [ "):\n " ] - }, { - "r" : "86", + "r" : "2267", "s" : [ { - "r" : "86", + "r" : "2267", "s" : [ { - "value" : [ "First","(" ] - }, { - "r" : "85", "s" : [ { + "r" : "2099", "s" : [ { - "r" : "74", + "r" : "2100", "s" : [ { - "r" : "73", "s" : [ { - "s" : [ { - "value" : [ "goal",".","target" ] - } ] + "value" : [ "goals" ] } ] - }, { - "value" : [ " ","target" ] } ] - } ] - }, { - "value" : [ "\n // TODO if due is Duration, add that quantity to startDate\n " ] - }, { - "s" : [ { - "value" : [ "let " ] }, { - "r" : "80", - "s" : [ { - "value" : [ "due",": " ] - }, { - "r" : "79", - "s" : [ { - "r" : "78", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "78", - "s" : [ { - "r" : "76", - "s" : [ { - "r" : "75", - "s" : [ { - "value" : [ "target" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "76", - "s" : [ { - "value" : [ "due" ] - } ] - } ] - }, { - "value" : [ " as " ] - }, { - "r" : "77", - "s" : [ { - "value" : [ "FHIR",".","date" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "79", - "s" : [ { - "value" : [ "value" ] - } ] - } ] - } ] + "value" : [ " ","G" ] } ] + } ] + }, { + "value" : [ "\n " ] + }, { + "r" : "2105", + "s" : [ { + "value" : [ "return " ] }, { - "value" : [ "\n " ] - }, { - "r" : "82", + "r" : "2107", "s" : [ { - "value" : [ "where " ] + "value" : [ "ReportGoal","(" ] }, { - "r" : "82", + "r" : "2106", "s" : [ { - "r" : "81", - "s" : [ { - "value" : [ "due" ] - } ] - }, { - "value" : [ " is not null" ] + "value" : [ "G" ] } ] - } ] - }, { - "value" : [ "\n " ] - }, { - "r" : "84", - "s" : [ { - "value" : [ "return " ] }, { - "r" : "83", - "s" : [ { - "value" : [ "due" ] - } ] + "value" : [ ")" ] } ] } ] - }, { - "value" : [ "\n )" ] } ] } ] } ] } } ], - "expression" : { - "localId" : "86", - "locator" : "139:3-144:3", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", - "type" : "First", - "source" : { - "localId" : "85", - "locator" : "139:9-143:16", - "type" : "Query", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", + "resultTypeSpecifier" : { + "localId" : "2428", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2429", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2430", + "name" : "Category", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Date", + "localId" : "2431", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, - "source" : [ { - "localId" : "74", - "locator" : "139:9-139:26", - "alias" : "target", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", - "type" : "NamedTypeSpecifier" - } - }, - "expression" : { - "localId" : "73", - "locator" : "139:9-139:19", - "path" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", - "type" : "NamedTypeSpecifier" - } - }, - "source" : { - "name" : "goal", - "type" : "OperandRef" - } + }, { + "localId" : "2432", + "name" : "Description", + "elementType" : { + "localId" : "2433", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } - } ], - "let" : [ { - "localId" : "80", - "locator" : "141:9-141:44", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", - "identifier" : "due", - "expression" : { - "localId" : "79", - "locator" : "141:14-141:44", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", - "path" : "value", - "type" : "Property", - "source" : { - "localId" : "78", - "locator" : "141:14-141:38", - "resultTypeName" : "{http://hl7.org/fhir}date", - "strict" : false, - "type" : "As", - "operand" : { - "localId" : "76", - "locator" : "141:15-141:24", - "path" : "due", - "scope" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ChoiceTypeSpecifier", - "choice" : [ { - "name" : "{http://hl7.org/fhir}date", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}Duration", - "type" : "NamedTypeSpecifier" - } ] - } - }, - "asTypeSpecifier" : { - "localId" : "77", - "locator" : "141:29-141:37", - "resultTypeName" : "{http://hl7.org/fhir}date", - "name" : "{http://hl7.org/fhir}date", - "type" : "NamedTypeSpecifier" - } - } + }, { + "localId" : "2434", + "name" : "ExpressedBy", + "elementType" : { + "localId" : "2435", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } - } ], - "relationship" : [ ], - "where" : { - "localId" : "82", - "locator" : "142:5-142:25", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "Not", - "operand" : { - "locator" : "142:11-142:25", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "IsNull", - "operand" : { - "localId" : "81", - "locator" : "142:11-142:13", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", - "name" : "due", - "type" : "QueryLetRef" - } + }, { + "localId" : "2436", + "name" : "StartDate", + "elementType" : { + "localId" : "2437", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } - }, - "return" : { - "localId" : "84", - "locator" : "143:7-143:16", - "resultTypeSpecifier" : { + }, { + "localId" : "2438", + "name" : "Target", + "elementType" : { + "localId" : "2439", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Date", - "type" : "NamedTypeSpecifier" - } - }, - "expression" : { - "localId" : "83", - "locator" : "143:14-143:16", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", - "name" : "due", - "type" : "QueryLetRef" - } - } - } - }, - "operand" : [ { - "name" : "goal", - "operandTypeSpecifier" : { - "localId" : "72", - "locator" : "138:30-138:33", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "{http://hl7.org/fhir}Goal", - "type" : "NamedTypeSpecifier" - } - } ] - }, { - "localId" : "184", - "locator" : "58:1-78:5", - "name" : "ReportGoalTargets", - "context" : "Patient", - "accessLevel" : "Public", - "type" : "FunctionDef", - "annotation" : [ { - "type" : "Annotation", - "s" : { - "r" : "184", - "s" : [ { - "value" : [ "","define function ","ReportGoalTargets","(","goal"," " ] - }, { - "r" : "53", - "s" : [ { - "value" : [ "Goal" ] - } ] - }, { - "value" : [ "):\n " ] - }, { - "r" : "183", - "s" : [ { - "r" : "183", - "s" : [ { - "value" : [ "if " ] - }, { - "r" : "70", - "s" : [ { - "r" : "61", - "s" : [ { - "r" : "58", - "s" : [ { - "r" : "57", - "s" : [ { - "r" : "55", - "s" : [ { - "r" : "54", - "s" : [ { - "value" : [ "goal" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "55", - "s" : [ { - "value" : [ "target" ] - } ] - } ] - }, { - "r" : "56", - "value" : [ "[","0","]" ] - } ] + "localId" : "2440", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2441", + "name" : "DueDate", + "elementType" : { + "localId" : "2442", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2443", + "name" : "DisplayName", + "elementType" : { + "localId" : "2444", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2445", + "name" : "TargetValue", + "elementType" : { + "localId" : "2446", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2447", + "name" : "LastResult", + "elementType" : { + "localId" : "2448", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2449", + "name" : "DisplayName", + "elementType" : { + "localId" : "2450", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "value" : [ "." ] + "localId" : "2451", + "name" : "ConceptName", + "elementType" : { + "localId" : "2452", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "58", - "s" : [ { - "value" : [ "measure" ] - } ] - } ] - }, { - "value" : [ " ","~"," " ] - }, { - "r" : "60", - "s" : [ { - "r" : "59", - "s" : [ { - "value" : [ "Cx" ] - } ] + "localId" : "2453", + "name" : "Date", + "elementType" : { + "localId" : "2454", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "value" : [ "." ] + "localId" : "2455", + "name" : "ResultText", + "elementType" : { + "localId" : "2456", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "60", - "s" : [ { - "value" : [ "\"Systolic blood pressure\"" ] - } ] - } ] - } ] - }, { - "value" : [ " or " ] - }, { - "r" : "69", - "s" : [ { - "r" : "66", - "s" : [ { - "r" : "65", - "s" : [ { - "r" : "63", - "s" : [ { - "r" : "62", - "s" : [ { - "value" : [ "goal" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "63", - "s" : [ { - "value" : [ "target" ] - } ] - } ] - }, { - "r" : "64", - "value" : [ "[","0","]" ] - } ] + "localId" : "2457", + "name" : "ResultValue", + "elementType" : { + "localId" : "2458", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } }, { - "value" : [ "." ] + "localId" : "2459", + "name" : "ResultUnits", + "elementType" : { + "localId" : "2460", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "66", - "s" : [ { - "value" : [ "measure" ] - } ] - } ] - }, { - "value" : [ " ","~"," " ] - }, { - "r" : "68", - "s" : [ { - "r" : "67", - "s" : [ { - "value" : [ "Cx" ] - } ] + "localId" : "2461", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "2462", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "value" : [ "." ] + "localId" : "2463", + "name" : "Interpretation", + "elementType" : { + "localId" : "2464", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "68", - "s" : [ { - "value" : [ "\"Diastolic blood pressure\"" ] - } ] - } ] - } ] - } ] - }, { - "value" : [ " then\n " ] - }, { - "r" : "136", - "s" : [ { - "value" : [ "{" ] - }, { - "r" : "135", - "s" : [ { - "value" : [ "{\n " ] - }, { - "s" : [ { - "value" : [ "DueDate",": " ] + "localId" : "2465", + "name" : "Flag", + "elementType" : { + "localId" : "2466", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "89", - "s" : [ { - "value" : [ "ToString","(" ] - }, { - "r" : "88", - "s" : [ { - "value" : [ "DueDate","(" ] - }, { - "r" : "71", - "s" : [ { - "value" : [ "goal" ] + "localId" : "2467", + "name" : "Performer", + "elementType" : { + "localId" : "2468", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2469", + "name" : "Notes", + "elementType" : { + "localId" : "2470", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2471", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "2472", + "name" : "Provenance", + "elementType" : { + "localId" : "2473", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2474", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2475", + "name" : "Transmitter", + "elementType" : { + "localId" : "2476", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2477", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "2478", + "name" : "Author", + "elementType" : { + "localId" : "2479", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2480", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } } ] - }, { - "value" : [ ")" ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - }, { - "value" : [ ",\n " ] - }, { - "s" : [ { - "value" : [ "DisplayName",": " ] + } + } }, { - "r" : "90", - "s" : [ { - "value" : [ "'Blood Pressure'" ] - } ] + "localId" : "2481", + "name" : "LearnMore", + "elementType" : { + "localId" : "2482", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } } ] - }, { - "value" : [ ",\n " ] - }, { - "s" : [ { - "value" : [ "TargetValue",": " ] - }, { - "r" : "125", - "s" : [ { - "r" : "123", - "s" : [ { - "r" : "108", - "s" : [ { - "r" : "106", - "s" : [ { - "r" : "91", - "s" : [ { - "value" : [ "'below '" ] - } ] - }, { - "value" : [ " + " ] - }, { - "r" : "105", - "s" : [ { - "value" : [ "ToString","(" ] - }, { - "r" : "104", - "s" : [ { - "r" : "103", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "103", - "s" : [ { - "r" : "101", - "s" : [ { - "r" : "100", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "100", - "s" : [ { - "value" : [ "singleton from " ] - }, { - "r" : "99", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "99", - "s" : [ { - "s" : [ { - "r" : "93", - "s" : [ { - "r" : "92", - "s" : [ { - "s" : [ { - "value" : [ "goal",".","target" ] - } ] - } ] - }, { - "value" : [ " ","T" ] - } ] - } ] - }, { - "value" : [ " " ] - }, { - "r" : "98", - "s" : [ { - "value" : [ "where " ] - }, { - "r" : "98", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "98", - "s" : [ { - "r" : "95", - "s" : [ { - "r" : "94", - "s" : [ { - "value" : [ "T" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "95", - "s" : [ { - "value" : [ "measure" ] - } ] - } ] - }, { - "value" : [ " ","~"," " ] - }, { - "r" : "97", - "s" : [ { - "r" : "96", - "s" : [ { - "value" : [ "Cx" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "97", - "s" : [ { - "value" : [ "\"Systolic blood pressure\"" ] - } ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "101", - "s" : [ { - "value" : [ "detail" ] - } ] - } ] - }, { - "value" : [ " as " ] - }, { - "r" : "102", - "s" : [ { - "value" : [ "FHIR",".","Quantity" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "104", - "s" : [ { - "value" : [ "value" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - }, { - "value" : [ "\n + " ] - }, { - "r" : "107", - "s" : [ { - "value" : [ "'/'" ] - } ] - } ] - }, { - "value" : [ " + " ] - }, { - "r" : "122", - "s" : [ { - "value" : [ "ToString","(" ] - }, { - "r" : "121", - "s" : [ { - "r" : "120", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "120", - "s" : [ { - "r" : "118", - "s" : [ { - "r" : "117", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "117", - "s" : [ { - "value" : [ "singleton from " ] - }, { - "r" : "116", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "116", - "s" : [ { - "s" : [ { - "r" : "110", - "s" : [ { - "r" : "109", - "s" : [ { - "s" : [ { - "value" : [ "goal",".","target" ] - } ] - } ] - }, { - "value" : [ " ","T" ] - } ] - } ] - }, { - "value" : [ " " ] - }, { - "r" : "115", - "s" : [ { - "value" : [ "where " ] - }, { - "r" : "115", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "115", - "s" : [ { - "r" : "112", - "s" : [ { - "r" : "111", - "s" : [ { - "value" : [ "T" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "112", - "s" : [ { - "value" : [ "measure" ] - } ] - } ] - }, { - "value" : [ " ","~"," " ] - }, { - "r" : "114", - "s" : [ { - "r" : "113", - "s" : [ { - "value" : [ "Cx" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "114", - "s" : [ { - "value" : [ "\"Diastolic blood pressure\"" ] - } ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "118", - "s" : [ { - "value" : [ "detail" ] - } ] - } ] - }, { - "value" : [ " as " ] - }, { - "r" : "119", - "s" : [ { - "value" : [ "FHIR",".","Quantity" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "121", - "s" : [ { - "value" : [ "value" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - }, { - "value" : [ " + " ] - }, { - "r" : "124", - "s" : [ { - "value" : [ "' mmHg'" ] - } ] - } ] - } ] - }, { - "value" : [ ",\n // LastResult: DE.ReportMostRecentResult(DE.FindObservations(Cx.\"Blood pressure\"))\n " ] - }, { - "s" : [ { - "value" : [ "LastResult",": " ] - }, { - "r" : "134", - "s" : [ { - "r" : "126", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "134", - "s" : [ { - "value" : [ "ReportMostRecentResult","(" ] - }, { - "r" : "133", - "s" : [ { - "r" : "127", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "133", - "s" : [ { - "value" : [ "FindObservations","(" ] - }, { - "r" : "132", - "s" : [ { - "r" : "131", - "s" : [ { - "r" : "129", - "s" : [ { - "r" : "128", - "s" : [ { - "value" : [ "goal" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "129", - "s" : [ { - "value" : [ "target" ] - } ] - } ] - }, { - "r" : "130", - "value" : [ "[","0","]" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "132", - "s" : [ { - "value" : [ "measure" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - } ] - }, { - "value" : [ "\n }" ] - } ] - }, { - "value" : [ "}" ] - } ] - }, { - "value" : [ "\n else\n " ] - }, { - "r" : "182", - "s" : [ { - "s" : [ { - "r" : "139", - "s" : [ { - "r" : "138", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "138", - "s" : [ { - "r" : "137", - "s" : [ { - "value" : [ "goal" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "138", - "s" : [ { - "value" : [ "target" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - }, { - "value" : [ " ","target" ] - } ] - } ] - }, { - "value" : [ "\n " ] - }, { - "r" : "181", - "s" : [ { - "value" : [ "return " ] - }, { - "r" : "180", - "s" : [ { - "value" : [ "{\n " ] - }, { - "s" : [ { - "value" : [ "DueDate",": " ] - }, { - "r" : "145", - "s" : [ { - "value" : [ "ToString","(" ] - }, { - "r" : "144", - "s" : [ { - "r" : "143", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "143", - "s" : [ { - "r" : "141", - "s" : [ { - "r" : "140", - "s" : [ { - "value" : [ "target" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "141", - "s" : [ { - "value" : [ "due" ] - } ] - } ] - }, { - "value" : [ " as " ] - }, { - "r" : "142", - "s" : [ { - "value" : [ "FHIR",".","date" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "144", - "s" : [ { - "value" : [ "value" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - }, { - "value" : [ ",\n " ] - }, { - "s" : [ { - "value" : [ "DisplayName",": " ] - }, { - "r" : "149", - "s" : [ { - "r" : "146", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "149", - "s" : [ { - "value" : [ "ConceptText","(" ] - }, { - "r" : "148", - "s" : [ { - "r" : "147", - "s" : [ { - "value" : [ "target" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "148", - "s" : [ { - "value" : [ "measure" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - } ] - }, { - "value" : [ ",\n " ] - }, { - "s" : [ { - "value" : [ "TargetValue",": " ] - }, { - "r" : "173", - "s" : [ { - "value" : [ "Coalesce","(" ] - }, { - "r" : "155", - "s" : [ { - "r" : "150", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "155", - "s" : [ { - "value" : [ "QuantityTextWithComparator","(" ] - }, { - "r" : "154", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "154", - "s" : [ { - "r" : "152", - "s" : [ { - "r" : "151", - "s" : [ { - "value" : [ "target" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "152", - "s" : [ { - "value" : [ "detail" ] - } ] - } ] - }, { - "value" : [ " as " ] - }, { - "r" : "153", - "s" : [ { - "value" : [ "Quantity" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - }, { - "value" : [ ",\n " ] - }, { - "r" : "161", - "s" : [ { - "r" : "156", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "161", - "s" : [ { - "value" : [ "RangeText","(" ] - }, { - "r" : "160", - "s" : [ { - "r" : "158", - "s" : [ { - "r" : "157", - "s" : [ { - "value" : [ "target" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "158", - "s" : [ { - "value" : [ "detail" ] - } ] - } ] - }, { - "value" : [ " as " ] - }, { - "r" : "159", - "s" : [ { - "value" : [ "FHIR",".","Range" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - }, { - "value" : [ ",\n " ] - }, { - "r" : "167", - "s" : [ { - "r" : "162", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "167", - "s" : [ { - "value" : [ "ConceptText","(" ] - }, { - "r" : "166", - "s" : [ { - "r" : "164", - "s" : [ { - "r" : "163", - "s" : [ { - "value" : [ "target" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "164", - "s" : [ { - "value" : [ "detail" ] - } ] - } ] - }, { - "value" : [ " as " ] - }, { - "r" : "165", - "s" : [ { - "value" : [ "CodeableConcept" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - }, { - "value" : [ ",\n " ] - }, { - "r" : "172", - "s" : [ { - "r" : "171", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "171", - "s" : [ { - "r" : "169", - "s" : [ { - "r" : "168", - "s" : [ { - "value" : [ "target" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "169", - "s" : [ { - "value" : [ "detail" ] - } ] - } ] - }, { - "value" : [ " as " ] - }, { - "r" : "170", - "s" : [ { - "value" : [ "FHIR",".","string" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "172", - "s" : [ { - "value" : [ "value" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - }, { - "value" : [ ",\n " ] - }, { - "s" : [ { - "value" : [ "LastResult",": " ] - }, { - "r" : "179", - "s" : [ { - "r" : "174", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "179", - "s" : [ { - "value" : [ "ReportMostRecentResult","(" ] - }, { - "r" : "178", - "s" : [ { - "r" : "175", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "178", - "s" : [ { - "value" : [ "FindObservations","(" ] - }, { - "r" : "177", - "s" : [ { - "r" : "176", - "s" : [ { - "value" : [ "target" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "177", - "s" : [ { - "value" : [ "measure" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - } ] - }, { - "value" : [ "\n }" ] - } ] - } ] - } ] - } ] - } ] - } ] - } - } ], - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DueDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "TargetValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "LastResult", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Performer", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - } ] - } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } ] - } - } ] - } - }, - "expression" : { - "localId" : "183", - "locator" : "59:3-78:5", - "type" : "If", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DueDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "TargetValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "LastResult", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Performer", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - } ] - } } - }, { - "name" : "LearnMore", + } ] + } + } + }, { + "localId" : "2483", + "name" : "Addresses", + "elementType" : { + "localId" : "2484", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2485", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2486", + "name" : "DisplayName", "elementType" : { + "localId" : "2487", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } ] } - } ] - } - }, - "condition" : { - "localId" : "70", - "locator" : "59:6-59:116", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "Or", - "operand" : [ { - "localId" : "61", - "locator" : "59:6-59:58", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "Equivalent", - "operand" : [ { - "name" : "ToConcept", - "libraryName" : "FHIRHelpers", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "58", - "locator" : "59:6-59:27", - "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", - "path" : "measure", - "type" : "Property", - "source" : { - "localId" : "57", - "locator" : "59:6-59:19", - "resultTypeName" : "{http://hl7.org/fhir}Goal.Target", - "type" : "Indexer", - "operand" : [ { - "localId" : "55", - "locator" : "59:6-59:16", - "path" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", - "type" : "NamedTypeSpecifier" - } - }, - "source" : { - "localId" : "54", - "locator" : "59:6-59:9", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" - } - }, { - "localId" : "56", - "locator" : "59:18", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0", - "type" : "Literal" - } ] - } - } ] - }, { - "type" : "ToConcept", - "operand" : { - "localId" : "60", - "locator" : "59:31-59:58", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Code", - "name" : "Systolic blood pressure", - "libraryName" : "Cx", - "type" : "CodeRef" - } - } ] + } }, { - "localId" : "69", - "locator" : "59:63-59:116", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "Equivalent", - "operand" : [ { - "name" : "ToConcept", - "libraryName" : "FHIRHelpers", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "66", - "locator" : "59:63-59:84", - "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", - "path" : "measure", - "type" : "Property", - "source" : { - "localId" : "65", - "locator" : "59:63-59:76", - "resultTypeName" : "{http://hl7.org/fhir}Goal.Target", - "type" : "Indexer", - "operand" : [ { - "localId" : "63", - "locator" : "59:63-59:73", - "path" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", - "type" : "NamedTypeSpecifier" - } - }, - "source" : { - "localId" : "62", - "locator" : "59:63-59:66", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" - } - }, { - "localId" : "64", - "locator" : "59:75", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0", - "type" : "Literal" - } ] - } - } ] - }, { - "type" : "ToConcept", - "operand" : { - "localId" : "68", - "locator" : "59:88-59:116", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Code", - "name" : "Diastolic blood pressure", - "libraryName" : "Cx", - "type" : "CodeRef" - } - } ] - } ] - }, - "then" : { - "localId" : "136", - "locator" : "60:5-67:6", - "type" : "List", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", + "localId" : "2488", + "name" : "LifecycleStatus", "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DueDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "TargetValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "LastResult", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Performer", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - } ] - } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } ] - } - } ] + "localId" : "2489", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2490", + "name" : "AchievementStatus", + "elementType" : { + "localId" : "2491", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2492", + "name" : "Notes", + "elementType" : { + "localId" : "2493", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2494", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } } - }, - "element" : [ { - "localId" : "135", - "locator" : "60:6-67:5", - "type" : "Tuple", - "resultTypeSpecifier" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DueDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "TargetValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "LastResult", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", + }, { + "localId" : "2495", + "name" : "Provenance", + "elementType" : { + "localId" : "2496", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2497", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2498", + "name" : "Transmitter", + "elementType" : { + "localId" : "2499", + "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2500", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultUnits", + } + }, { + "localId" : "2501", + "name" : "Author", + "elementType" : { + "localId" : "2502", + "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2503", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, { - "name" : "ReferenceRange", + } + } ] + } + } + }, { + "localId" : "2504", + "name" : "LearnMore", + "elementType" : { + "localId" : "2505", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2506", + "name" : "Overdue", + "elementType" : { + "localId" : "2507", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + } ] + } + }, + "expression" : { + "localId" : "2267", + "locator" : "43:3-44:24", + "type" : "Query", + "resultTypeSpecifier" : { + "localId" : "2348", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2349", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2350", + "name" : "Category", + "elementType" : { + "localId" : "2351", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2352", + "name" : "Description", + "elementType" : { + "localId" : "2353", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2354", + "name" : "ExpressedBy", + "elementType" : { + "localId" : "2355", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2356", + "name" : "StartDate", + "elementType" : { + "localId" : "2357", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2358", + "name" : "Target", + "elementType" : { + "localId" : "2359", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2360", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2361", + "name" : "DueDate", "elementType" : { + "localId" : "2362", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "Interpretation", + "localId" : "2363", + "name" : "DisplayName", "elementType" : { + "localId" : "2364", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Performer", + "localId" : "2365", + "name" : "TargetValue", "elementType" : { + "localId" : "2366", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - } ] - } - } - }, { - "name" : "LearnMore", + "localId" : "2367", + "name" : "LastResult", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } ] - } - } ] - }, - "element" : [ { - "name" : "DueDate", - "value" : { - "localId" : "89", - "locator" : "61:16-61:38", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "type" : "ToString", - "operand" : { - "localId" : "88", - "locator" : "61:25-61:37", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", - "name" : "DueDate", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "71", - "locator" : "61:33-61:36", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" - } ] - } - } - }, { - "name" : "DisplayName", - "value" : { - "localId" : "90", - "locator" : "62:20-62:35", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "valueType" : "{urn:hl7-org:elm-types:r1}String", - "value" : "Blood Pressure", - "type" : "Literal" - } - }, { - "name" : "TargetValue", - "value" : { - "localId" : "125", - "locator" : "63:20-64:150", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "type" : "Concatenate", - "operand" : [ { - "localId" : "123", - "locator" : "63:20-64:140", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "type" : "Concatenate", - "operand" : [ { - "localId" : "108", - "locator" : "63:20-64:13", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "type" : "Concatenate", - "operand" : [ { - "localId" : "106", - "locator" : "63:20-63:153", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "type" : "Concatenate", - "operand" : [ { - "localId" : "91", - "locator" : "63:20-63:27", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "valueType" : "{urn:hl7-org:elm-types:r1}String", - "value" : "below ", - "type" : "Literal" + "localId" : "2368", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2369", + "name" : "DisplayName", + "elementType" : { + "localId" : "2370", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2371", + "name" : "ConceptName", + "elementType" : { + "localId" : "2372", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2373", + "name" : "Date", + "elementType" : { + "localId" : "2374", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2375", + "name" : "ResultText", + "elementType" : { + "localId" : "2376", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "localId" : "105", - "locator" : "63:31-63:153", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "type" : "ToString", - "operand" : { - "name" : "ToDecimal", - "libraryName" : "FHIRHelpers", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "104", - "locator" : "63:40-63:152", - "resultTypeName" : "{http://hl7.org/fhir}decimal", - "path" : "value", - "type" : "Property", - "source" : { - "localId" : "103", - "locator" : "63:40-63:146", - "resultTypeName" : "{http://hl7.org/fhir}Quantity", - "strict" : false, - "type" : "As", - "operand" : { - "localId" : "101", - "locator" : "63:41-63:128", - "path" : "detail", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ChoiceTypeSpecifier", - "choice" : [ { - "name" : "{http://hl7.org/fhir}Quantity", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}Range", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}CodeableConcept", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}string", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}boolean", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}integer", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}Ratio", - "type" : "NamedTypeSpecifier" - } ] - }, - "source" : { - "localId" : "100", - "locator" : "63:41-63:121", - "resultTypeName" : "{http://hl7.org/fhir}Goal.Target", - "type" : "SingletonFrom", - "operand" : { - "localId" : "99", - "locator" : "63:57-63:120", - "type" : "Query", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", - "type" : "NamedTypeSpecifier" - } - }, - "source" : [ { - "localId" : "93", - "locator" : "63:58-63:70", - "alias" : "T", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", - "type" : "NamedTypeSpecifier" - } - }, - "expression" : { - "localId" : "92", - "locator" : "63:58-63:68", - "path" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", - "type" : "NamedTypeSpecifier" - } - }, - "source" : { - "name" : "goal", - "type" : "OperandRef" - } - } - } ], - "relationship" : [ ], - "where" : { - "localId" : "98", - "locator" : "63:72-63:119", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "Equivalent", - "operand" : [ { - "name" : "ToConcept", - "libraryName" : "FHIRHelpers", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "95", - "locator" : "63:79-63:87", - "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", - "path" : "measure", - "scope" : "T", - "type" : "Property" - } ] - }, { - "type" : "ToConcept", - "operand" : { - "localId" : "97", - "locator" : "63:91-63:118", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Code", - "name" : "Systolic blood pressure", - "libraryName" : "Cx", - "type" : "CodeRef" - } - } ] - } - } - } - }, - "asTypeSpecifier" : { - "localId" : "102", - "locator" : "63:133-63:145", - "resultTypeName" : "{http://hl7.org/fhir}Quantity", - "name" : "{http://hl7.org/fhir}Quantity", - "type" : "NamedTypeSpecifier" - } - } - } ] + "localId" : "2377", + "name" : "ResultValue", + "elementType" : { + "localId" : "2378", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" } - } ] - }, { - "localId" : "107", - "locator" : "64:11-64:13", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "valueType" : "{urn:hl7-org:elm-types:r1}String", - "value" : "/", - "type" : "Literal" - } ] - }, { - "localId" : "122", - "locator" : "64:17-64:140", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "type" : "ToString", - "operand" : { - "name" : "ToDecimal", - "libraryName" : "FHIRHelpers", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "121", - "locator" : "64:26-64:139", - "resultTypeName" : "{http://hl7.org/fhir}decimal", - "path" : "value", - "type" : "Property", - "source" : { - "localId" : "120", - "locator" : "64:26-64:133", - "resultTypeName" : "{http://hl7.org/fhir}Quantity", - "strict" : false, - "type" : "As", - "operand" : { - "localId" : "118", - "locator" : "64:27-64:115", - "path" : "detail", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ChoiceTypeSpecifier", - "choice" : [ { - "name" : "{http://hl7.org/fhir}Quantity", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}Range", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}CodeableConcept", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}string", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}boolean", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}integer", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}Ratio", - "type" : "NamedTypeSpecifier" - } ] - }, - "source" : { - "localId" : "117", - "locator" : "64:27-64:108", - "resultTypeName" : "{http://hl7.org/fhir}Goal.Target", - "type" : "SingletonFrom", - "operand" : { - "localId" : "116", - "locator" : "64:43-64:107", - "type" : "Query", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", - "type" : "NamedTypeSpecifier" - } - }, - "source" : [ { - "localId" : "110", - "locator" : "64:44-64:56", - "alias" : "T", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", - "type" : "NamedTypeSpecifier" - } - }, - "expression" : { - "localId" : "109", - "locator" : "64:44-64:54", - "path" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", - "type" : "NamedTypeSpecifier" - } - }, - "source" : { - "name" : "goal", - "type" : "OperandRef" - } - } - } ], - "relationship" : [ ], - "where" : { - "localId" : "115", - "locator" : "64:58-64:106", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "Equivalent", - "operand" : [ { - "name" : "ToConcept", - "libraryName" : "FHIRHelpers", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "112", - "locator" : "64:65-64:73", - "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", - "path" : "measure", - "scope" : "T", - "type" : "Property" - } ] - }, { - "type" : "ToConcept", - "operand" : { - "localId" : "114", - "locator" : "64:77-64:105", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Code", - "name" : "Diastolic blood pressure", - "libraryName" : "Cx", - "type" : "CodeRef" - } - } ] + }, { + "localId" : "2379", + "name" : "ResultUnits", + "elementType" : { + "localId" : "2380", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2381", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "2382", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2383", + "name" : "Interpretation", + "elementType" : { + "localId" : "2384", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2385", + "name" : "Flag", + "elementType" : { + "localId" : "2386", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2387", + "name" : "Performer", + "elementType" : { + "localId" : "2388", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2389", + "name" : "Notes", + "elementType" : { + "localId" : "2390", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2391", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "2392", + "name" : "Provenance", + "elementType" : { + "localId" : "2393", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2394", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2395", + "name" : "Transmitter", + "elementType" : { + "localId" : "2396", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2397", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } } - } - }, - "asTypeSpecifier" : { - "localId" : "119", - "locator" : "64:120-64:132", - "resultTypeName" : "{http://hl7.org/fhir}Quantity", - "name" : "{http://hl7.org/fhir}Quantity", - "type" : "NamedTypeSpecifier" + }, { + "localId" : "2398", + "name" : "Author", + "elementType" : { + "localId" : "2399", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2400", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] } } + }, { + "localId" : "2401", + "name" : "LearnMore", + "elementType" : { + "localId" : "2402", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } } ] } } ] - }, { - "localId" : "124", - "locator" : "64:144-64:150", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "valueType" : "{urn:hl7-org:elm-types:r1}String", - "value" : " mmHg", - "type" : "Literal" - } ] + } } }, { - "name" : "LastResult", - "value" : { - "localId" : "134", - "locator" : "66:19-66:88", - "name" : "ReportMostRecentResult", - "libraryName" : "DE", - "type" : "FunctionRef", - "resultTypeSpecifier" : { + "localId" : "2403", + "name" : "Addresses", + "elementType" : { + "localId" : "2404", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2405", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "2406", "name" : "DisplayName", "elementType" : { + "localId" : "2407", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Performer", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Notes", + } ] + } + } + }, { + "localId" : "2408", + "name" : "LifecycleStatus", + "elementType" : { + "localId" : "2409", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2410", + "name" : "AchievementStatus", + "elementType" : { + "localId" : "2411", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2412", + "name" : "Notes", + "elementType" : { + "localId" : "2413", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2414", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "2415", + "name" : "Provenance", + "elementType" : { + "localId" : "2416", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2417", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2418", + "name" : "Transmitter", "elementType" : { + "localId" : "2419", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2420", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { - "name" : "Provenance", + "localId" : "2421", + "name" : "Author", "elementType" : { + "localId" : "2422", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2423", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] + } + } + }, { + "localId" : "2424", + "name" : "LearnMore", + "elementType" : { + "localId" : "2425", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2426", + "name" : "Overdue", + "elementType" : { + "localId" : "2427", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + } ] + } + }, + "source" : [ { + "localId" : "2099", + "locator" : "43:3-43:9", + "alias" : "G", + "resultTypeSpecifier" : { + "localId" : "2103", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2104", + "name" : "{http://hl7.org/fhir}Goal", + "type" : "NamedTypeSpecifier" + } + }, + "expression" : { + "localId" : "2100", + "locator" : "43:3-43:7", + "name" : "goals", + "type" : "OperandRef", + "resultTypeSpecifier" : { + "localId" : "2101", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2102", + "name" : "{http://hl7.org/fhir}Goal", + "type" : "NamedTypeSpecifier" + } + } + } + } ], + "let" : [ ], + "relationship" : [ ], + "return" : { + "localId" : "2105", + "locator" : "44:5-44:24", + "resultTypeSpecifier" : { + "localId" : "2187", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2188", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2189", + "name" : "Category", + "elementType" : { + "localId" : "2190", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2191", + "name" : "Description", + "elementType" : { + "localId" : "2192", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2193", + "name" : "ExpressedBy", + "elementType" : { + "localId" : "2194", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2195", + "name" : "StartDate", + "elementType" : { + "localId" : "2196", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2197", + "name" : "Target", + "elementType" : { + "localId" : "2198", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2199", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2200", + "name" : "DueDate", + "elementType" : { + "localId" : "2201", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2202", + "name" : "DisplayName", + "elementType" : { + "localId" : "2203", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2204", + "name" : "TargetValue", + "elementType" : { + "localId" : "2205", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2206", + "name" : "LastResult", + "elementType" : { + "localId" : "2207", "type" : "TupleTypeSpecifier", "element" : [ { - "name" : "Transmitter", + "localId" : "2208", + "name" : "DisplayName", "elementType" : { + "localId" : "2209", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2210", + "name" : "ConceptName", + "elementType" : { + "localId" : "2211", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2212", + "name" : "Date", + "elementType" : { + "localId" : "2213", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2214", + "name" : "ResultText", + "elementType" : { + "localId" : "2215", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2216", + "name" : "ResultValue", + "elementType" : { + "localId" : "2217", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2218", + "name" : "ResultUnits", + "elementType" : { + "localId" : "2219", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2220", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "2221", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2222", + "name" : "Interpretation", + "elementType" : { + "localId" : "2223", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2224", + "name" : "Flag", + "elementType" : { + "localId" : "2225", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2226", + "name" : "Performer", + "elementType" : { + "localId" : "2227", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2228", + "name" : "Notes", + "elementType" : { + "localId" : "2229", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2230", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { - "name" : "Author", + "localId" : "2231", + "name" : "Provenance", "elementType" : { + "localId" : "2232", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" + "localId" : "2233", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2234", + "name" : "Transmitter", + "elementType" : { + "localId" : "2235", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2236", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "2237", + "name" : "Author", + "elementType" : { + "localId" : "2238", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2239", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] } } - } ] - } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } ] - }, - "operand" : [ { - "localId" : "133", - "locator" : "66:45-66:87", - "name" : "FindObservations", - "libraryName" : "DE", - "type" : "FunctionRef", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Observation", - "type" : "NamedTypeSpecifier" - } - }, - "operand" : [ { - "localId" : "132", - "locator" : "66:65-66:86", - "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", - "path" : "measure", - "type" : "Property", - "source" : { - "localId" : "131", - "locator" : "66:65-66:78", - "resultTypeName" : "{http://hl7.org/fhir}Goal.Target", - "type" : "Indexer", - "operand" : [ { - "localId" : "129", - "locator" : "66:65-66:75", - "path" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", + }, { + "localId" : "2240", + "name" : "LearnMore", "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", + "localId" : "2241", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, - "source" : { - "localId" : "128", - "locator" : "66:65-66:68", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" - } - }, { - "localId" : "130", - "locator" : "66:77", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0", - "type" : "Literal" - } ] - } - } ] - } ] - } - } ] - } ] - }, - "else" : { - "localId" : "182", - "locator" : "69:3-78:5", - "type" : "Query", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DueDate", + } ] + } + } ] + } + } + }, { + "localId" : "2242", + "name" : "Addresses", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" + "localId" : "2243", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2244", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2245", + "name" : "DisplayName", + "elementType" : { + "localId" : "2246", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } ] + } } }, { - "name" : "DisplayName", + "localId" : "2247", + "name" : "LifecycleStatus", "elementType" : { + "localId" : "2248", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "TargetValue", + "localId" : "2249", + "name" : "AchievementStatus", "elementType" : { + "localId" : "2250", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "LastResult", + "localId" : "2251", + "name" : "Notes", "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Performer", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", + "localId" : "2252", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2253", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "2254", + "name" : "Provenance", + "elementType" : { + "localId" : "2255", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2256", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2257", + "name" : "Transmitter", + "elementType" : { + "localId" : "2258", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2259", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "2260", + "name" : "Author", + "elementType" : { + "localId" : "2261", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2262", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] + } + } + }, { + "localId" : "2263", + "name" : "LearnMore", + "elementType" : { + "localId" : "2264", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2265", + "name" : "Overdue", + "elementType" : { + "localId" : "2266", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + } ] + } + }, + "expression" : { + "localId" : "2107", + "locator" : "44:12-44:24", + "name" : "ReportGoal", + "type" : "FunctionRef", + "resultTypeSpecifier" : { + "localId" : "2108", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2109", + "name" : "Category", + "elementType" : { + "localId" : "2110", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2111", + "name" : "Description", + "elementType" : { + "localId" : "2112", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2113", + "name" : "ExpressedBy", + "elementType" : { + "localId" : "2114", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2115", + "name" : "StartDate", + "elementType" : { + "localId" : "2116", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2117", + "name" : "Target", + "elementType" : { + "localId" : "2118", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2119", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2120", + "name" : "DueDate", "elementType" : { + "localId" : "2121", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - } - }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", + }, { + "localId" : "2122", + "name" : "DisplayName", + "elementType" : { + "localId" : "2123", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2124", + "name" : "TargetValue", "elementType" : { + "localId" : "2125", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2126", + "name" : "LastResult", + "elementType" : { + "localId" : "2127", "type" : "TupleTypeSpecifier", "element" : [ { - "name" : "Transmitter", + "localId" : "2128", + "name" : "DisplayName", + "elementType" : { + "localId" : "2129", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2130", + "name" : "ConceptName", + "elementType" : { + "localId" : "2131", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2132", + "name" : "Date", + "elementType" : { + "localId" : "2133", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2134", + "name" : "ResultText", + "elementType" : { + "localId" : "2135", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2136", + "name" : "ResultValue", + "elementType" : { + "localId" : "2137", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2138", + "name" : "ResultUnits", + "elementType" : { + "localId" : "2139", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2140", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "2141", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2142", + "name" : "Interpretation", + "elementType" : { + "localId" : "2143", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2144", + "name" : "Flag", + "elementType" : { + "localId" : "2145", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2146", + "name" : "Performer", + "elementType" : { + "localId" : "2147", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2148", + "name" : "Notes", "elementType" : { + "localId" : "2149", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2150", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { - "name" : "Author", + "localId" : "2151", + "name" : "Provenance", "elementType" : { + "localId" : "2152", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" + "localId" : "2153", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2154", + "name" : "Transmitter", + "elementType" : { + "localId" : "2155", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2156", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "2157", + "name" : "Author", + "elementType" : { + "localId" : "2158", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2159", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] } } + }, { + "localId" : "2160", + "name" : "LearnMore", + "elementType" : { + "localId" : "2161", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } } ] } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } ] + } ] + } } - } ] - } - }, - "source" : [ { - "localId" : "139", - "locator" : "69:3-69:22", - "alias" : "target", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", - "type" : "NamedTypeSpecifier" - } - }, - "expression" : { - "localId" : "138", - "locator" : "69:3-69:15", - "path" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", + }, { + "localId" : "2162", + "name" : "Addresses", "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", - "type" : "NamedTypeSpecifier" - } - }, - "source" : { - "localId" : "137", - "locator" : "69:4-69:7", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" - } - } - } ], - "relationship" : [ ], - "return" : { - "localId" : "181", - "locator" : "70:5-78:5", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DueDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "DisplayName", + "localId" : "2163", + "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" + "localId" : "2164", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2165", + "name" : "DisplayName", + "elementType" : { + "localId" : "2166", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } ] } - }, { - "name" : "TargetValue", + } + }, { + "localId" : "2167", + "name" : "LifecycleStatus", + "elementType" : { + "localId" : "2168", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2169", + "name" : "AchievementStatus", + "elementType" : { + "localId" : "2170", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2171", + "name" : "Notes", + "elementType" : { + "localId" : "2172", + "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2173", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, { - "name" : "LastResult", + } + }, { + "localId" : "2174", + "name" : "Provenance", + "elementType" : { + "localId" : "2175", + "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2176", "type" : "TupleTypeSpecifier", "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Performer", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Notes", + "localId" : "2177", + "name" : "Transmitter", "elementType" : { + "localId" : "2178", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2179", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { - "name" : "Provenance", + "localId" : "2180", + "name" : "Author", "elementType" : { + "localId" : "2181", "type" : "ListTypeSpecifier", "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - } ] + "localId" : "2182", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } } ] } - } ] - } + } + }, { + "localId" : "2183", + "name" : "LearnMore", + "elementType" : { + "localId" : "2184", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2185", + "name" : "Overdue", + "elementType" : { + "localId" : "2186", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + } ] }, - "expression" : { - "localId" : "180", - "locator" : "70:12-78:5", - "type" : "Tuple", - "resultTypeSpecifier" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DueDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "TargetValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "signature" : [ ], + "operand" : [ { + "localId" : "2106", + "locator" : "44:23", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "G", + "type" : "AliasRef" + } ] + } + } + }, + "operand" : [ { + "localId" : "268", + "name" : "goals", + "operandTypeSpecifier" : { + "localId" : "264", + "locator" : "42:35-42:44", + "type" : "ListTypeSpecifier", + "resultTypeSpecifier" : { + "localId" : "266", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "267", + "name" : "{http://hl7.org/fhir}Goal", + "type" : "NamedTypeSpecifier" + } + }, + "elementType" : { + "localId" : "265", + "locator" : "42:40-42:43", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "{http://hl7.org/fhir}Goal", + "type" : "NamedTypeSpecifier" + } + } + } ] + }, { + "localId" : "278", + "locator" : "46:1-60:3", + "name" : "ReportGoal", + "context" : "Patient", + "accessLevel" : "Public", + "type" : "FunctionDef", + "annotation" : [ { + "type" : "Annotation", + "s" : { + "r" : "278", + "s" : [ { + "value" : [ "","define function ReportGoal(goal Goal):\n " ] + }, { + "r" : "2508", + "s" : [ { + "r" : "2508", + "s" : [ { + "value" : [ "{\n " ] + }, { + "s" : [ { + "value" : [ "Category",": " ] }, { - "name" : "LastResult", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "r" : "2518", + "s" : [ { + "r" : "2509", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2518", + "s" : [ { + "value" : [ "ConceptText","(" ] }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "r" : "2510", + "s" : [ { + "r" : "2512", + "s" : [ { + "r" : "2511", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2512", + "s" : [ { + "value" : [ "category" ] + } ] + } ] + }, { + "r" : "2517", + "value" : [ "[","0","]" ] + } ] }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } + "value" : [ ")" ] + } ] + } ] + } ] + }, { + "value" : [ ", // TODO: array of categories\n " ] + }, { + "s" : [ { + "value" : [ "Description",": " ] + }, { + "r" : "2522", + "s" : [ { + "r" : "2519", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2522", + "s" : [ { + "value" : [ "ConceptText","(" ] }, { - "name" : "Performer", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "r" : "2521", + "s" : [ { + "r" : "2520", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2521", + "s" : [ { + "value" : [ "description" ] + } ] + } ] }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } + "value" : [ ")" ] + } ] + } ] + } ] + }, { + "value" : [ ",\n " ] + }, { + "s" : [ { + "value" : [ "ExpressedBy",": " ] + }, { + "r" : "2526", + "s" : [ { + "r" : "2525", + "s" : [ { + "r" : "2524", + "s" : [ { + "r" : "2523", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2524", + "s" : [ { + "value" : [ "expressedBy" ] + } ] + } ] }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - } ] - } - } + "value" : [ "." ] }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "r" : "2525", + "s" : [ { + "value" : [ "display" ] + } ] } ] - } + }, { + "value" : [ "." ] + }, { + "r" : "2526", + "s" : [ { + "value" : [ "value" ] + } ] + } ] } ] - }, - "element" : [ { - "name" : "DueDate", - "value" : { - "localId" : "145", - "locator" : "71:16-71:56", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "type" : "ToString", - "operand" : { - "localId" : "144", - "locator" : "71:25-71:55", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", - "path" : "value", - "type" : "Property", - "source" : { - "localId" : "143", - "locator" : "71:25-71:49", - "resultTypeName" : "{http://hl7.org/fhir}date", - "strict" : false, - "type" : "As", - "operand" : { - "localId" : "141", - "locator" : "71:26-71:35", - "path" : "due", - "scope" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ChoiceTypeSpecifier", - "choice" : [ { - "name" : "{http://hl7.org/fhir}date", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}Duration", - "type" : "NamedTypeSpecifier" - } ] - } - }, - "asTypeSpecifier" : { - "localId" : "142", - "locator" : "71:40-71:48", - "resultTypeName" : "{http://hl7.org/fhir}date", - "name" : "{http://hl7.org/fhir}date", - "type" : "NamedTypeSpecifier" - } - } - } - } }, { - "name" : "DisplayName", - "value" : { - "localId" : "149", - "locator" : "72:20-72:49", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "name" : "ConceptText", - "libraryName" : "DE", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "148", - "locator" : "72:35-72:48", - "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", - "path" : "measure", - "scope" : "target", - "type" : "Property" + "value" : [ ",\n " ] + }, { + "s" : [ { + "value" : [ "StartDate",": " ] + }, { + "r" : "2539", + "s" : [ { + "value" : [ "ToString","(" ] + }, { + "r" : "2528", + "s" : [ { + "r" : "2527", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2528", + "s" : [ { + "value" : [ "start" ] + } ] + } ] + }, { + "value" : [ ")" ] } ] - } + } ] }, { - "name" : "TargetValue", - "value" : { - "localId" : "173", - "locator" : "73:20-76:57", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "type" : "Coalesce", - "operand" : [ { - "localId" : "155", - "locator" : "73:29-73:86", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "name" : "QuantityTextWithComparator", - "libraryName" : "DE", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "154", - "locator" : "73:59-73:85", - "resultTypeName" : "{http://hl7.org/fhir}Quantity", - "strict" : false, - "type" : "As", - "operand" : { - "localId" : "152", - "locator" : "73:60-73:72", - "path" : "detail", - "scope" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ChoiceTypeSpecifier", - "choice" : [ { - "name" : "{http://hl7.org/fhir}Quantity", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}Range", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}CodeableConcept", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}string", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}boolean", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}integer", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}Ratio", - "type" : "NamedTypeSpecifier" - } ] - } - }, - "asTypeSpecifier" : { - "localId" : "153", - "locator" : "73:77-73:84", - "resultTypeName" : "{http://hl7.org/fhir}Quantity", - "name" : "{http://hl7.org/fhir}Quantity", - "type" : "NamedTypeSpecifier" - } + "value" : [ ",\n " ] + }, { + "s" : [ { + "value" : [ "Target",": " ] + }, { + "r" : "2542", + "s" : [ { + "value" : [ "if " ] + }, { + "r" : "2550", + "s" : [ { + "r" : "2544", + "s" : [ { + "r" : "2543", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2544", + "s" : [ { + "value" : [ "target" ] + } ] + } ] + }, { + "value" : [ " is not null" ] } ] }, { - "localId" : "161", - "locator" : "74:21-74:61", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "name" : "RangeText", - "libraryName" : "DE", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "160", - "locator" : "74:34-74:60", - "resultTypeName" : "{http://hl7.org/fhir}Range", - "strict" : false, - "type" : "As", - "operand" : { - "localId" : "158", - "locator" : "74:34-74:46", - "path" : "detail", - "scope" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ChoiceTypeSpecifier", - "choice" : [ { - "name" : "{http://hl7.org/fhir}Quantity", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}Range", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}CodeableConcept", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}string", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}boolean", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}integer", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}Ratio", - "type" : "NamedTypeSpecifier" - } ] - } - }, - "asTypeSpecifier" : { - "localId" : "159", - "locator" : "74:51-74:60", - "resultTypeName" : "{http://hl7.org/fhir}Range", - "name" : "{http://hl7.org/fhir}Range", - "type" : "NamedTypeSpecifier" - } + "value" : [ " then " ] + }, { + "r" : "2552", + "s" : [ { + "value" : [ "ReportGoalTargets","(" ] + }, { + "r" : "2551", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ ")" ] } ] }, { - "localId" : "167", - "locator" : "75:21-75:68", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "name" : "ConceptText", - "libraryName" : "DE", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "166", - "locator" : "75:36-75:67", - "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", - "strict" : false, - "type" : "As", - "operand" : { - "localId" : "164", - "locator" : "75:36-75:48", - "path" : "detail", - "scope" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ChoiceTypeSpecifier", - "choice" : [ { - "name" : "{http://hl7.org/fhir}Quantity", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}Range", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}CodeableConcept", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}string", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}boolean", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}integer", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}Ratio", - "type" : "NamedTypeSpecifier" - } ] - } - }, - "asTypeSpecifier" : { - "localId" : "165", - "locator" : "75:53-75:67", - "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", - "name" : "{http://hl7.org/fhir}CodeableConcept", - "type" : "NamedTypeSpecifier" - } + "r" : "2597", + "value" : [ " else ","null" ] + } ] + } ] + }, { + "value" : [ ",\n " ] + }, { + "s" : [ { + "value" : [ "Addresses",": " ] + }, { + "r" : "2687", + "s" : [ { + "value" : [ "if " ] + }, { + "r" : "2695", + "s" : [ { + "r" : "2689", + "s" : [ { + "r" : "2688", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2689", + "s" : [ { + "value" : [ "addresses" ] + } ] + } ] + }, { + "value" : [ " is not null" ] } ] }, { - "localId" : "172", - "locator" : "76:21-76:56", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "path" : "value", - "type" : "Property", - "source" : { - "localId" : "171", - "locator" : "76:21-76:50", - "resultTypeName" : "{http://hl7.org/fhir}string", - "strict" : false, - "type" : "As", - "operand" : { - "localId" : "169", - "locator" : "76:22-76:34", - "path" : "detail", - "scope" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ChoiceTypeSpecifier", - "choice" : [ { - "name" : "{http://hl7.org/fhir}Quantity", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}Range", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}CodeableConcept", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}string", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}boolean", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}integer", - "type" : "NamedTypeSpecifier" - }, { - "name" : "{http://hl7.org/fhir}Ratio", - "type" : "NamedTypeSpecifier" + "value" : [ " then " ] + }, { + "r" : "2701", + "s" : [ { + "r" : "2696", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2701", + "s" : [ { + "value" : [ "DataElements","(" ] + }, { + "r" : "2698", + "s" : [ { + "value" : [ "AddressesResources","(" ] + }, { + "r" : "2697", + "s" : [ { + "value" : [ "goal" ] } ] - } - }, - "asTypeSpecifier" : { - "localId" : "170", - "locator" : "76:39-76:49", - "resultTypeName" : "{http://hl7.org/fhir}string", - "name" : "{http://hl7.org/fhir}string", - "type" : "NamedTypeSpecifier" - } - } + }, { + "value" : [ ")" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + }, { + "r" : "2710", + "value" : [ " else ","null" ] } ] - } + } ] }, { - "name" : "LastResult", - "value" : { - "localId" : "179", - "locator" : "77:19-77:80", - "name" : "ReportMostRecentResult", - "libraryName" : "DE", - "type" : "FunctionRef", - "resultTypeSpecifier" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ ",\n " ] + }, { + "s" : [ { + "value" : [ "LifecycleStatus",": " ] + }, { + "r" : "2721", + "s" : [ { + "value" : [ "LifecycleStatusText","(" ] + }, { + "r" : "2720", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + }, { + "value" : [ ",\n " ] + }, { + "s" : [ { + "value" : [ "AchievementStatus",": " ] + }, { + "r" : "2725", + "s" : [ { + "r" : "2722", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2725", + "s" : [ { + "value" : [ "ConceptText","(" ] }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "r" : "2724", + "s" : [ { + "r" : "2723", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2724", + "s" : [ { + "value" : [ "achievementStatus" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } ] + }, { + "value" : [ ",\n " ] + }, { + "s" : [ { + "value" : [ "Notes",": " ] + }, { + "r" : "2733", + "s" : [ { + "r" : "2726", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2733", + "s" : [ { + "value" : [ "ToString","(" ] }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "r" : "2728", + "s" : [ { + "r" : "2727", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2728", + "s" : [ { + "value" : [ "note" ] + } ] + } ] }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ ")" ] + } ] + } ] + } ] + }, { + "value" : [ ",\n " ] + }, { + "s" : [ { + "value" : [ "Provenance",": " ] + }, { + "r" : "2740", + "s" : [ { + "r" : "2738", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2740", + "s" : [ { + "value" : [ "ReportProvenance","(" ] }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } + "r" : "2739", + "s" : [ { + "value" : [ "goal" ] + } ] }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ ")" ] + } ] + } ] + } ] + }, { + "value" : [ ",\n " ] + }, { + "s" : [ { + "value" : [ "LearnMore",": " ] + }, { + "r" : "2767", + "s" : [ { + "r" : "2757", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2767", + "s" : [ { + "value" : [ "LearnMoreURL","(" ] }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "r" : "2766", + "s" : [ { + "r" : "2758", + "s" : [ { + "r" : "2760", + "s" : [ { + "r" : "2759", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2760", + "s" : [ { + "value" : [ "target" ] + } ] + } ] + }, { + "r" : "2765", + "value" : [ "[","0","]" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "2766", + "s" : [ { + "value" : [ "measure" ] + } ] + } ] }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ ")" ] + } ] + } ] + } ] + }, { + "value" : [ ",\n " ] + }, { + "s" : [ { + "value" : [ "Overdue",": " ] + }, { + "r" : "2773", + "s" : [ { + "r" : "2769", + "s" : [ { + "value" : [ "DueDate","(" ] }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } + "r" : "2768", + "s" : [ { + "value" : [ "goal" ] + } ] }, { - "name" : "Performer", + "value" : [ ")" ] + } ] + }, { + "r" : "2773", + "value" : [ " ","before"," " ] + }, { + "r" : "2772", + "s" : [ { + "value" : [ "Today","()" ] + } ] + } ] + } ] + }, { + "value" : [ "\n }" ] + } ] + } ] + } ] + } + } ], + "resultTypeSpecifier" : { + "localId" : "2932", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2933", + "name" : "Category", + "elementType" : { + "localId" : "2934", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2935", + "name" : "Description", + "elementType" : { + "localId" : "2936", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2937", + "name" : "ExpressedBy", + "elementType" : { + "localId" : "2938", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2939", + "name" : "StartDate", + "elementType" : { + "localId" : "2940", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2941", + "name" : "Target", + "elementType" : { + "localId" : "2942", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2943", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2944", + "name" : "DueDate", + "elementType" : { + "localId" : "2945", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2946", + "name" : "DisplayName", + "elementType" : { + "localId" : "2947", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2948", + "name" : "TargetValue", + "elementType" : { + "localId" : "2949", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2950", + "name" : "LastResult", + "elementType" : { + "localId" : "2951", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2952", + "name" : "DisplayName", + "elementType" : { + "localId" : "2953", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2954", + "name" : "ConceptName", + "elementType" : { + "localId" : "2955", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2956", + "name" : "Date", + "elementType" : { + "localId" : "2957", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2958", + "name" : "ResultText", + "elementType" : { + "localId" : "2959", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2960", + "name" : "ResultValue", + "elementType" : { + "localId" : "2961", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2962", + "name" : "ResultUnits", + "elementType" : { + "localId" : "2963", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2964", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "2965", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2966", + "name" : "Interpretation", + "elementType" : { + "localId" : "2967", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2968", + "name" : "Flag", + "elementType" : { + "localId" : "2969", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2970", + "name" : "Performer", + "elementType" : { + "localId" : "2971", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2972", + "name" : "Notes", + "elementType" : { + "localId" : "2973", + "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2974", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Provenance", + } + }, { + "localId" : "2975", + "name" : "Provenance", + "elementType" : { + "localId" : "2976", + "type" : "ListTypeSpecifier", "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", + "localId" : "2977", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2978", + "name" : "Transmitter", + "elementType" : { + "localId" : "2979", + "type" : "ListTypeSpecifier", "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "localId" : "2980", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } - }, { - "name" : "Author", + } + }, { + "localId" : "2981", + "name" : "Author", + "elementType" : { + "localId" : "2982", + "type" : "ListTypeSpecifier", "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "localId" : "2983", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } - } ] - } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } ] - }, - "operand" : [ { - "localId" : "178", - "locator" : "77:45-77:79", - "name" : "FindObservations", - "libraryName" : "DE", - "type" : "FunctionRef", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Observation", - "type" : "NamedTypeSpecifier" + } + } ] } - }, - "operand" : [ { - "localId" : "177", - "locator" : "77:65-77:78", - "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", - "path" : "measure", - "scope" : "target", - "type" : "Property" - } ] + } + }, { + "localId" : "2984", + "name" : "LearnMore", + "elementType" : { + "localId" : "2985", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } } ] } } ] } } - } - }, - "operand" : [ { - "name" : "goal", - "operandTypeSpecifier" : { - "localId" : "53", - "locator" : "58:40-58:43", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "{http://hl7.org/fhir}Goal", - "type" : "NamedTypeSpecifier" - } - } ] - }, { - "localId" : "215", - "locator" : "115:1-117:22", - "name" : "CastToResources", - "context" : "Patient", - "accessLevel" : "Public", - "type" : "FunctionDef", - "annotation" : [ { - "type" : "Annotation", - "s" : { - "r" : "215", - "s" : [ { - "value" : [ "// Takes a list of Condition, Observation, ServiceRequest, etc. and cast to List\n// to enable union into generalized List\n// Otherwise, union returns, e.g. list>)\n","define function ","CastToResources","(","items"," " ] - }, { - "r" : "207", - "s" : [ { - "value" : [ "List<" ] - }, { - "r" : "206", - "s" : [ { - "value" : [ "Resource" ] - } ] - }, { - "value" : [ ">" ] - } ] - }, { - "value" : [ "):\n " ] - }, { - "r" : "214", - "s" : [ { - "r" : "214", - "s" : [ { - "s" : [ { - "r" : "209", - "s" : [ { - "r" : "208", - "s" : [ { - "s" : [ { - "value" : [ "items" ] - } ] - } ] - }, { - "value" : [ " ","r" ] - } ] - } ] - }, { - "value" : [ "\n " ] - }, { - "r" : "213", - "s" : [ { - "value" : [ "return " ] - }, { - "r" : "212", - "s" : [ { - "r" : "210", - "s" : [ { - "value" : [ "r" ] - } ] - }, { - "value" : [ " as " ] - }, { - "r" : "211", - "s" : [ { - "value" : [ "Resource" ] - } ] - } ] - } ] + }, { + "localId" : "2986", + "name" : "Addresses", + "elementType" : { + "localId" : "2987", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2988", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2989", + "name" : "DisplayName", + "elementType" : { + "localId" : "2990", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } } ] - } ] - } ] - } - } ], - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Resource", - "type" : "NamedTypeSpecifier" - } - }, - "expression" : { - "localId" : "214", - "locator" : "116:2-117:22", - "type" : "Query", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", + } + } + }, { + "localId" : "2991", + "name" : "LifecycleStatus", "elementType" : { - "name" : "{http://hl7.org/fhir}Resource", + "localId" : "2992", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, - "source" : [ { - "localId" : "209", - "locator" : "116:2-116:8", - "alias" : "r", - "resultTypeSpecifier" : { + }, { + "localId" : "2993", + "name" : "AchievementStatus", + "elementType" : { + "localId" : "2994", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2995", + "name" : "Notes", + "elementType" : { + "localId" : "2996", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{http://hl7.org/fhir}Resource", + "localId" : "2997", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, - "expression" : { - "localId" : "208", - "locator" : "116:2-116:6", - "name" : "items", - "type" : "OperandRef", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Resource", - "type" : "NamedTypeSpecifier" - } - } } - } ], - "relationship" : [ ], - "return" : { - "localId" : "213", - "locator" : "117:3-117:22", - "resultTypeSpecifier" : { + }, { + "localId" : "2998", + "name" : "Provenance", + "elementType" : { + "localId" : "2999", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{http://hl7.org/fhir}Resource", + "localId" : "3000", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3001", + "name" : "Transmitter", + "elementType" : { + "localId" : "3002", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3003", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "3004", + "name" : "Author", + "elementType" : { + "localId" : "3005", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3006", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] + } + } + }, { + "localId" : "3007", + "name" : "LearnMore", + "elementType" : { + "localId" : "3008", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3009", + "name" : "Overdue", + "elementType" : { + "localId" : "3010", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + } ] + }, + "expression" : { + "localId" : "2508", + "locator" : "47:3-60:3", + "type" : "Tuple", + "resultTypeSpecifier" : { + "localId" : "2853", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2854", + "name" : "Category", + "elementType" : { + "localId" : "2855", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, - "expression" : { - "localId" : "212", - "locator" : "117:10-117:22", - "resultTypeName" : "{http://hl7.org/fhir}Resource", - "strict" : false, - "type" : "As", - "operand" : { - "localId" : "210", - "locator" : "117:10", - "resultTypeName" : "{http://hl7.org/fhir}Resource", - "name" : "r", - "type" : "AliasRef" - }, - "asTypeSpecifier" : { - "localId" : "211", - "locator" : "117:15-117:22", - "resultTypeName" : "{http://hl7.org/fhir}Resource", - "name" : "{http://hl7.org/fhir}Resource", + }, { + "localId" : "2856", + "name" : "Description", + "elementType" : { + "localId" : "2857", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - } - } - }, - "operand" : [ { - "name" : "items", - "operandTypeSpecifier" : { - "localId" : "207", - "locator" : "115:39-115:52", - "type" : "ListTypeSpecifier", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", + }, { + "localId" : "2858", + "name" : "ExpressedBy", "elementType" : { - "name" : "{http://hl7.org/fhir}Resource", + "localId" : "2859", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, - "elementType" : { - "localId" : "206", - "locator" : "115:44-115:51", - "resultTypeName" : "{http://hl7.org/fhir}Resource", - "name" : "{http://hl7.org/fhir}Resource", - "type" : "NamedTypeSpecifier" - } - } - } ] - }, { - "localId" : "232", - "locator" : "106:1-110:3", - "name" : "AddressesResources", - "context" : "Patient", - "accessLevel" : "Public", - "type" : "FunctionDef", - "annotation" : [ { - "type" : "Annotation", - "s" : { - "r" : "232", - "s" : [ { - "value" : [ "// Returns a list of Resources that this Goal addresses\n","define function ","AddressesResources","(","goal"," " ] }, { - "r" : "193", - "s" : [ { - "value" : [ "Goal" ] - } ] - }, { - "value" : [ "):\n " ] + "localId" : "2860", + "name" : "StartDate", + "elementType" : { + "localId" : "2861", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "231", - "s" : [ { - "r" : "231", - "s" : [ { - "value" : [ "flatten" ] - }, { - "r" : "230", - "s" : [ { - "value" : [ "(" ] + "localId" : "2862", + "name" : "Target", + "elementType" : { + "localId" : "2863", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2864", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2865", + "name" : "DueDate", + "elementType" : { + "localId" : "2866", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "230", - "s" : [ { - "s" : [ { - "r" : "195", - "s" : [ { - "r" : "194", - "s" : [ { - "s" : [ { - "value" : [ "goal",".","addresses" ] - } ] - } ] - }, { - "value" : [ " ","GA" ] - } ] - } ] - }, { - "value" : [ "\n " ] - }, { - "r" : "229", - "s" : [ { - "value" : [ "return " ] - }, { - "r" : "228", - "s" : [ { - "r" : "216", - "s" : [ { - "value" : [ "CastToResources","(" ] - }, { - "r" : "205", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "205", - "s" : [ { - "s" : [ { - "r" : "197", - "s" : [ { - "r" : "196", - "s" : [ { - "r" : "196", - "s" : [ { - "value" : [ "[","Condition","]" ] - } ] - } ] - }, { - "value" : [ " ","C" ] - } ] - } ] - }, { - "value" : [ " " ] - }, { - "r" : "204", - "s" : [ { - "value" : [ "where " ] - }, { - "r" : "204", - "s" : [ { - "r" : "199", - "s" : [ { - "r" : "198", - "s" : [ { - "value" : [ "C" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "199", - "s" : [ { - "value" : [ "id" ] - } ] - } ] - }, { - "value" : [ " ","="," " ] - }, { - "r" : "203", - "s" : [ { - "r" : "200", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "203", - "s" : [ { - "value" : [ "GetId","(" ] - }, { - "r" : "202", - "s" : [ { - "r" : "201", - "s" : [ { - "value" : [ "GA" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "202", - "s" : [ { - "value" : [ "reference" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - } ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - }, { - "value" : [ ")" ] - } ] - }, { - "value" : [ "\n union " ] - }, { - "r" : "227", - "s" : [ { - "value" : [ "CastToResources","(" ] - }, { - "r" : "226", - "s" : [ { - "value" : [ "(" ] - }, { - "r" : "226", - "s" : [ { - "s" : [ { - "r" : "218", - "s" : [ { - "r" : "217", - "s" : [ { - "r" : "217", - "s" : [ { - "value" : [ "[","Observation","]" ] - } ] - } ] - }, { - "value" : [ " ","C" ] - } ] - } ] - }, { - "value" : [ " " ] - }, { - "r" : "225", - "s" : [ { - "value" : [ "where " ] - }, { - "r" : "225", - "s" : [ { - "r" : "220", - "s" : [ { - "r" : "219", - "s" : [ { - "value" : [ "C" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "220", - "s" : [ { - "value" : [ "id" ] - } ] - } ] - }, { - "value" : [ " ","="," " ] - }, { - "r" : "224", - "s" : [ { - "r" : "221", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "224", - "s" : [ { - "value" : [ "GetId","(" ] - }, { - "r" : "223", - "s" : [ { - "r" : "222", - "s" : [ { - "value" : [ "GA" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "223", - "s" : [ { - "value" : [ "reference" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - } ] - } ] - } ] + "localId" : "2867", + "name" : "DisplayName", + "elementType" : { + "localId" : "2868", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2869", + "name" : "TargetValue", + "elementType" : { + "localId" : "2870", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2871", + "name" : "LastResult", + "elementType" : { + "localId" : "2872", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2873", + "name" : "DisplayName", + "elementType" : { + "localId" : "2874", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2875", + "name" : "ConceptName", + "elementType" : { + "localId" : "2876", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2877", + "name" : "Date", + "elementType" : { + "localId" : "2878", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2879", + "name" : "ResultText", + "elementType" : { + "localId" : "2880", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2881", + "name" : "ResultValue", + "elementType" : { + "localId" : "2882", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2883", + "name" : "ResultUnits", + "elementType" : { + "localId" : "2884", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2885", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "2886", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2887", + "name" : "Interpretation", + "elementType" : { + "localId" : "2888", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2889", + "name" : "Flag", + "elementType" : { + "localId" : "2890", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2891", + "name" : "Performer", + "elementType" : { + "localId" : "2892", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2893", + "name" : "Notes", + "elementType" : { + "localId" : "2894", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2895", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "2896", + "name" : "Provenance", + "elementType" : { + "localId" : "2897", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2898", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2899", + "name" : "Transmitter", + "elementType" : { + "localId" : "2900", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2901", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } }, { - "value" : [ ")" ] + "localId" : "2902", + "name" : "Author", + "elementType" : { + "localId" : "2903", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2904", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } } ] - }, { - "value" : [ ")" ] - } ] - } ] + } + } + }, { + "localId" : "2905", + "name" : "LearnMore", + "elementType" : { + "localId" : "2906", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } } ] - } ] - }, { - "value" : [ "\n )" ] + } } ] - } ] - } ] - } ] - } - } ], - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Resource", - "type" : "NamedTypeSpecifier" - } - }, - "expression" : { - "localId" : "231", - "locator" : "107:3-110:3", - "type" : "Flatten", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Resource", - "type" : "NamedTypeSpecifier" - } - }, - "operand" : { - "localId" : "230", - "locator" : "107:10-110:3", - "type" : "Query", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", + } + } + }, { + "localId" : "2907", + "name" : "Addresses", "elementType" : { + "localId" : "2908", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{http://hl7.org/fhir}Resource", - "type" : "NamedTypeSpecifier" + "localId" : "2909", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2910", + "name" : "DisplayName", + "elementType" : { + "localId" : "2911", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } ] } } - }, - "source" : [ { - "localId" : "195", - "locator" : "107:11-107:27", - "alias" : "GA", - "resultTypeSpecifier" : { + }, { + "localId" : "2912", + "name" : "LifecycleStatus", + "elementType" : { + "localId" : "2913", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2914", + "name" : "AchievementStatus", + "elementType" : { + "localId" : "2915", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2916", + "name" : "Notes", + "elementType" : { + "localId" : "2917", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{http://hl7.org/fhir}Reference", + "localId" : "2918", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, - "expression" : { - "localId" : "194", - "locator" : "107:11-107:24", - "path" : "addresses", + } + }, { + "localId" : "2919", + "name" : "Provenance", + "elementType" : { + "localId" : "2920", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2921", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2922", + "name" : "Transmitter", + "elementType" : { + "localId" : "2923", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2924", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "2925", + "name" : "Author", + "elementType" : { + "localId" : "2926", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2927", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] + } + } + }, { + "localId" : "2928", + "name" : "LearnMore", + "elementType" : { + "localId" : "2929", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2930", + "name" : "Overdue", + "elementType" : { + "localId" : "2931", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + } ] + }, + "element" : [ { + "name" : "Category", + "value" : { + "localId" : "2518", + "locator" : "48:15-48:46", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "name" : "ConceptText", + "libraryName" : "DE", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "2510", + "locator" : "48:30-48:45", + "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", + "type" : "Indexer", + "signature" : [ ], + "operand" : [ { + "localId" : "2512", + "locator" : "48:30-48:42", + "path" : "category", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "2515", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2516", + "name" : "{http://hl7.org/fhir}CodeableConcept", + "type" : "NamedTypeSpecifier" + } + }, + "source" : { + "localId" : "2511", + "locator" : "48:30-48:33", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } + }, { + "localId" : "2517", + "locator" : "48:44", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "0", + "type" : "Literal" + } ] + } ] + } + }, { + "name" : "Description", + "value" : { + "localId" : "2522", + "locator" : "49:18-49:49", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "name" : "ConceptText", + "libraryName" : "DE", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "2521", + "locator" : "49:33-49:48", + "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", + "path" : "description", "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Reference", - "type" : "NamedTypeSpecifier" - } - }, "source" : { + "localId" : "2520", + "locator" : "49:33-49:36", + "resultTypeName" : "{http://hl7.org/fhir}Goal", "name" : "goal", "type" : "OperandRef" } + } ] + } + }, { + "name" : "ExpressedBy", + "value" : { + "localId" : "2526", + "locator" : "50:18-50:47", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "path" : "value", + "type" : "Property", + "source" : { + "localId" : "2525", + "locator" : "50:18-50:41", + "resultTypeName" : "{http://hl7.org/fhir}string", + "path" : "display", + "type" : "Property", + "source" : { + "localId" : "2524", + "locator" : "50:18-50:33", + "resultTypeName" : "{http://hl7.org/fhir}Reference", + "path" : "expressedBy", + "type" : "Property", + "source" : { + "localId" : "2523", + "locator" : "50:18-50:21", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } + } } - } ], - "relationship" : [ ], - "return" : { - "localId" : "229", - "locator" : "108:5-109:82", + } + }, { + "name" : "StartDate", + "value" : { + "localId" : "2539", + "locator" : "51:16-51:35", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "type" : "ToString", + "signature" : [ ], + "operand" : { + "localId" : "2541", + "name" : "ToDate", + "libraryName" : "FHIRHelpers", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "2540", + "asType" : "{http://hl7.org/fhir}date", + "type" : "As", + "signature" : [ ], + "operand" : { + "localId" : "2528", + "locator" : "51:25-51:34", + "path" : "start", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "2532", + "type" : "ChoiceTypeSpecifier", + "type" : [ ], + "choice" : [ { + "localId" : "2533", + "name" : "{http://hl7.org/fhir}date", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "2534", + "name" : "{http://hl7.org/fhir}CodeableConcept", + "type" : "NamedTypeSpecifier" + } ] + }, + "source" : { + "localId" : "2527", + "locator" : "51:25-51:28", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } + } + } ] + } + } + }, { + "name" : "Target", + "value" : { + "localId" : "2542", + "locator" : "52:13-52:77", + "type" : "If", "resultTypeSpecifier" : { + "localId" : "2643", "type" : "ListTypeSpecifier", "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Resource", - "type" : "NamedTypeSpecifier" - } - } - }, - "expression" : { - "localId" : "228", - "locator" : "108:12-109:82", - "type" : "Union", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Resource", - "type" : "NamedTypeSpecifier" - } - }, - "operand" : [ { - "localId" : "216", - "locator" : "108:12-108:79", - "name" : "CastToResources", - "type" : "FunctionRef", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", + "localId" : "2644", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2645", + "name" : "DueDate", "elementType" : { - "name" : "{http://hl7.org/fhir}Resource", + "localId" : "2646", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, - "operand" : [ { - "localId" : "205", - "locator" : "108:28-108:78", - "type" : "Query", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Condition", - "type" : "NamedTypeSpecifier" - } - }, - "source" : [ { - "localId" : "197", - "locator" : "108:29-108:41", - "alias" : "C", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", + }, { + "localId" : "2647", + "name" : "DisplayName", + "elementType" : { + "localId" : "2648", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2649", + "name" : "TargetValue", + "elementType" : { + "localId" : "2650", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2651", + "name" : "LastResult", + "elementType" : { + "localId" : "2652", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2653", + "name" : "DisplayName", "elementType" : { - "name" : "{http://hl7.org/fhir}Condition", + "localId" : "2654", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, - "expression" : { - "localId" : "196", - "locator" : "108:29-108:39", - "dataType" : "{http://hl7.org/fhir}Condition", - "templateId" : "http://hl7.org/fhir/StructureDefinition/Condition", - "type" : "Retrieve", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Condition", - "type" : "NamedTypeSpecifier" - } + }, { + "localId" : "2655", + "name" : "ConceptName", + "elementType" : { + "localId" : "2656", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } - } - } ], - "relationship" : [ ], - "where" : { - "localId" : "204", - "locator" : "108:43-108:77", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "Equal", - "operand" : [ { - "name" : "ToString", - "libraryName" : "FHIRHelpers", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "199", - "locator" : "108:49-108:52", - "resultTypeName" : "{http://hl7.org/fhir}id", - "path" : "id", - "scope" : "C", - "type" : "Property" - } ] }, { - "localId" : "203", - "locator" : "108:56-108:77", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "name" : "GetId", - "libraryName" : "DE", - "type" : "FunctionRef", - "operand" : [ { - "name" : "ToString", - "libraryName" : "FHIRHelpers", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "202", - "locator" : "108:65-108:76", - "resultTypeName" : "{http://hl7.org/fhir}string", - "path" : "reference", - "scope" : "GA", - "type" : "Property" - } ] - } ] - } ] - } - } ] - }, { - "localId" : "227", - "locator" : "109:13-109:82", - "name" : "CastToResources", - "type" : "FunctionRef", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Resource", - "type" : "NamedTypeSpecifier" - } - }, - "operand" : [ { - "localId" : "226", - "locator" : "109:29-109:81", - "type" : "Query", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Observation", - "type" : "NamedTypeSpecifier" - } - }, - "source" : [ { - "localId" : "218", - "locator" : "109:30-109:44", - "alias" : "C", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", + "localId" : "2657", + "name" : "Date", "elementType" : { - "name" : "{http://hl7.org/fhir}Observation", + "localId" : "2658", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2659", + "name" : "ResultText", + "elementType" : { + "localId" : "2660", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2661", + "name" : "ResultValue", + "elementType" : { + "localId" : "2662", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2663", + "name" : "ResultUnits", + "elementType" : { + "localId" : "2664", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2665", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "2666", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2667", + "name" : "Interpretation", + "elementType" : { + "localId" : "2668", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2669", + "name" : "Flag", + "elementType" : { + "localId" : "2670", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2671", + "name" : "Performer", + "elementType" : { + "localId" : "2672", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, - "expression" : { - "localId" : "217", - "locator" : "109:30-109:42", - "dataType" : "{http://hl7.org/fhir}Observation", - "templateId" : "http://hl7.org/fhir/StructureDefinition/Observation", - "type" : "Retrieve", - "resultTypeSpecifier" : { + }, { + "localId" : "2673", + "name" : "Notes", + "elementType" : { + "localId" : "2674", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{http://hl7.org/fhir}Observation", + "localId" : "2675", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } - } - } ], - "relationship" : [ ], - "where" : { - "localId" : "225", - "locator" : "109:46-109:80", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "Equal", - "operand" : [ { - "name" : "ToString", - "libraryName" : "FHIRHelpers", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "220", - "locator" : "109:52-109:55", - "resultTypeName" : "{http://hl7.org/fhir}id", - "path" : "id", - "scope" : "C", - "type" : "Property" - } ] - }, { - "localId" : "224", - "locator" : "109:59-109:80", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "name" : "GetId", - "libraryName" : "DE", - "type" : "FunctionRef", - "operand" : [ { - "name" : "ToString", - "libraryName" : "FHIRHelpers", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "223", - "locator" : "109:68-109:79", - "resultTypeName" : "{http://hl7.org/fhir}string", - "path" : "reference", - "scope" : "GA", - "type" : "Property" - } ] - } ] - } ] - } - } ] - } ] - } - } - } - }, - "operand" : [ { - "name" : "goal", - "operandTypeSpecifier" : { - "localId" : "193", - "locator" : "106:41-106:44", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "{http://hl7.org/fhir}Goal", - "type" : "NamedTypeSpecifier" - } - } ] - }, { - "localId" : "256", - "locator" : "44:1-56:3", - "name" : "ReportGoal", - "context" : "Patient", - "accessLevel" : "Public", - "type" : "FunctionDef", - "annotation" : [ { - "type" : "Annotation", - "s" : { - "r" : "256", - "s" : [ { - "value" : [ "","define function ","ReportGoal","(","goal"," " ] - }, { - "r" : "31", - "s" : [ { - "value" : [ "Goal" ] - } ] - }, { - "value" : [ "):\n " ] - }, { - "r" : "255", - "s" : [ { - "r" : "255", - "s" : [ { - "value" : [ "{\n " ] - }, { - "s" : [ { - "value" : [ "Category",": " ] - }, { - "r" : "37", - "s" : [ { - "r" : "32", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "37", - "s" : [ { - "value" : [ "ConceptText","(" ] }, { - "r" : "36", - "s" : [ { - "r" : "34", - "s" : [ { - "r" : "33", - "s" : [ { - "value" : [ "goal" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "34", - "s" : [ { - "value" : [ "category" ] + "localId" : "2676", + "name" : "Provenance", + "elementType" : { + "localId" : "2677", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2678", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2679", + "name" : "Transmitter", + "elementType" : { + "localId" : "2680", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2681", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "2682", + "name" : "Author", + "elementType" : { + "localId" : "2683", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2684", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } } ] - } ] - }, { - "r" : "35", - "value" : [ "[","0","]" ] - } ] + } + } }, { - "value" : [ ")" ] + "localId" : "2685", + "name" : "LearnMore", + "elementType" : { + "localId" : "2686", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } } ] - } ] + } } ] - }, { - "value" : [ ", // TODO: array of categories\n " ] - }, { - "s" : [ { - "value" : [ "Description",": " ] - }, { - "r" : "41", - "s" : [ { - "r" : "38", - "s" : [ { - "value" : [ "DE" ] - } ] + } + }, + "condition" : { + "localId" : "2550", + "locator" : "52:16-52:38", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Not", + "signature" : [ ], + "operand" : { + "localId" : "2549", + "locator" : "52:16-52:38", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "IsNull", + "signature" : [ ], + "operand" : { + "localId" : "2544", + "locator" : "52:16-52:26", + "path" : "target", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "2547", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2548", + "name" : "{http://hl7.org/fhir}Goal.Target", + "type" : "NamedTypeSpecifier" + } + }, + "source" : { + "localId" : "2543", + "locator" : "52:16-52:19", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } + } + } + }, + "then" : { + "localId" : "2552", + "locator" : "52:45-52:67", + "name" : "ReportGoalTargets", + "type" : "FunctionRef", + "resultTypeSpecifier" : { + "localId" : "2553", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2554", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2555", + "name" : "DueDate", + "elementType" : { + "localId" : "2556", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "value" : [ "." ] + "localId" : "2557", + "name" : "DisplayName", + "elementType" : { + "localId" : "2558", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "41", - "s" : [ { - "value" : [ "ConceptText","(" ] - }, { - "r" : "40", - "s" : [ { - "r" : "39", - "s" : [ { - "value" : [ "goal" ] - } ] + "localId" : "2559", + "name" : "TargetValue", + "elementType" : { + "localId" : "2560", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2561", + "name" : "LastResult", + "elementType" : { + "localId" : "2562", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2563", + "name" : "DisplayName", + "elementType" : { + "localId" : "2564", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2565", + "name" : "ConceptName", + "elementType" : { + "localId" : "2566", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2567", + "name" : "Date", + "elementType" : { + "localId" : "2568", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2569", + "name" : "ResultText", + "elementType" : { + "localId" : "2570", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2571", + "name" : "ResultValue", + "elementType" : { + "localId" : "2572", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2573", + "name" : "ResultUnits", + "elementType" : { + "localId" : "2574", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2575", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "2576", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2577", + "name" : "Interpretation", + "elementType" : { + "localId" : "2578", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "value" : [ "." ] + "localId" : "2579", + "name" : "Flag", + "elementType" : { + "localId" : "2580", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "40", - "s" : [ { - "value" : [ "description" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - } ] - }, { - "value" : [ ",\n " ] - }, { - "s" : [ { - "value" : [ "ExpressedBy",": " ] - }, { - "r" : "45", - "s" : [ { - "r" : "44", - "s" : [ { - "r" : "43", - "s" : [ { - "r" : "42", - "s" : [ { - "value" : [ "goal" ] - } ] + "localId" : "2581", + "name" : "Performer", + "elementType" : { + "localId" : "2582", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "value" : [ "." ] + "localId" : "2583", + "name" : "Notes", + "elementType" : { + "localId" : "2584", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2585", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } }, { - "r" : "43", - "s" : [ { - "value" : [ "expressedBy" ] - } ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "44", - "s" : [ { - "value" : [ "display" ] + "localId" : "2586", + "name" : "Provenance", + "elementType" : { + "localId" : "2587", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2588", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2589", + "name" : "Transmitter", + "elementType" : { + "localId" : "2590", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2591", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "2592", + "name" : "Author", + "elementType" : { + "localId" : "2593", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2594", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] + } + } + }, { + "localId" : "2595", + "name" : "LearnMore", + "elementType" : { + "localId" : "2596", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } } ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "45", - "s" : [ { - "value" : [ "value" ] - } ] + } } ] - } ] - }, { - "value" : [ ",\n " ] - }, { - "s" : [ { - "value" : [ "StartDate",": " ] - }, { - "r" : "48", - "s" : [ { - "value" : [ "ToString","(" ] + } + }, + "signature" : [ ], + "operand" : [ { + "localId" : "2551", + "locator" : "52:63-52:66", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } ] + }, + "else" : { + "localId" : "2598", + "type" : "As", + "signature" : [ ], + "operand" : { + "localId" : "2597", + "locator" : "52:74-52:77", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "type" : "Null" + }, + "asTypeSpecifier" : { + "localId" : "2599", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2600", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2601", + "name" : "DueDate", + "elementType" : { + "localId" : "2602", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "47", - "s" : [ { - "r" : "46", - "s" : [ { - "value" : [ "goal" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "47", - "s" : [ { - "value" : [ "start" ] - } ] - } ] + "localId" : "2603", + "name" : "DisplayName", + "elementType" : { + "localId" : "2604", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "value" : [ ")" ] - } ] - } ] - }, { - "value" : [ ",\n " ] - }, { - "s" : [ { - "value" : [ "Target",": " ] - }, { - "r" : "187", - "s" : [ { - "value" : [ "if " ] + "localId" : "2605", + "name" : "TargetValue", + "elementType" : { + "localId" : "2606", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "51", - "s" : [ { - "r" : "50", - "s" : [ { - "r" : "49", - "s" : [ { - "value" : [ "goal" ] - } ] + "localId" : "2607", + "name" : "LastResult", + "elementType" : { + "localId" : "2608", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2609", + "name" : "DisplayName", + "elementType" : { + "localId" : "2610", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "value" : [ "." ] + "localId" : "2611", + "name" : "ConceptName", + "elementType" : { + "localId" : "2612", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "50", - "s" : [ { - "value" : [ "target" ] - } ] - } ] - }, { - "value" : [ " is not null" ] - } ] - }, { - "value" : [ " then " ] - }, { - "r" : "185", - "s" : [ { - "value" : [ "ReportGoalTargets","(" ] - }, { - "r" : "52", - "s" : [ { - "value" : [ "goal" ] - } ] - }, { - "value" : [ ")" ] - } ] - }, { - "r" : "186", - "value" : [ " else ","null" ] - } ] - } ] - }, { - "value" : [ ",\n " ] - }, { - "s" : [ { - "value" : [ "Addresses",": " ] - }, { - "r" : "236", - "s" : [ { - "value" : [ "if " ] - }, { - "r" : "190", - "s" : [ { - "r" : "189", - "s" : [ { - "r" : "188", - "s" : [ { - "value" : [ "goal" ] - } ] + "localId" : "2613", + "name" : "Date", + "elementType" : { + "localId" : "2614", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "value" : [ "." ] + "localId" : "2615", + "name" : "ResultText", + "elementType" : { + "localId" : "2616", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "189", - "s" : [ { - "value" : [ "addresses" ] - } ] - } ] - }, { - "value" : [ " is not null" ] - } ] - }, { - "value" : [ " then " ] - }, { - "r" : "234", - "s" : [ { - "r" : "191", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "234", - "s" : [ { - "value" : [ "DataElements","(" ] + "localId" : "2617", + "name" : "ResultValue", + "elementType" : { + "localId" : "2618", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2619", + "name" : "ResultUnits", + "elementType" : { + "localId" : "2620", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2621", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "2622", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "233", - "s" : [ { - "value" : [ "AddressesResources","(" ] - }, { - "r" : "192", - "s" : [ { - "value" : [ "goal" ] - } ] - }, { - "value" : [ ")" ] - } ] + "localId" : "2623", + "name" : "Interpretation", + "elementType" : { + "localId" : "2624", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "value" : [ ")" ] - } ] - } ] - }, { - "r" : "235", - "value" : [ " else ","null" ] - } ] - } ] - }, { - "value" : [ ",\n " ] - }, { - "s" : [ { - "value" : [ "Notes",": " ] - }, { - "r" : "240", - "s" : [ { - "r" : "237", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "240", - "s" : [ { - "value" : [ "ToString","(" ] - }, { - "r" : "239", - "s" : [ { - "r" : "238", - "s" : [ { - "value" : [ "goal" ] - } ] + "localId" : "2625", + "name" : "Flag", + "elementType" : { + "localId" : "2626", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } }, { - "value" : [ "." ] + "localId" : "2627", + "name" : "Performer", + "elementType" : { + "localId" : "2628", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } }, { - "r" : "239", - "s" : [ { - "value" : [ "note" ] - } ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - } ] - }, { - "value" : [ ",\n " ] - }, { - "s" : [ { - "value" : [ "Provenance",": " ] - }, { - "r" : "243", - "s" : [ { - "r" : "241", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "243", - "s" : [ { - "value" : [ "ReportProvenance","(" ] - }, { - "r" : "242", - "s" : [ { - "value" : [ "goal" ] - } ] - }, { - "value" : [ ")" ] - } ] - } ] - } ] - }, { - "value" : [ ",\n " ] - }, { - "s" : [ { - "value" : [ "LearnMore",": " ] - }, { - "r" : "250", - "s" : [ { - "r" : "244", - "s" : [ { - "value" : [ "DE" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "250", - "s" : [ { - "value" : [ "LearnMoreURL","(" ] - }, { - "r" : "249", - "s" : [ { - "r" : "248", - "s" : [ { - "r" : "246", - "s" : [ { - "r" : "245", - "s" : [ { - "value" : [ "goal" ] - } ] - }, { - "value" : [ "." ] - }, { - "r" : "246", - "s" : [ { - "value" : [ "target" ] - } ] - } ] - }, { - "r" : "247", - "value" : [ "[","0","]" ] - } ] + "localId" : "2629", + "name" : "Notes", + "elementType" : { + "localId" : "2630", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2631", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } }, { - "value" : [ "." ] + "localId" : "2632", + "name" : "Provenance", + "elementType" : { + "localId" : "2633", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2634", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2635", + "name" : "Transmitter", + "elementType" : { + "localId" : "2636", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2637", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "2638", + "name" : "Author", + "elementType" : { + "localId" : "2639", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2640", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] + } + } }, { - "r" : "249", - "s" : [ { - "value" : [ "measure" ] - } ] + "localId" : "2641", + "name" : "LearnMore", + "elementType" : { + "localId" : "2642", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } } ] - }, { - "value" : [ ")" ] - } ] + } } ] + } + } + } + } + }, { + "name" : "Addresses", + "value" : { + "localId" : "2687", + "locator" : "53:16-53:101", + "type" : "If", + "resultTypeSpecifier" : { + "localId" : "2716", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2717", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2718", + "name" : "DisplayName", + "elementType" : { + "localId" : "2719", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } } ] - }, { - "value" : [ ",\n " ] - }, { - "s" : [ { - "value" : [ "Overdue",": " ] - }, { - "r" : "254", - "s" : [ { - "r" : "252", - "s" : [ { - "value" : [ "DueDate","(" ] - }, { - "r" : "251", - "s" : [ { - "value" : [ "goal" ] - } ] - }, { - "value" : [ ")" ] - } ] - }, { - "r" : "254", - "value" : [ " ","before"," " ] - }, { - "r" : "253", - "s" : [ { - "value" : [ "Today","()" ] - } ] + } + }, + "condition" : { + "localId" : "2695", + "locator" : "53:19-53:44", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Not", + "signature" : [ ], + "operand" : { + "localId" : "2694", + "locator" : "53:19-53:44", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "IsNull", + "signature" : [ ], + "operand" : { + "localId" : "2689", + "locator" : "53:19-53:32", + "path" : "addresses", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "2692", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2693", + "name" : "{http://hl7.org/fhir}Reference", + "type" : "NamedTypeSpecifier" + } + }, + "source" : { + "localId" : "2688", + "locator" : "53:19-53:22", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } + } + } + }, + "then" : { + "localId" : "2701", + "locator" : "53:51-53:91", + "name" : "DataElements", + "libraryName" : "DE", + "type" : "FunctionRef", + "resultTypeSpecifier" : { + "localId" : "2706", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2707", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2708", + "name" : "DisplayName", + "elementType" : { + "localId" : "2709", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } } ] + } + }, + "signature" : [ ], + "operand" : [ { + "localId" : "2698", + "locator" : "53:67-53:90", + "name" : "AddressesResources", + "type" : "FunctionRef", + "resultTypeSpecifier" : { + "localId" : "2699", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2700", + "name" : "{http://hl7.org/fhir}Resource", + "type" : "NamedTypeSpecifier" + } + }, + "signature" : [ ], + "operand" : [ { + "localId" : "2697", + "locator" : "53:86-53:89", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" } ] - }, { - "value" : [ "\n }" ] } ] - } ] - } ] - } - } ], - "resultTypeSpecifier" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Category", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Description", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" + }, + "else" : { + "localId" : "2711", + "type" : "As", + "signature" : [ ], + "operand" : { + "localId" : "2710", + "locator" : "53:98-53:101", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "type" : "Null" + }, + "asTypeSpecifier" : { + "localId" : "2712", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2713", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2714", + "name" : "DisplayName", + "elementType" : { + "localId" : "2715", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } ] + } + } + } } }, { - "name" : "ExpressedBy", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" + "name" : "LifecycleStatus", + "value" : { + "localId" : "2721", + "locator" : "54:22-54:46", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "name" : "LifecycleStatusText", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "2720", + "locator" : "54:42-54:45", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } ] } }, { - "name" : "StartDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" + "name" : "AchievementStatus", + "value" : { + "localId" : "2725", + "locator" : "55:24-55:61", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "name" : "ConceptText", + "libraryName" : "DE", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "2724", + "locator" : "55:39-55:60", + "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", + "path" : "achievementStatus", + "type" : "Property", + "source" : { + "localId" : "2723", + "locator" : "55:39-55:42", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } + } ] } }, { - "name" : "Target", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DueDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "TargetValue", + "name" : "Notes", + "value" : { + "localId" : "2733", + "locator" : "56:12-56:33", + "name" : "ToString", + "libraryName" : "DE", + "type" : "FunctionRef", + "resultTypeSpecifier" : { + "localId" : "2736", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2737", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, + "signature" : [ ], + "operand" : [ { + "localId" : "2728", + "locator" : "56:24-56:32", + "path" : "note", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "2731", + "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", + "localId" : "2732", + "name" : "{http://hl7.org/fhir}Annotation", "type" : "NamedTypeSpecifier" } - }, { - "name" : "LastResult", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", + }, + "source" : { + "localId" : "2727", + "locator" : "56:24-56:27", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } + } ] + } + }, { + "name" : "Provenance", + "value" : { + "localId" : "2740", + "locator" : "57:17-57:41", + "name" : "ReportProvenance", + "libraryName" : "DE", + "type" : "FunctionRef", + "resultTypeSpecifier" : { + "localId" : "2749", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "2750", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "2751", + "name" : "Transmitter", + "elementType" : { + "localId" : "2752", + "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2753", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, { - "name" : "ConceptName", + } + }, { + "localId" : "2754", + "name" : "Author", + "elementType" : { + "localId" : "2755", + "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2756", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, { - "name" : "Date", + } + } ] + } + }, + "signature" : [ ], + "operand" : [ { + "localId" : "2739", + "locator" : "57:37-57:40", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } ] + } + }, { + "name" : "LearnMore", + "value" : { + "localId" : "2767", + "locator" : "58:16-58:54", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "name" : "LearnMoreURL", + "libraryName" : "DE", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "2766", + "locator" : "58:32-58:53", + "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", + "path" : "measure", + "type" : "Property", + "source" : { + "localId" : "2758", + "locator" : "58:32-58:45", + "resultTypeName" : "{http://hl7.org/fhir}Goal.Target", + "type" : "Indexer", + "signature" : [ ], + "operand" : [ { + "localId" : "2760", + "locator" : "58:32-58:42", + "path" : "target", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "2763", + "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", + "localId" : "2764", + "name" : "{http://hl7.org/fhir}Goal.Target", "type" : "NamedTypeSpecifier" } + }, + "source" : { + "localId" : "2759", + "locator" : "58:32-58:35", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } + }, { + "localId" : "2765", + "locator" : "58:44", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "0", + "type" : "Literal" + } ] + } + } ] + } + }, { + "name" : "Overdue", + "value" : { + "localId" : "2773", + "locator" : "59:14-59:41", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Before", + "signature" : [ ], + "operand" : [ { + "localId" : "2769", + "locator" : "59:14-59:26", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", + "name" : "DueDate", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "2768", + "locator" : "59:22-59:25", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } ] + }, { + "localId" : "2772", + "locator" : "59:35-59:41", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", + "type" : "Today", + "signature" : [ ] + } ] + } + } ] + }, + "operand" : [ { + "localId" : "280", + "name" : "goal", + "operandTypeSpecifier" : { + "localId" : "279", + "locator" : "46:33-46:36", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "{http://hl7.org/fhir}Goal", + "type" : "NamedTypeSpecifier" + } + } ] + }, { + "localId" : "326", + "locator" : "62:1-82:5", + "name" : "ReportGoalTargets", + "context" : "Patient", + "accessLevel" : "Public", + "type" : "FunctionDef", + "annotation" : [ { + "type" : "Annotation", + "s" : { + "r" : "326", + "s" : [ { + "value" : [ "","define function ReportGoalTargets(goal Goal):\n " ] + }, { + "r" : "3011", + "s" : [ { + "r" : "3011", + "s" : [ { + "value" : [ "if " ] + }, { + "r" : "3012", + "s" : [ { + "r" : "3013", + "s" : [ { + "r" : "3022", + "s" : [ { + "r" : "3014", + "s" : [ { + "r" : "3016", + "s" : [ { + "r" : "3015", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3016", + "s" : [ { + "value" : [ "target" ] + } ] + } ] + }, { + "r" : "3021", + "value" : [ "[","0","]" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3022", + "s" : [ { + "value" : [ "measure" ] + } ] + } ] }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ " ","~"," " ] }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } + "r" : "3024", + "s" : [ { + "r" : "3023", + "s" : [ { + "value" : [ "Cx" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3024", + "s" : [ { + "value" : [ "\"Systolic blood pressure\"" ] + } ] + } ] + } ] + }, { + "value" : [ " or " ] + }, { + "r" : "3028", + "s" : [ { + "r" : "3037", + "s" : [ { + "r" : "3029", + "s" : [ { + "r" : "3031", + "s" : [ { + "r" : "3030", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3031", + "s" : [ { + "value" : [ "target" ] + } ] + } ] + }, { + "r" : "3036", + "value" : [ "[","0","]" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3037", + "s" : [ { + "value" : [ "measure" ] + } ] + } ] }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ " ","~"," " ] }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "r" : "3039", + "s" : [ { + "r" : "3038", + "s" : [ { + "value" : [ "Cx" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3039", + "s" : [ { + "value" : [ "\"Diastolic blood pressure\"" ] + } ] + } ] + } ] + } ] + }, { + "value" : [ " then\n " ] + }, { + "r" : "3043", + "s" : [ { + "value" : [ "{" ] + }, { + "r" : "3044", + "s" : [ { + "value" : [ "{\n " ] }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "s" : [ { + "value" : [ "DueDate",": " ] + }, { + "r" : "3049", + "s" : [ { + "value" : [ "ToString","(" ] + }, { + "r" : "3046", + "s" : [ { + "value" : [ "DueDate","(" ] + }, { + "r" : "3045", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ ")" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } + "value" : [ ",\n " ] }, { - "name" : "Performer", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "s" : [ { + "value" : [ "DisplayName",": " ] + }, { + "r" : "3050", + "s" : [ { + "value" : [ "'Blood Pressure'" ] + } ] + } ] }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } + "value" : [ ",\n " ] }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } + "s" : [ { + "value" : [ "TargetValue",": " ] + }, { + "r" : "3153", + "s" : [ { + "r" : "3151", + "s" : [ { + "r" : "3104", + "s" : [ { + "r" : "3102", + "s" : [ { + "r" : "3055", + "s" : [ { + "value" : [ "'below '" ] + } ] + }, { + "value" : [ " + " ] + }, { + "r" : "3100", + "s" : [ { + "value" : [ "ToString","(" ] + }, { + "r" : "3096", + "s" : [ { + "r" : "3056", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "3056", + "s" : [ { + "r" : "3078", + "s" : [ { + "r" : "3057", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "3057", + "s" : [ { + "value" : [ "singleton from " ] + }, { + "r" : "3073", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "3073", + "s" : [ { + "s" : [ { + "r" : "3058", + "s" : [ { + "r" : "3060", + "s" : [ { + "s" : [ { + "value" : [ "goal",".","target" ] + } ] + } ] + }, { + "value" : [ " ","T" ] + } ] + } ] + }, { + "value" : [ " " ] + }, { + "r" : "3065", + "s" : [ { + "value" : [ "where " ] + }, { + "r" : "3065", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "3065", + "s" : [ { + "r" : "3067", + "s" : [ { + "r" : "3066", + "s" : [ { + "value" : [ "T" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3067", + "s" : [ { + "value" : [ "measure" ] + } ] + } ] + }, { + "value" : [ " ","~"," " ] + }, { + "r" : "3069", + "s" : [ { + "r" : "3068", + "s" : [ { + "value" : [ "Cx" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3069", + "s" : [ { + "value" : [ "\"Systolic blood pressure\"" ] + } ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3078", + "s" : [ { + "value" : [ "detail" ] + } ] + } ] + }, { + "value" : [ " as " ] + }, { + "r" : "3095", + "s" : [ { + "value" : [ "FHIR",".","Quantity" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3096", + "s" : [ { + "value" : [ "value" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + }, { + "value" : [ "\n + " ] + }, { + "r" : "3103", + "s" : [ { + "value" : [ "'/'" ] + } ] + } ] }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - } ] - } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } ] - } - } ] - } - } - }, { - "name" : "Addresses", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } ] - } - } - }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - } ] - } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Overdue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - } ] - }, - "expression" : { - "localId" : "255", - "locator" : "45:3-56:3", - "type" : "Tuple", - "resultTypeSpecifier" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Category", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Description", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ExpressedBy", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "StartDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Target", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DueDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ " + " ] + }, { + "r" : "3149", + "s" : [ { + "value" : [ "ToString","(" ] + }, { + "r" : "3145", + "s" : [ { + "r" : "3105", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "3105", + "s" : [ { + "r" : "3127", + "s" : [ { + "r" : "3106", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "3106", + "s" : [ { + "value" : [ "singleton from " ] + }, { + "r" : "3122", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "3122", + "s" : [ { + "s" : [ { + "r" : "3107", + "s" : [ { + "r" : "3109", + "s" : [ { + "s" : [ { + "value" : [ "goal",".","target" ] + } ] + } ] + }, { + "value" : [ " ","T" ] + } ] + } ] + }, { + "value" : [ " " ] + }, { + "r" : "3114", + "s" : [ { + "value" : [ "where " ] + }, { + "r" : "3114", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "3114", + "s" : [ { + "r" : "3116", + "s" : [ { + "r" : "3115", + "s" : [ { + "value" : [ "T" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3116", + "s" : [ { + "value" : [ "measure" ] + } ] + } ] + }, { + "value" : [ " ","~"," " ] + }, { + "r" : "3118", + "s" : [ { + "r" : "3117", + "s" : [ { + "value" : [ "Cx" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3118", + "s" : [ { + "value" : [ "\"Diastolic blood pressure\"" ] + } ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3127", + "s" : [ { + "value" : [ "detail" ] + } ] + } ] + }, { + "value" : [ " as " ] + }, { + "r" : "3144", + "s" : [ { + "value" : [ "FHIR",".","Quantity" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3145", + "s" : [ { + "value" : [ "value" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + }, { + "value" : [ " + " ] + }, { + "r" : "3152", + "s" : [ { + "value" : [ "' mmHg'" ] + } ] + } ] + } ] + }, { + "value" : [ ",\n // LastResult: DE.ReportMostRecentResult(DE.FindObservations(Cx.\"Blood pressure\"))\n " ] + }, { + "s" : [ { + "value" : [ "LastResult",": " ] + }, { + "r" : "3170", + "s" : [ { + "r" : "3154", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3170", + "s" : [ { + "value" : [ "ReportMostRecentResult","(" ] + }, { + "r" : "3165", + "s" : [ { + "r" : "3155", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3165", + "s" : [ { + "value" : [ "FindObservations","(" ] + }, { + "r" : "3164", + "s" : [ { + "r" : "3156", + "s" : [ { + "r" : "3158", + "s" : [ { + "r" : "3157", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3158", + "s" : [ { + "value" : [ "target" ] + } ] + } ] + }, { + "r" : "3163", + "value" : [ "[","0","]" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3164", + "s" : [ { + "value" : [ "measure" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } ] + }, { + "value" : [ "\n }" ] + } ] }, { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ "}" ] + } ] + }, { + "value" : [ "\n else\n " ] + }, { + "r" : "3616", + "s" : [ { + "s" : [ { + "r" : "3328", + "s" : [ { + "r" : "3330", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "3330", + "s" : [ { + "r" : "3329", + "s" : [ { + "value" : [ "goal" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3330", + "s" : [ { + "value" : [ "target" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + }, { + "value" : [ " ","target" ] + } ] + } ] }, { - "name" : "TargetValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ "\n " ] }, { - "name" : "LastResult", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } + "r" : "3339", + "s" : [ { + "value" : [ "return " ] + }, { + "r" : "3340", + "s" : [ { + "value" : [ "{\n " ] }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "s" : [ { + "value" : [ "DueDate",": " ] + }, { + "r" : "3354", + "s" : [ { + "value" : [ "ToString","(" ] + }, { + "r" : "3351", + "s" : [ { + "r" : "3341", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "3341", + "s" : [ { + "r" : "3343", + "s" : [ { + "r" : "3342", + "s" : [ { + "value" : [ "target" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3343", + "s" : [ { + "value" : [ "due" ] + } ] + } ] + }, { + "value" : [ " as " ] + }, { + "r" : "3350", + "s" : [ { + "value" : [ "FHIR",".","date" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3351", + "s" : [ { + "value" : [ "value" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ ",\n " ] }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "s" : [ { + "value" : [ "DisplayName",": " ] + }, { + "r" : "3358", + "s" : [ { + "r" : "3355", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3358", + "s" : [ { + "value" : [ "ConceptText","(" ] + }, { + "r" : "3357", + "s" : [ { + "r" : "3356", + "s" : [ { + "value" : [ "target" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3357", + "s" : [ { + "value" : [ "measure" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } ] }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } + "value" : [ ",\n " ] }, { - "name" : "Performer", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "s" : [ { + "value" : [ "TargetValue",": " ] + }, { + "r" : "3448", + "s" : [ { + "value" : [ "Coalesce","(" ] + }, { + "r" : "3380", + "s" : [ { + "r" : "3359", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3380", + "s" : [ { + "value" : [ "QuantityTextWithComparator","(" ] + }, { + "r" : "3360", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "3360", + "s" : [ { + "r" : "3362", + "s" : [ { + "r" : "3361", + "s" : [ { + "value" : [ "target" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3362", + "s" : [ { + "value" : [ "detail" ] + } ] + } ] + }, { + "value" : [ " as " ] + }, { + "r" : "3379", + "s" : [ { + "value" : [ "Quantity" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + }, { + "value" : [ ",\n " ] + }, { + "r" : "3402", + "s" : [ { + "r" : "3381", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3402", + "s" : [ { + "value" : [ "RangeText","(" ] + }, { + "r" : "3382", + "s" : [ { + "r" : "3384", + "s" : [ { + "r" : "3383", + "s" : [ { + "value" : [ "target" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3384", + "s" : [ { + "value" : [ "detail" ] + } ] + } ] + }, { + "value" : [ " as " ] + }, { + "r" : "3401", + "s" : [ { + "value" : [ "FHIR",".","Range" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + }, { + "value" : [ ",\n " ] + }, { + "r" : "3424", + "s" : [ { + "r" : "3403", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3424", + "s" : [ { + "value" : [ "ConceptText","(" ] + }, { + "r" : "3404", + "s" : [ { + "r" : "3406", + "s" : [ { + "r" : "3405", + "s" : [ { + "value" : [ "target" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3406", + "s" : [ { + "value" : [ "detail" ] + } ] + } ] + }, { + "value" : [ " as " ] + }, { + "r" : "3423", + "s" : [ { + "value" : [ "CodeableConcept" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + }, { + "value" : [ ",\n " ] + }, { + "r" : "3445", + "s" : [ { + "r" : "3425", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "3425", + "s" : [ { + "r" : "3427", + "s" : [ { + "r" : "3426", + "s" : [ { + "value" : [ "target" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3427", + "s" : [ { + "value" : [ "detail" ] + } ] + } ] + }, { + "value" : [ " as " ] + }, { + "r" : "3444", + "s" : [ { + "value" : [ "FHIR",".","string" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3445", + "s" : [ { + "value" : [ "value" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } + "value" : [ ",\n " ] }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } + "s" : [ { + "value" : [ "LastResult",": " ] + }, { + "r" : "3458", + "s" : [ { + "r" : "3449", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3458", + "s" : [ { + "value" : [ "ReportMostRecentResult","(" ] }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } + "r" : "3453", + "s" : [ { + "r" : "3450", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3453", + "s" : [ { + "value" : [ "FindObservations","(" ] + }, { + "r" : "3452", + "s" : [ { + "r" : "3451", + "s" : [ { + "value" : [ "target" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "3452", + "s" : [ { + "value" : [ "measure" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + }, { + "value" : [ ")" ] } ] - } - } + } ] + } ] }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ "\n }" ] } ] - } - } ] - } - } - }, { - "name" : "Addresses", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + } ] } ] - } - } - }, { - "name" : "Notes", + } ] + } ] + } ] + } + } ], + "resultTypeSpecifier" : { + "localId" : "3749", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3750", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3751", + "name" : "DueDate", "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "localId" : "3752", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } }, { - "name" : "Provenance", + "localId" : "3753", + "name" : "DisplayName", "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - } ] - } + "localId" : "3754", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } }, { - "name" : "LearnMore", + "localId" : "3755", + "name" : "TargetValue", "elementType" : { + "localId" : "3756", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "Overdue", + "localId" : "3757", + "name" : "LastResult", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - } ] - }, - "element" : [ { - "name" : "Category", - "value" : { - "localId" : "37", - "locator" : "46:15-46:46", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "name" : "ConceptText", - "libraryName" : "DE", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "36", - "locator" : "46:30-46:45", - "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", - "type" : "Indexer", - "operand" : [ { - "localId" : "34", - "locator" : "46:30-46:42", - "path" : "category", - "type" : "Property", - "resultTypeSpecifier" : { + "localId" : "3758", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3759", + "name" : "DisplayName", + "elementType" : { + "localId" : "3760", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3761", + "name" : "ConceptName", + "elementType" : { + "localId" : "3762", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3763", + "name" : "Date", + "elementType" : { + "localId" : "3764", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3765", + "name" : "ResultText", + "elementType" : { + "localId" : "3766", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3767", + "name" : "ResultValue", + "elementType" : { + "localId" : "3768", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3769", + "name" : "ResultUnits", + "elementType" : { + "localId" : "3770", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3771", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "3772", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3773", + "name" : "Interpretation", + "elementType" : { + "localId" : "3774", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3775", + "name" : "Flag", + "elementType" : { + "localId" : "3776", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3777", + "name" : "Performer", + "elementType" : { + "localId" : "3778", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3779", + "name" : "Notes", + "elementType" : { + "localId" : "3780", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{http://hl7.org/fhir}CodeableConcept", + "localId" : "3781", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, - "source" : { - "localId" : "33", - "locator" : "46:30-46:33", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" } }, { - "localId" : "35", - "locator" : "46:44", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0", - "type" : "Literal" - } ] - } ] - } - }, { - "name" : "Description", - "value" : { - "localId" : "41", - "locator" : "47:18-47:49", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "name" : "ConceptText", - "libraryName" : "DE", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "40", - "locator" : "47:33-47:48", - "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", - "path" : "description", - "type" : "Property", - "source" : { - "localId" : "39", - "locator" : "47:33-47:36", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" - } - } ] - } - }, { - "name" : "ExpressedBy", - "value" : { - "localId" : "45", - "locator" : "48:18-48:47", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "path" : "value", - "type" : "Property", - "source" : { - "localId" : "44", - "locator" : "48:18-48:41", - "resultTypeName" : "{http://hl7.org/fhir}string", - "path" : "display", - "type" : "Property", - "source" : { - "localId" : "43", - "locator" : "48:18-48:33", - "resultTypeName" : "{http://hl7.org/fhir}Reference", - "path" : "expressedBy", - "type" : "Property", - "source" : { - "localId" : "42", - "locator" : "48:18-48:21", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" - } - } - } - } - }, { - "name" : "StartDate", - "value" : { - "localId" : "48", - "locator" : "49:16-49:35", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "type" : "ToString", - "operand" : { - "name" : "ToDate", - "libraryName" : "FHIRHelpers", - "type" : "FunctionRef", - "operand" : [ { - "asType" : "{http://hl7.org/fhir}date", - "type" : "As", - "operand" : { - "localId" : "47", - "locator" : "49:25-49:34", - "path" : "start", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ChoiceTypeSpecifier", - "choice" : [ { - "name" : "{http://hl7.org/fhir}date", - "type" : "NamedTypeSpecifier" + "localId" : "3782", + "name" : "Provenance", + "elementType" : { + "localId" : "3783", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3784", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3785", + "name" : "Transmitter", + "elementType" : { + "localId" : "3786", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3787", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } }, { - "name" : "{http://hl7.org/fhir}CodeableConcept", - "type" : "NamedTypeSpecifier" + "localId" : "3788", + "name" : "Author", + "elementType" : { + "localId" : "3789", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3790", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } } ] - }, - "source" : { - "localId" : "46", - "locator" : "49:25-49:28", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" } } + }, { + "localId" : "3791", + "name" : "LearnMore", + "elementType" : { + "localId" : "3792", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } } ] } - } - }, { - "name" : "Target", - "value" : { - "localId" : "187", - "locator" : "50:13-50:77", - "type" : "If", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", + } ] + } + }, + "expression" : { + "localId" : "3011", + "locator" : "63:3-82:5", + "type" : "If", + "resultTypeSpecifier" : { + "localId" : "3705", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3706", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3707", + "name" : "DueDate", + "elementType" : { + "localId" : "3708", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3709", + "name" : "DisplayName", + "elementType" : { + "localId" : "3710", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3711", + "name" : "TargetValue", + "elementType" : { + "localId" : "3712", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3713", + "name" : "LastResult", "elementType" : { + "localId" : "3714", "type" : "TupleTypeSpecifier", "element" : [ { - "name" : "DueDate", + "localId" : "3715", + "name" : "DisplayName", "elementType" : { + "localId" : "3716", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "DisplayName", + "localId" : "3717", + "name" : "ConceptName", "elementType" : { + "localId" : "3718", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "TargetValue", + "localId" : "3719", + "name" : "Date", "elementType" : { + "localId" : "3720", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "LastResult", + "localId" : "3721", + "name" : "ResultText", "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultUnits", + "localId" : "3722", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3723", + "name" : "ResultValue", + "elementType" : { + "localId" : "3724", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3725", + "name" : "ResultUnits", + "elementType" : { + "localId" : "3726", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3727", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "3728", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3729", + "name" : "Interpretation", + "elementType" : { + "localId" : "3730", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3731", + "name" : "Flag", + "elementType" : { + "localId" : "3732", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3733", + "name" : "Performer", + "elementType" : { + "localId" : "3734", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3735", + "name" : "Notes", + "elementType" : { + "localId" : "3736", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3737", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "3738", + "name" : "Provenance", + "elementType" : { + "localId" : "3739", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3740", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3741", + "name" : "Transmitter", + "elementType" : { + "localId" : "3742", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3743", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "3744", + "name" : "Author", + "elementType" : { + "localId" : "3745", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3746", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] + } + } + }, { + "localId" : "3747", + "name" : "LearnMore", + "elementType" : { + "localId" : "3748", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } ] + } + } ] + } + }, + "condition" : { + "localId" : "3012", + "locator" : "63:6-63:116", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Or", + "signature" : [ ], + "operand" : [ { + "localId" : "3013", + "locator" : "63:6-63:58", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Equivalent", + "signature" : [ ], + "operand" : [ { + "localId" : "3025", + "name" : "ToConcept", + "libraryName" : "FHIRHelpers", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "3022", + "locator" : "63:6-63:27", + "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", + "path" : "measure", + "type" : "Property", + "source" : { + "localId" : "3014", + "locator" : "63:6-63:19", + "resultTypeName" : "{http://hl7.org/fhir}Goal.Target", + "type" : "Indexer", + "signature" : [ ], + "operand" : [ { + "localId" : "3016", + "locator" : "63:6-63:16", + "path" : "target", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "3019", + "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", + "localId" : "3020", + "name" : "{http://hl7.org/fhir}Goal.Target", "type" : "NamedTypeSpecifier" } - }, { - "name" : "ReferenceRange", + }, + "source" : { + "localId" : "3015", + "locator" : "63:6-63:9", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } + }, { + "localId" : "3021", + "locator" : "63:18", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "0", + "type" : "Literal" + } ] + } + } ] + }, { + "localId" : "3027", + "type" : "ToConcept", + "signature" : [ ], + "operand" : { + "localId" : "3024", + "locator" : "63:31-63:58", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Code", + "name" : "Systolic blood pressure", + "libraryName" : "Cx", + "type" : "CodeRef" + } + } ] + }, { + "localId" : "3028", + "locator" : "63:63-63:116", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Equivalent", + "signature" : [ ], + "operand" : [ { + "localId" : "3040", + "name" : "ToConcept", + "libraryName" : "FHIRHelpers", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "3037", + "locator" : "63:63-63:84", + "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", + "path" : "measure", + "type" : "Property", + "source" : { + "localId" : "3029", + "locator" : "63:63-63:76", + "resultTypeName" : "{http://hl7.org/fhir}Goal.Target", + "type" : "Indexer", + "signature" : [ ], + "operand" : [ { + "localId" : "3031", + "locator" : "63:63-63:73", + "path" : "target", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "3034", + "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", + "localId" : "3035", + "name" : "{http://hl7.org/fhir}Goal.Target", "type" : "NamedTypeSpecifier" } - }, { - "name" : "Interpretation", + }, + "source" : { + "localId" : "3030", + "locator" : "63:63-63:66", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } + }, { + "localId" : "3036", + "locator" : "63:75", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "0", + "type" : "Literal" + } ] + } + } ] + }, { + "localId" : "3042", + "type" : "ToConcept", + "signature" : [ ], + "operand" : { + "localId" : "3039", + "locator" : "63:88-63:116", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Code", + "name" : "Diastolic blood pressure", + "libraryName" : "Cx", + "type" : "CodeRef" + } + } ] + } ] + }, + "then" : { + "localId" : "3043", + "locator" : "64:5-71:6", + "type" : "List", + "resultTypeSpecifier" : { + "localId" : "3284", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3285", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3286", + "name" : "DueDate", + "elementType" : { + "localId" : "3287", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3288", + "name" : "DisplayName", + "elementType" : { + "localId" : "3289", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3290", + "name" : "TargetValue", + "elementType" : { + "localId" : "3291", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3292", + "name" : "LastResult", + "elementType" : { + "localId" : "3293", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3294", + "name" : "DisplayName", + "elementType" : { + "localId" : "3295", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3296", + "name" : "ConceptName", + "elementType" : { + "localId" : "3297", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3298", + "name" : "Date", + "elementType" : { + "localId" : "3299", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3300", + "name" : "ResultText", + "elementType" : { + "localId" : "3301", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3302", + "name" : "ResultValue", + "elementType" : { + "localId" : "3303", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3304", + "name" : "ResultUnits", + "elementType" : { + "localId" : "3305", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3306", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "3307", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3308", + "name" : "Interpretation", + "elementType" : { + "localId" : "3309", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3310", + "name" : "Flag", + "elementType" : { + "localId" : "3311", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3312", + "name" : "Performer", + "elementType" : { + "localId" : "3313", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3314", + "name" : "Notes", + "elementType" : { + "localId" : "3315", + "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3316", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, { - "name" : "Flag", + } + }, { + "localId" : "3317", + "name" : "Provenance", + "elementType" : { + "localId" : "3318", + "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" + "localId" : "3319", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3320", + "name" : "Transmitter", + "elementType" : { + "localId" : "3321", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3322", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "3323", + "name" : "Author", + "elementType" : { + "localId" : "3324", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3325", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] } - }, { - "name" : "Performer", + } + }, { + "localId" : "3326", + "name" : "LearnMore", + "elementType" : { + "localId" : "3327", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } ] + } + } ] + } + }, + "element" : [ { + "localId" : "3044", + "locator" : "64:6-71:5", + "type" : "Tuple", + "resultTypeSpecifier" : { + "localId" : "3241", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3242", + "name" : "DueDate", + "elementType" : { + "localId" : "3243", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3244", + "name" : "DisplayName", + "elementType" : { + "localId" : "3245", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3246", + "name" : "TargetValue", + "elementType" : { + "localId" : "3247", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3248", + "name" : "LastResult", + "elementType" : { + "localId" : "3249", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3250", + "name" : "DisplayName", + "elementType" : { + "localId" : "3251", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3252", + "name" : "ConceptName", + "elementType" : { + "localId" : "3253", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3254", + "name" : "Date", + "elementType" : { + "localId" : "3255", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3256", + "name" : "ResultText", + "elementType" : { + "localId" : "3257", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3258", + "name" : "ResultValue", + "elementType" : { + "localId" : "3259", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3260", + "name" : "ResultUnits", + "elementType" : { + "localId" : "3261", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3262", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "3263", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3264", + "name" : "Interpretation", + "elementType" : { + "localId" : "3265", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3266", + "name" : "Flag", + "elementType" : { + "localId" : "3267", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3268", + "name" : "Performer", + "elementType" : { + "localId" : "3269", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3270", + "name" : "Notes", + "elementType" : { + "localId" : "3271", + "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3272", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Provenance", + } + }, { + "localId" : "3273", + "name" : "Provenance", + "elementType" : { + "localId" : "3274", + "type" : "ListTypeSpecifier", "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", + "localId" : "3275", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3276", + "name" : "Transmitter", + "elementType" : { + "localId" : "3277", + "type" : "ListTypeSpecifier", "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", + "localId" : "3278", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "3279", + "name" : "Author", + "elementType" : { + "localId" : "3280", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3281", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] + } + } + }, { + "localId" : "3282", + "name" : "LearnMore", + "elementType" : { + "localId" : "3283", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } ] + } + } ] + }, + "element" : [ { + "name" : "DueDate", + "value" : { + "localId" : "3049", + "locator" : "65:16-65:38", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "type" : "ToString", + "signature" : [ ], + "operand" : { + "localId" : "3046", + "locator" : "65:25-65:37", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", + "name" : "DueDate", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "3045", + "locator" : "65:33-65:36", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" + } ] + } + } + }, { + "name" : "DisplayName", + "value" : { + "localId" : "3050", + "locator" : "66:20-66:35", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "Blood Pressure", + "type" : "Literal" + } + }, { + "name" : "TargetValue", + "value" : { + "localId" : "3153", + "locator" : "67:20-68:150", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "type" : "Concatenate", + "signature" : [ ], + "operand" : [ { + "localId" : "3151", + "locator" : "67:20-68:140", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "type" : "Concatenate", + "signature" : [ ], + "operand" : [ { + "localId" : "3104", + "locator" : "67:20-68:13", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "type" : "Concatenate", + "signature" : [ ], + "operand" : [ { + "localId" : "3102", + "locator" : "67:20-67:153", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "type" : "Concatenate", + "signature" : [ ], + "operand" : [ { + "localId" : "3055", + "locator" : "67:20-67:27", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "below ", + "type" : "Literal" + }, { + "localId" : "3100", + "locator" : "67:31-67:153", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "type" : "ToString", + "signature" : [ ], + "operand" : { + "localId" : "3101", + "name" : "ToDecimal", + "libraryName" : "FHIRHelpers", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "3096", + "locator" : "67:40-67:152", + "resultTypeName" : "{http://hl7.org/fhir}decimal", + "path" : "value", + "type" : "Property", + "source" : { + "localId" : "3056", + "locator" : "67:40-67:146", + "resultTypeName" : "{http://hl7.org/fhir}Quantity", + "strict" : false, + "type" : "As", + "signature" : [ ], + "operand" : { + "localId" : "3078", + "locator" : "67:41-67:128", + "path" : "detail", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "3087", + "type" : "ChoiceTypeSpecifier", + "type" : [ ], + "choice" : [ { + "localId" : "3088", + "name" : "{http://hl7.org/fhir}Quantity", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3089", + "name" : "{http://hl7.org/fhir}Range", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3090", + "name" : "{http://hl7.org/fhir}CodeableConcept", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3091", + "name" : "{http://hl7.org/fhir}string", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3092", + "name" : "{http://hl7.org/fhir}boolean", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3093", + "name" : "{http://hl7.org/fhir}integer", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3094", + "name" : "{http://hl7.org/fhir}Ratio", + "type" : "NamedTypeSpecifier" + } ] + }, + "source" : { + "localId" : "3057", + "locator" : "67:41-67:121", + "resultTypeName" : "{http://hl7.org/fhir}Goal.Target", + "type" : "SingletonFrom", + "signature" : [ ], + "operand" : { + "localId" : "3073", + "locator" : "67:57-67:120", + "type" : "Query", + "resultTypeSpecifier" : { + "localId" : "3076", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3077", + "name" : "{http://hl7.org/fhir}Goal.Target", + "type" : "NamedTypeSpecifier" + } + }, + "source" : [ { + "localId" : "3058", + "locator" : "67:58-67:70", + "alias" : "T", + "resultTypeSpecifier" : { + "localId" : "3063", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3064", + "name" : "{http://hl7.org/fhir}Goal.Target", + "type" : "NamedTypeSpecifier" + } + }, + "expression" : { + "localId" : "3060", + "locator" : "67:58-67:68", + "path" : "target", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "3061", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3062", + "name" : "{http://hl7.org/fhir}Goal.Target", + "type" : "NamedTypeSpecifier" + } + }, + "source" : { + "localId" : "3059", + "name" : "goal", + "type" : "OperandRef" + } + } + } ], + "let" : [ ], + "relationship" : [ ], + "where" : { + "localId" : "3065", + "locator" : "67:72-67:119", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Equivalent", + "signature" : [ ], + "operand" : [ { + "localId" : "3070", + "name" : "ToConcept", + "libraryName" : "FHIRHelpers", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "3067", + "locator" : "67:79-67:87", + "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", + "path" : "measure", + "scope" : "T", + "type" : "Property" + } ] + }, { + "localId" : "3072", + "type" : "ToConcept", + "signature" : [ ], + "operand" : { + "localId" : "3069", + "locator" : "67:91-67:118", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Code", + "name" : "Systolic blood pressure", + "libraryName" : "Cx", + "type" : "CodeRef" + } + } ] + } + } + } + }, + "asTypeSpecifier" : { + "localId" : "3095", + "locator" : "67:133-67:145", + "resultTypeName" : "{http://hl7.org/fhir}Quantity", + "name" : "{http://hl7.org/fhir}Quantity", "type" : "NamedTypeSpecifier" } } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", + } ] + } + } ] + }, { + "localId" : "3103", + "locator" : "68:11-68:13", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "/", + "type" : "Literal" + } ] + }, { + "localId" : "3149", + "locator" : "68:17-68:140", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "type" : "ToString", + "signature" : [ ], + "operand" : { + "localId" : "3150", + "name" : "ToDecimal", + "libraryName" : "FHIRHelpers", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "3145", + "locator" : "68:26-68:139", + "resultTypeName" : "{http://hl7.org/fhir}decimal", + "path" : "value", + "type" : "Property", + "source" : { + "localId" : "3105", + "locator" : "68:26-68:133", + "resultTypeName" : "{http://hl7.org/fhir}Quantity", + "strict" : false, + "type" : "As", + "signature" : [ ], + "operand" : { + "localId" : "3127", + "locator" : "68:27-68:115", + "path" : "detail", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "3136", + "type" : "ChoiceTypeSpecifier", + "type" : [ ], + "choice" : [ { + "localId" : "3137", + "name" : "{http://hl7.org/fhir}Quantity", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3138", + "name" : "{http://hl7.org/fhir}Range", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3139", + "name" : "{http://hl7.org/fhir}CodeableConcept", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3140", + "name" : "{http://hl7.org/fhir}string", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3141", + "name" : "{http://hl7.org/fhir}boolean", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3142", + "name" : "{http://hl7.org/fhir}integer", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3143", + "name" : "{http://hl7.org/fhir}Ratio", "type" : "NamedTypeSpecifier" + } ] + }, + "source" : { + "localId" : "3106", + "locator" : "68:27-68:108", + "resultTypeName" : "{http://hl7.org/fhir}Goal.Target", + "type" : "SingletonFrom", + "signature" : [ ], + "operand" : { + "localId" : "3122", + "locator" : "68:43-68:107", + "type" : "Query", + "resultTypeSpecifier" : { + "localId" : "3125", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3126", + "name" : "{http://hl7.org/fhir}Goal.Target", + "type" : "NamedTypeSpecifier" + } + }, + "source" : [ { + "localId" : "3107", + "locator" : "68:44-68:56", + "alias" : "T", + "resultTypeSpecifier" : { + "localId" : "3112", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3113", + "name" : "{http://hl7.org/fhir}Goal.Target", + "type" : "NamedTypeSpecifier" + } + }, + "expression" : { + "localId" : "3109", + "locator" : "68:44-68:54", + "path" : "target", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "3110", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3111", + "name" : "{http://hl7.org/fhir}Goal.Target", + "type" : "NamedTypeSpecifier" + } + }, + "source" : { + "localId" : "3108", + "name" : "goal", + "type" : "OperandRef" + } + } + } ], + "let" : [ ], + "relationship" : [ ], + "where" : { + "localId" : "3114", + "locator" : "68:58-68:106", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Equivalent", + "signature" : [ ], + "operand" : [ { + "localId" : "3119", + "name" : "ToConcept", + "libraryName" : "FHIRHelpers", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "3116", + "locator" : "68:65-68:73", + "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", + "path" : "measure", + "scope" : "T", + "type" : "Property" + } ] + }, { + "localId" : "3121", + "type" : "ToConcept", + "signature" : [ ], + "operand" : { + "localId" : "3118", + "locator" : "68:77-68:105", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Code", + "name" : "Diastolic blood pressure", + "libraryName" : "Cx", + "type" : "CodeRef" + } + } ] + } } } - } ] + }, + "asTypeSpecifier" : { + "localId" : "3144", + "locator" : "68:120-68:132", + "resultTypeName" : "{http://hl7.org/fhir}Quantity", + "name" : "{http://hl7.org/fhir}Quantity", + "type" : "NamedTypeSpecifier" + } } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } ] - } + } ] + } + } ] + }, { + "localId" : "3152", + "locator" : "68:144-68:150", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : " mmHg", + "type" : "Literal" } ] } - }, - "condition" : { - "localId" : "51", - "locator" : "50:16-50:38", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "Not", - "operand" : { - "locator" : "50:16-50:38", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "IsNull", - "operand" : { - "localId" : "50", - "locator" : "50:16-50:26", - "path" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", + }, { + "name" : "LastResult", + "value" : { + "localId" : "3170", + "locator" : "70:19-70:88", + "name" : "ReportMostRecentResult", + "libraryName" : "DE", + "type" : "FunctionRef", + "resultTypeSpecifier" : { + "localId" : "3206", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3207", + "name" : "DisplayName", "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", + "localId" : "3208", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, - "source" : { - "localId" : "49", - "locator" : "50:16-50:19", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" - } - } - } - }, - "then" : { - "localId" : "185", - "locator" : "50:45-50:67", - "name" : "ReportGoalTargets", - "type" : "FunctionRef", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DueDate", + }, { + "localId" : "3209", + "name" : "ConceptName", "elementType" : { + "localId" : "3210", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "DisplayName", + "localId" : "3211", + "name" : "Date", "elementType" : { + "localId" : "3212", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "TargetValue", + "localId" : "3213", + "name" : "ResultText", "elementType" : { + "localId" : "3214", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "LastResult", + "localId" : "3215", + "name" : "ResultValue", "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Performer", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Notes", - "elementType" : { + "localId" : "3216", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3217", + "name" : "ResultUnits", + "elementType" : { + "localId" : "3218", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3219", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "3220", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3221", + "name" : "Interpretation", + "elementType" : { + "localId" : "3222", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3223", + "name" : "Flag", + "elementType" : { + "localId" : "3224", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3225", + "name" : "Performer", + "elementType" : { + "localId" : "3226", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3227", + "name" : "Notes", + "elementType" : { + "localId" : "3228", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3229", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "3230", + "name" : "Provenance", + "elementType" : { + "localId" : "3231", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3232", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3233", + "name" : "Transmitter", + "elementType" : { + "localId" : "3234", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3235", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "3236", + "name" : "Author", + "elementType" : { + "localId" : "3237", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3238", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] + } + } + }, { + "localId" : "3239", + "name" : "LearnMore", + "elementType" : { + "localId" : "3240", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } ] + }, + "signature" : [ ], + "operand" : [ { + "localId" : "3165", + "locator" : "70:45-70:87", + "name" : "FindObservations", + "libraryName" : "DE", + "type" : "FunctionRef", + "resultTypeSpecifier" : { + "localId" : "3168", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3169", + "name" : "{http://hl7.org/fhir}Observation", + "type" : "NamedTypeSpecifier" + } + }, + "signature" : [ ], + "operand" : [ { + "localId" : "3164", + "locator" : "70:65-70:86", + "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", + "path" : "measure", + "type" : "Property", + "source" : { + "localId" : "3156", + "locator" : "70:65-70:78", + "resultTypeName" : "{http://hl7.org/fhir}Goal.Target", + "type" : "Indexer", + "signature" : [ ], + "operand" : [ { + "localId" : "3158", + "locator" : "70:65-70:75", + "path" : "target", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "3161", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", + "localId" : "3162", + "name" : "{http://hl7.org/fhir}Goal.Target", "type" : "NamedTypeSpecifier" } + }, + "source" : { + "localId" : "3157", + "locator" : "70:65-70:68", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "goal", + "type" : "OperandRef" } }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - } ] - } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "localId" : "3163", + "locator" : "70:77", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "0", + "type" : "Literal" } ] } } ] + } ] + } + } ] + } ] + }, + "else" : { + "localId" : "3616", + "locator" : "73:3-82:5", + "type" : "Query", + "resultTypeSpecifier" : { + "localId" : "3617", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3618", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3619", + "name" : "DueDate", + "elementType" : { + "localId" : "3620", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } - }, - "operand" : [ { - "localId" : "52", - "locator" : "50:63-50:66", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" - } ] - }, - "else" : { - "type" : "As", - "operand" : { - "localId" : "186", - "locator" : "50:74-50:77", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "type" : "Null" - }, - "asTypeSpecifier" : { - "type" : "ListTypeSpecifier", + }, { + "localId" : "3621", + "name" : "DisplayName", + "elementType" : { + "localId" : "3622", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3623", + "name" : "TargetValue", + "elementType" : { + "localId" : "3624", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3625", + "name" : "LastResult", "elementType" : { + "localId" : "3626", "type" : "TupleTypeSpecifier", "element" : [ { - "name" : "DueDate", + "localId" : "3627", + "name" : "DisplayName", "elementType" : { + "localId" : "3628", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "DisplayName", + "localId" : "3629", + "name" : "ConceptName", "elementType" : { + "localId" : "3630", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "TargetValue", + "localId" : "3631", + "name" : "Date", "elementType" : { + "localId" : "3632", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { - "name" : "LastResult", + "localId" : "3633", + "name" : "ResultText", "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Performer", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - } ] - } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } ] + "localId" : "3634", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } - } ] - } - } - } - } - }, { - "name" : "Addresses", - "value" : { - "localId" : "236", - "locator" : "51:16-51:101", - "type" : "If", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } ] - } - }, - "condition" : { - "localId" : "190", - "locator" : "51:19-51:44", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "Not", - "operand" : { - "locator" : "51:19-51:44", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "IsNull", - "operand" : { - "localId" : "189", - "locator" : "51:19-51:32", - "path" : "addresses", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", + }, { + "localId" : "3635", + "name" : "ResultValue", + "elementType" : { + "localId" : "3636", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3637", + "name" : "ResultUnits", + "elementType" : { + "localId" : "3638", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3639", + "name" : "ReferenceRange", "elementType" : { - "name" : "{http://hl7.org/fhir}Reference", + "localId" : "3640", + "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - }, - "source" : { - "localId" : "188", - "locator" : "51:19-51:22", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" - } - } - } - }, - "then" : { - "localId" : "234", - "locator" : "51:51-51:91", - "name" : "DataElements", - "libraryName" : "DE", - "type" : "FunctionRef", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", + }, { + "localId" : "3641", + "name" : "Interpretation", "elementType" : { + "localId" : "3642", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } - } ] - } - }, - "operand" : [ { - "localId" : "233", - "locator" : "51:67-51:90", - "name" : "AddressesResources", - "type" : "FunctionRef", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Resource", - "type" : "NamedTypeSpecifier" - } - }, - "operand" : [ { - "localId" : "192", - "locator" : "51:86-51:89", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" - } ] - } ] - }, - "else" : { - "type" : "As", - "operand" : { - "localId" : "235", - "locator" : "51:98-51:101", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "type" : "Null" - }, - "asTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", + }, { + "localId" : "3643", + "name" : "Flag", + "elementType" : { + "localId" : "3644", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3645", + "name" : "Performer", + "elementType" : { + "localId" : "3646", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3647", + "name" : "Notes", + "elementType" : { + "localId" : "3648", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3649", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "3650", + "name" : "Provenance", + "elementType" : { + "localId" : "3651", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3652", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3653", + "name" : "Transmitter", + "elementType" : { + "localId" : "3654", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3655", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "3656", + "name" : "Author", + "elementType" : { + "localId" : "3657", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3658", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] + } + } + }, { + "localId" : "3659", + "name" : "LearnMore", "elementType" : { + "localId" : "3660", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } ] } - } + } ] } - } - }, { - "name" : "Notes", - "value" : { - "localId" : "240", - "locator" : "52:12-52:33", - "name" : "ToString", - "libraryName" : "DE", - "type" : "FunctionRef", + }, + "source" : [ { + "localId" : "3328", + "locator" : "73:3-73:22", + "alias" : "target", "resultTypeSpecifier" : { + "localId" : "3337", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", + "localId" : "3338", + "name" : "{http://hl7.org/fhir}Goal.Target", "type" : "NamedTypeSpecifier" } }, - "operand" : [ { - "localId" : "239", - "locator" : "52:24-52:32", - "path" : "note", + "expression" : { + "localId" : "3330", + "locator" : "73:3-73:15", + "path" : "target", "type" : "Property", "resultTypeSpecifier" : { + "localId" : "3335", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{http://hl7.org/fhir}Annotation", + "localId" : "3336", + "name" : "{http://hl7.org/fhir}Goal.Target", "type" : "NamedTypeSpecifier" } }, "source" : { - "localId" : "238", - "locator" : "52:24-52:27", + "localId" : "3329", + "locator" : "73:4-73:7", "resultTypeName" : "{http://hl7.org/fhir}Goal", "name" : "goal", "type" : "OperandRef" } - } ] - } - }, { - "name" : "Provenance", - "value" : { - "localId" : "243", - "locator" : "53:17-53:41", - "name" : "ReportProvenance", - "libraryName" : "DE", - "type" : "FunctionRef", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { + } + } ], + "let" : [ ], + "relationship" : [ ], + "return" : { + "localId" : "3339", + "locator" : "74:5-82:5", + "resultTypeSpecifier" : { + "localId" : "3572", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3573", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3574", + "name" : "DueDate", + "elementType" : { + "localId" : "3575", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3576", + "name" : "DisplayName", + "elementType" : { + "localId" : "3577", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3578", + "name" : "TargetValue", + "elementType" : { + "localId" : "3579", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3580", + "name" : "LastResult", + "elementType" : { + "localId" : "3581", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3582", + "name" : "DisplayName", + "elementType" : { + "localId" : "3583", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3584", + "name" : "ConceptName", + "elementType" : { + "localId" : "3585", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3586", + "name" : "Date", + "elementType" : { + "localId" : "3587", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3588", + "name" : "ResultText", + "elementType" : { + "localId" : "3589", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3590", + "name" : "ResultValue", + "elementType" : { + "localId" : "3591", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3592", + "name" : "ResultUnits", + "elementType" : { + "localId" : "3593", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3594", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "3595", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3596", + "name" : "Interpretation", + "elementType" : { + "localId" : "3597", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3598", + "name" : "Flag", + "elementType" : { + "localId" : "3599", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3600", + "name" : "Performer", + "elementType" : { + "localId" : "3601", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3602", + "name" : "Notes", + "elementType" : { + "localId" : "3603", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3604", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "3605", + "name" : "Provenance", + "elementType" : { + "localId" : "3606", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3607", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3608", + "name" : "Transmitter", + "elementType" : { + "localId" : "3609", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3610", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "3611", + "name" : "Author", + "elementType" : { + "localId" : "3612", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3613", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] + } + } + }, { + "localId" : "3614", + "name" : "LearnMore", + "elementType" : { + "localId" : "3615", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } ] + } + } ] + } + }, + "expression" : { + "localId" : "3340", + "locator" : "74:12-82:5", + "type" : "Tuple", + "resultTypeSpecifier" : { + "localId" : "3529", "type" : "TupleTypeSpecifier", "element" : [ { - "name" : "Transmitter", + "localId" : "3530", + "name" : "DueDate", "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "localId" : "3531", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } }, { - "name" : "Author", + "localId" : "3532", + "name" : "DisplayName", "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "localId" : "3533", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } - } ] - } - }, - "operand" : [ { - "localId" : "242", - "locator" : "53:37-53:40", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" - } ] - } - }, { - "name" : "LearnMore", - "value" : { - "localId" : "250", - "locator" : "54:16-54:54", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", - "name" : "LearnMoreURL", - "libraryName" : "DE", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "249", - "locator" : "54:32-54:53", - "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", - "path" : "measure", - "type" : "Property", - "source" : { - "localId" : "248", - "locator" : "54:32-54:45", - "resultTypeName" : "{http://hl7.org/fhir}Goal.Target", - "type" : "Indexer", - "operand" : [ { - "localId" : "246", - "locator" : "54:32-54:42", - "path" : "target", - "type" : "Property", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Goal.Target", - "type" : "NamedTypeSpecifier" - } - }, - "source" : { - "localId" : "245", - "locator" : "54:32-54:35", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" + }, { + "localId" : "3534", + "name" : "TargetValue", + "elementType" : { + "localId" : "3535", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" } }, { - "localId" : "247", - "locator" : "54:44", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0", - "type" : "Literal" - } ] - } - } ] - } - }, { - "name" : "Overdue", - "value" : { - "localId" : "254", - "locator" : "55:14-55:41", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "Before", - "operand" : [ { - "localId" : "252", - "locator" : "55:14-55:26", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", - "name" : "DueDate", - "type" : "FunctionRef", - "operand" : [ { - "localId" : "251", - "locator" : "55:22-55:25", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "goal", - "type" : "OperandRef" - } ] - }, { - "localId" : "253", - "locator" : "55:35-55:41", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", - "type" : "Today" - } ] - } - } ] - }, - "operand" : [ { - "name" : "goal", - "operandTypeSpecifier" : { - "localId" : "31", - "locator" : "44:33-44:36", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "{http://hl7.org/fhir}Goal", - "type" : "NamedTypeSpecifier" - } - } ] - }, { - "localId" : "260", - "locator" : "40:1-42:24", - "name" : "ReportGoals", - "context" : "Patient", - "accessLevel" : "Public", - "type" : "FunctionDef", - "annotation" : [ { - "type" : "Annotation", - "s" : { - "r" : "260", - "s" : [ { - "value" : [ "","define function ","ReportGoals","(","goals"," " ] - }, { - "r" : "27", - "s" : [ { - "value" : [ "List<" ] - }, { - "r" : "26", - "s" : [ { - "value" : [ "Goal" ] - } ] - }, { - "value" : [ ">" ] - } ] - }, { - "value" : [ "):\n " ] - }, { - "r" : "259", - "s" : [ { - "r" : "259", - "s" : [ { - "s" : [ { - "r" : "29", - "s" : [ { - "r" : "28", - "s" : [ { - "s" : [ { - "value" : [ "goals" ] - } ] - } ] - }, { - "value" : [ " ","G" ] - } ] + "localId" : "3536", + "name" : "LastResult", + "elementType" : { + "localId" : "3537", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3538", + "name" : "DisplayName", + "elementType" : { + "localId" : "3539", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3540", + "name" : "ConceptName", + "elementType" : { + "localId" : "3541", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3542", + "name" : "Date", + "elementType" : { + "localId" : "3543", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3544", + "name" : "ResultText", + "elementType" : { + "localId" : "3545", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3546", + "name" : "ResultValue", + "elementType" : { + "localId" : "3547", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3548", + "name" : "ResultUnits", + "elementType" : { + "localId" : "3549", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3550", + "name" : "ReferenceRange", + "elementType" : { + "localId" : "3551", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3552", + "name" : "Interpretation", + "elementType" : { + "localId" : "3553", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3554", + "name" : "Flag", + "elementType" : { + "localId" : "3555", + "name" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3556", + "name" : "Performer", + "elementType" : { + "localId" : "3557", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "3558", + "name" : "Notes", + "elementType" : { + "localId" : "3559", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3560", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "3561", + "name" : "Provenance", + "elementType" : { + "localId" : "3562", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3563", + "type" : "TupleTypeSpecifier", + "element" : [ { + "localId" : "3564", + "name" : "Transmitter", + "elementType" : { + "localId" : "3565", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3566", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + }, { + "localId" : "3567", + "name" : "Author", + "elementType" : { + "localId" : "3568", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3569", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } + } ] + } + } + }, { + "localId" : "3570", + "name" : "LearnMore", + "elementType" : { + "localId" : "3571", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + } ] + } } ] + }, + "element" : [ { + "name" : "DueDate", + "value" : { + "localId" : "3354", + "locator" : "75:16-75:56", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "type" : "ToString", + "signature" : [ ], + "operand" : { + "localId" : "3351", + "locator" : "75:25-75:55", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", + "path" : "value", + "type" : "Property", + "source" : { + "localId" : "3341", + "locator" : "75:25-75:49", + "resultTypeName" : "{http://hl7.org/fhir}date", + "strict" : false, + "type" : "As", + "signature" : [ ], + "operand" : { + "localId" : "3343", + "locator" : "75:26-75:35", + "path" : "due", + "scope" : "target", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "3347", + "type" : "ChoiceTypeSpecifier", + "type" : [ ], + "choice" : [ { + "localId" : "3348", + "name" : "{http://hl7.org/fhir}date", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3349", + "name" : "{http://hl7.org/fhir}Duration", + "type" : "NamedTypeSpecifier" + } ] + } + }, + "asTypeSpecifier" : { + "localId" : "3350", + "locator" : "75:40-75:48", + "resultTypeName" : "{http://hl7.org/fhir}date", + "name" : "{http://hl7.org/fhir}date", + "type" : "NamedTypeSpecifier" + } + } + } + } }, { - "value" : [ "\n " ] + "name" : "DisplayName", + "value" : { + "localId" : "3358", + "locator" : "76:20-76:49", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "name" : "ConceptText", + "libraryName" : "DE", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "3357", + "locator" : "76:35-76:48", + "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", + "path" : "measure", + "scope" : "target", + "type" : "Property" + } ] + } }, { - "r" : "258", - "s" : [ { - "value" : [ "return " ] - }, { - "r" : "257", - "s" : [ { - "value" : [ "ReportGoal","(" ] + "name" : "TargetValue", + "value" : { + "localId" : "3448", + "locator" : "77:20-80:57", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "type" : "Coalesce", + "signature" : [ ], + "operand" : [ { + "localId" : "3380", + "locator" : "77:29-77:86", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "name" : "QuantityTextWithComparator", + "libraryName" : "DE", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "3360", + "locator" : "77:59-77:85", + "resultTypeName" : "{http://hl7.org/fhir}Quantity", + "strict" : false, + "type" : "As", + "signature" : [ ], + "operand" : { + "localId" : "3362", + "locator" : "77:60-77:72", + "path" : "detail", + "scope" : "target", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "3371", + "type" : "ChoiceTypeSpecifier", + "type" : [ ], + "choice" : [ { + "localId" : "3372", + "name" : "{http://hl7.org/fhir}Quantity", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3373", + "name" : "{http://hl7.org/fhir}Range", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3374", + "name" : "{http://hl7.org/fhir}CodeableConcept", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3375", + "name" : "{http://hl7.org/fhir}string", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3376", + "name" : "{http://hl7.org/fhir}boolean", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3377", + "name" : "{http://hl7.org/fhir}integer", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3378", + "name" : "{http://hl7.org/fhir}Ratio", + "type" : "NamedTypeSpecifier" + } ] + } + }, + "asTypeSpecifier" : { + "localId" : "3379", + "locator" : "77:77-77:84", + "resultTypeName" : "{http://hl7.org/fhir}Quantity", + "name" : "{http://hl7.org/fhir}Quantity", + "type" : "NamedTypeSpecifier" + } + } ] }, { - "r" : "30", - "s" : [ { - "value" : [ "G" ] + "localId" : "3402", + "locator" : "78:21-78:61", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "name" : "RangeText", + "libraryName" : "DE", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "3382", + "locator" : "78:34-78:60", + "resultTypeName" : "{http://hl7.org/fhir}Range", + "strict" : false, + "type" : "As", + "signature" : [ ], + "operand" : { + "localId" : "3384", + "locator" : "78:34-78:46", + "path" : "detail", + "scope" : "target", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "3393", + "type" : "ChoiceTypeSpecifier", + "type" : [ ], + "choice" : [ { + "localId" : "3394", + "name" : "{http://hl7.org/fhir}Quantity", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3395", + "name" : "{http://hl7.org/fhir}Range", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3396", + "name" : "{http://hl7.org/fhir}CodeableConcept", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3397", + "name" : "{http://hl7.org/fhir}string", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3398", + "name" : "{http://hl7.org/fhir}boolean", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3399", + "name" : "{http://hl7.org/fhir}integer", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3400", + "name" : "{http://hl7.org/fhir}Ratio", + "type" : "NamedTypeSpecifier" + } ] + } + }, + "asTypeSpecifier" : { + "localId" : "3401", + "locator" : "78:51-78:60", + "resultTypeName" : "{http://hl7.org/fhir}Range", + "name" : "{http://hl7.org/fhir}Range", + "type" : "NamedTypeSpecifier" + } } ] }, { - "value" : [ ")" ] - } ] - } ] - } ] - } ] - } ] - } - } ], - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Category", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Description", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ExpressedBy", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "StartDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Target", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DueDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "TargetValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "LastResult", - "elementType" : { + "localId" : "3424", + "locator" : "79:21-79:68", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "name" : "ConceptText", + "libraryName" : "DE", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "3404", + "locator" : "79:36-79:67", + "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", + "strict" : false, + "type" : "As", + "signature" : [ ], + "operand" : { + "localId" : "3406", + "locator" : "79:36-79:48", + "path" : "detail", + "scope" : "target", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "3415", + "type" : "ChoiceTypeSpecifier", + "type" : [ ], + "choice" : [ { + "localId" : "3416", + "name" : "{http://hl7.org/fhir}Quantity", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3417", + "name" : "{http://hl7.org/fhir}Range", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3418", + "name" : "{http://hl7.org/fhir}CodeableConcept", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3419", + "name" : "{http://hl7.org/fhir}string", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3420", + "name" : "{http://hl7.org/fhir}boolean", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3421", + "name" : "{http://hl7.org/fhir}integer", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3422", + "name" : "{http://hl7.org/fhir}Ratio", + "type" : "NamedTypeSpecifier" + } ] + } + }, + "asTypeSpecifier" : { + "localId" : "3423", + "locator" : "79:53-79:67", + "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", + "name" : "{http://hl7.org/fhir}CodeableConcept", + "type" : "NamedTypeSpecifier" + } + } ] + }, { + "localId" : "3445", + "locator" : "80:21-80:56", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "path" : "value", + "type" : "Property", + "source" : { + "localId" : "3425", + "locator" : "80:21-80:50", + "resultTypeName" : "{http://hl7.org/fhir}string", + "strict" : false, + "type" : "As", + "signature" : [ ], + "operand" : { + "localId" : "3427", + "locator" : "80:22-80:34", + "path" : "detail", + "scope" : "target", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "3436", + "type" : "ChoiceTypeSpecifier", + "type" : [ ], + "choice" : [ { + "localId" : "3437", + "name" : "{http://hl7.org/fhir}Quantity", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3438", + "name" : "{http://hl7.org/fhir}Range", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3439", + "name" : "{http://hl7.org/fhir}CodeableConcept", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3440", + "name" : "{http://hl7.org/fhir}string", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3441", + "name" : "{http://hl7.org/fhir}boolean", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3442", + "name" : "{http://hl7.org/fhir}integer", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "3443", + "name" : "{http://hl7.org/fhir}Ratio", + "type" : "NamedTypeSpecifier" + } ] + } + }, + "asTypeSpecifier" : { + "localId" : "3444", + "locator" : "80:39-80:49", + "resultTypeName" : "{http://hl7.org/fhir}string", + "name" : "{http://hl7.org/fhir}string", + "type" : "NamedTypeSpecifier" + } + } + } ] + } + }, { + "name" : "LastResult", + "value" : { + "localId" : "3458", + "locator" : "81:19-81:80", + "name" : "ReportMostRecentResult", + "libraryName" : "DE", + "type" : "FunctionRef", + "resultTypeSpecifier" : { + "localId" : "3494", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "3495", "name" : "DisplayName", "elementType" : { + "localId" : "3496", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "3497", "name" : "ConceptName", "elementType" : { + "localId" : "3498", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "3499", "name" : "Date", "elementType" : { + "localId" : "3500", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "3501", "name" : "ResultText", "elementType" : { + "localId" : "3502", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "3503", "name" : "ResultValue", "elementType" : { + "localId" : "3504", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "type" : "NamedTypeSpecifier" } }, { + "localId" : "3505", "name" : "ResultUnits", "elementType" : { + "localId" : "3506", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "3507", "name" : "ReferenceRange", "elementType" : { + "localId" : "3508", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "3509", "name" : "Interpretation", "elementType" : { + "localId" : "3510", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "3511", "name" : "Flag", "elementType" : { + "localId" : "3512", "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier" } }, { + "localId" : "3513", "name" : "Performer", "elementType" : { + "localId" : "3514", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "3515", "name" : "Notes", "elementType" : { + "localId" : "3516", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3517", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { + "localId" : "3518", "name" : "Provenance", "elementType" : { + "localId" : "3519", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3520", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "3521", "name" : "Transmitter", "elementType" : { + "localId" : "3522", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3523", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { + "localId" : "3524", "name" : "Author", "elementType" : { + "localId" : "3525", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3526", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } @@ -6318,859 +7613,1558 @@ } } }, { + "localId" : "3527", "name" : "LearnMore", "elementType" : { + "localId" : "3528", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } ] - } - } ] - } + }, + "signature" : [ ], + "operand" : [ { + "localId" : "3453", + "locator" : "81:45-81:79", + "name" : "FindObservations", + "libraryName" : "DE", + "type" : "FunctionRef", + "resultTypeSpecifier" : { + "localId" : "3456", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "3457", + "name" : "{http://hl7.org/fhir}Observation", + "type" : "NamedTypeSpecifier" + } + }, + "signature" : [ ], + "operand" : [ { + "localId" : "3452", + "locator" : "81:65-81:78", + "resultTypeName" : "{http://hl7.org/fhir}CodeableConcept", + "path" : "measure", + "scope" : "target", + "type" : "Property" + } ] + } ] + } + } ] } + } + } + }, + "operand" : [ { + "localId" : "328", + "name" : "goal", + "operandTypeSpecifier" : { + "localId" : "327", + "locator" : "62:40-62:43", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "{http://hl7.org/fhir}Goal", + "type" : "NamedTypeSpecifier" + } + } ] + }, { + "localId" : "365", + "locator" : "142:1-148:3", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", + "name" : "DueDate", + "context" : "Patient", + "accessLevel" : "Public", + "type" : "FunctionDef", + "annotation" : [ { + "type" : "Annotation", + "s" : { + "r" : "365", + "s" : [ { + "value" : [ "// Returns Date from the first Goal target that has a due date.\n","define function DueDate(goal Goal):\n " ] }, { - "name" : "Addresses", + "r" : "4274", + "s" : [ { + "r" : "4274", + "s" : [ { + "value" : [ "First","(" ] + }, { + "r" : "4269", + "s" : [ { + "s" : [ { + "r" : "4243", + "s" : [ { + "r" : "4245", + "s" : [ { + "s" : [ { + "value" : [ "goal",".","target" ] + } ] + } ] + }, { + "value" : [ " ","target" ] + } ] + } ] + }, { + "value" : [ "\n // TODO if due is Duration, add that quantity to startDate\n " ] + }, { + "s" : [ { + "value" : [ "let " ] + }, { + "r" : "4250", + "s" : [ { + "value" : [ "due",": " ] + }, { + "r" : "4261", + "s" : [ { + "r" : "4251", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "4251", + "s" : [ { + "r" : "4253", + "s" : [ { + "r" : "4252", + "s" : [ { + "value" : [ "target" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "4253", + "s" : [ { + "value" : [ "due" ] + } ] + } ] + }, { + "value" : [ " as " ] + }, { + "r" : "4260", + "s" : [ { + "value" : [ "FHIR",".","date" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "4261", + "s" : [ { + "value" : [ "value" ] + } ] + } ] + } ] + } ] + }, { + "value" : [ "\n " ] + }, { + "r" : "4264", + "s" : [ { + "value" : [ "where " ] + }, { + "r" : "4264", + "s" : [ { + "r" : "4262", + "s" : [ { + "value" : [ "due" ] + } ] + }, { + "value" : [ " is not null" ] + } ] + } ] + }, { + "value" : [ "\n " ] + }, { + "r" : "4265", + "s" : [ { + "value" : [ "return " ] + }, { + "r" : "4266", + "s" : [ { + "value" : [ "due" ] + } ] + } ] + } ] + }, { + "value" : [ "\n )" ] + } ] + } ] + } ] + } + } ], + "expression" : { + "localId" : "4274", + "locator" : "143:3-148:3", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", + "type" : "First", + "signature" : [ ], + "source" : { + "localId" : "4269", + "locator" : "143:9-147:16", + "type" : "Query", + "resultTypeSpecifier" : { + "localId" : "4270", + "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4271", + "name" : "{urn:hl7-org:elm-types:r1}Date", + "type" : "NamedTypeSpecifier" + } + }, + "source" : [ { + "localId" : "4243", + "locator" : "143:9-143:26", + "alias" : "target", + "resultTypeSpecifier" : { + "localId" : "4248", "type" : "ListTypeSpecifier", "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" + "localId" : "4249", + "name" : "{http://hl7.org/fhir}Goal.Target", + "type" : "NamedTypeSpecifier" + } + }, + "expression" : { + "localId" : "4245", + "locator" : "143:9-143:19", + "path" : "target", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "4246", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "4247", + "name" : "{http://hl7.org/fhir}Goal.Target", + "type" : "NamedTypeSpecifier" + } + }, + "source" : { + "localId" : "4244", + "name" : "goal", + "type" : "OperandRef" + } + } + } ], + "let" : [ { + "localId" : "4250", + "locator" : "145:9-145:44", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", + "identifier" : "due", + "expression" : { + "localId" : "4261", + "locator" : "145:14-145:44", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", + "path" : "value", + "type" : "Property", + "source" : { + "localId" : "4251", + "locator" : "145:14-145:38", + "resultTypeName" : "{http://hl7.org/fhir}date", + "strict" : false, + "type" : "As", + "signature" : [ ], + "operand" : { + "localId" : "4253", + "locator" : "145:15-145:24", + "path" : "due", + "scope" : "target", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "4257", + "type" : "ChoiceTypeSpecifier", + "type" : [ ], + "choice" : [ { + "localId" : "4258", + "name" : "{http://hl7.org/fhir}date", + "type" : "NamedTypeSpecifier" + }, { + "localId" : "4259", + "name" : "{http://hl7.org/fhir}Duration", + "type" : "NamedTypeSpecifier" + } ] } - } ] + }, + "asTypeSpecifier" : { + "localId" : "4260", + "locator" : "145:29-145:37", + "resultTypeName" : "{http://hl7.org/fhir}date", + "name" : "{http://hl7.org/fhir}date", + "type" : "NamedTypeSpecifier" + } } } - }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" + } ], + "relationship" : [ ], + "where" : { + "localId" : "4264", + "locator" : "146:5-146:25", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Not", + "signature" : [ ], + "operand" : { + "localId" : "4263", + "locator" : "146:11-146:25", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "IsNull", + "signature" : [ ], + "operand" : { + "localId" : "4262", + "locator" : "146:11-146:13", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", + "name" : "due", + "type" : "QueryLetRef" } } - }, { - "name" : "Provenance", - "elementType" : { + }, + "return" : { + "localId" : "4265", + "locator" : "147:7-147:16", + "resultTypeSpecifier" : { + "localId" : "4267", "type" : "ListTypeSpecifier", "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - } ] + "localId" : "4268", + "name" : "{urn:hl7-org:elm-types:r1}Date", + "type" : "NamedTypeSpecifier" } + }, + "expression" : { + "localId" : "4266", + "locator" : "147:14-147:16", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", + "name" : "due", + "type" : "QueryLetRef" } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Overdue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - } ] + } } }, - "expression" : { - "localId" : "259", - "locator" : "41:3-42:24", - "type" : "Query", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Category", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Description", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ExpressedBy", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "StartDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Target", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DueDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "operand" : [ { + "localId" : "367", + "name" : "goal", + "operandTypeSpecifier" : { + "localId" : "366", + "locator" : "142:30-142:33", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "{http://hl7.org/fhir}Goal", + "type" : "NamedTypeSpecifier" + } + } ] + }, { + "localId" : "1248", + "locator" : "110:1-114:3", + "name" : "AddressesResources", + "context" : "Patient", + "accessLevel" : "Public", + "type" : "FunctionDef", + "annotation" : [ { + "type" : "Annotation", + "s" : { + "r" : "1248", + "s" : [ { + "value" : [ "// Returns a list of Resources that this Goal addresses\n","define function AddressesResources(goal Goal):\n " ] + }, { + "r" : "4054", + "s" : [ { + "r" : "4054", + "s" : [ { + "value" : [ "flatten" ] + }, { + "r" : "4119", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "4119", + "s" : [ { + "s" : [ { + "r" : "4055", + "s" : [ { + "r" : "4057", + "s" : [ { + "s" : [ { + "value" : [ "goal",".","addresses" ] + } ] + } ] + }, { + "value" : [ " ","GA" ] + } ] + } ] }, { - "name" : "TargetValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ "\n " ] }, { - "name" : "LastResult", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Performer", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "r" : "4062", + "s" : [ { + "value" : [ "return " ] + }, { + "r" : "4113", + "s" : [ { + "r" : "4085", + "s" : [ { + "value" : [ "CastToResources","(" ] + }, { + "r" : "4080", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "4080", + "s" : [ { + "s" : [ { + "r" : "4063", + "s" : [ { + "r" : "4064", + "s" : [ { + "r" : "4064", + "s" : [ { + "value" : [ "[","Condition","]" ] + } ] + } ] + }, { + "value" : [ " ","C" ] + } ] + } ] + }, { + "value" : [ " " ] + }, { + "r" : "4071", + "s" : [ { + "value" : [ "where " ] + }, { + "r" : "4071", + "s" : [ { + "r" : "4073", + "s" : [ { + "r" : "4072", + "s" : [ { + "value" : [ "C" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "4073", + "s" : [ { + "value" : [ "id" ] + } ] + } ] + }, { + "value" : [ " ","="," " ] + }, { + "r" : "4077", + "s" : [ { + "r" : "4074", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "4077", + "s" : [ { + "value" : [ "GetId","(" ] + }, { + "r" : "4076", + "s" : [ { + "r" : "4075", + "s" : [ { + "value" : [ "GA" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "4076", + "s" : [ { + "value" : [ "reference" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + }, { + "value" : [ ")" ] + } ] }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } + "value" : [ "\n union " ] }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } + "r" : "4110", + "s" : [ { + "value" : [ "CastToResources","(" ] + }, { + "r" : "4105", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "4105", + "s" : [ { + "s" : [ { + "r" : "4088", + "s" : [ { + "r" : "4089", + "s" : [ { + "r" : "4089", + "s" : [ { + "value" : [ "[","Observation","]" ] + } ] + } ] + }, { + "value" : [ " ","C" ] + } ] + } ] }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } + "value" : [ " " ] + }, { + "r" : "4096", + "s" : [ { + "value" : [ "where " ] + }, { + "r" : "4096", + "s" : [ { + "r" : "4098", + "s" : [ { + "r" : "4097", + "s" : [ { + "value" : [ "C" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "4098", + "s" : [ { + "value" : [ "id" ] + } ] + } ] + }, { + "value" : [ " ","="," " ] + }, { + "r" : "4102", + "s" : [ { + "r" : "4099", + "s" : [ { + "value" : [ "DE" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "4102", + "s" : [ { + "value" : [ "GetId","(" ] + }, { + "r" : "4101", + "s" : [ { + "r" : "4100", + "s" : [ { + "value" : [ "GA" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "4101", + "s" : [ { + "value" : [ "reference" ] + } ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } ] + } ] } ] - } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + }, { + "value" : [ ")" ] + } ] + }, { + "value" : [ ")" ] + } ] } ] - } - } ] - } - } - }, { - "name" : "Addresses", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } ] - } - } - }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } + } ] } ] - } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Overdue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } + }, { + "value" : [ "\n )" ] + } ] + } ] } ] + } ] + } + } ], + "resultTypeSpecifier" : { + "localId" : "4130", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "4131", + "name" : "{http://hl7.org/fhir}Resource", + "type" : "NamedTypeSpecifier" + } + }, + "expression" : { + "localId" : "4054", + "locator" : "111:3-114:3", + "type" : "Flatten", + "resultTypeSpecifier" : { + "localId" : "4128", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "4129", + "name" : "{http://hl7.org/fhir}Resource", + "type" : "NamedTypeSpecifier" } }, - "source" : [ { - "localId" : "29", - "locator" : "41:3-41:9", - "alias" : "G", + "signature" : [ ], + "operand" : { + "localId" : "4119", + "locator" : "111:10-114:3", + "type" : "Query", "resultTypeSpecifier" : { + "localId" : "4123", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{http://hl7.org/fhir}Goal", - "type" : "NamedTypeSpecifier" + "localId" : "4124", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "4125", + "name" : "{http://hl7.org/fhir}Resource", + "type" : "NamedTypeSpecifier" + } } }, - "expression" : { - "localId" : "28", - "locator" : "41:3-41:7", - "name" : "goals", - "type" : "OperandRef", + "source" : [ { + "localId" : "4055", + "locator" : "111:11-111:27", + "alias" : "GA", "resultTypeSpecifier" : { + "localId" : "4060", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{http://hl7.org/fhir}Goal", + "localId" : "4061", + "name" : "{http://hl7.org/fhir}Reference", "type" : "NamedTypeSpecifier" } - } - } - } ], - "relationship" : [ ], - "return" : { - "localId" : "258", - "locator" : "42:5-42:24", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Category", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Description", + }, + "expression" : { + "localId" : "4057", + "locator" : "111:11-111:24", + "path" : "addresses", + "type" : "Property", + "resultTypeSpecifier" : { + "localId" : "4058", + "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", + "localId" : "4059", + "name" : "{http://hl7.org/fhir}Reference", "type" : "NamedTypeSpecifier" } - }, { - "name" : "ExpressedBy", + }, + "source" : { + "localId" : "4056", + "name" : "goal", + "type" : "OperandRef" + } + } + } ], + "let" : [ ], + "relationship" : [ ], + "return" : { + "localId" : "4062", + "locator" : "112:5-113:82", + "resultTypeSpecifier" : { + "localId" : "4116", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "4117", + "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", + "localId" : "4118", + "name" : "{http://hl7.org/fhir}Resource", "type" : "NamedTypeSpecifier" } - }, { - "name" : "StartDate", + } + }, + "expression" : { + "localId" : "4113", + "locator" : "112:12-113:82", + "type" : "Union", + "resultTypeSpecifier" : { + "localId" : "4114", + "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", + "localId" : "4115", + "name" : "{http://hl7.org/fhir}Resource", "type" : "NamedTypeSpecifier" } - }, { - "name" : "Target", - "elementType" : { + }, + "signature" : [ ], + "operand" : [ { + "localId" : "4085", + "locator" : "112:12-112:79", + "name" : "CastToResources", + "type" : "FunctionRef", + "resultTypeSpecifier" : { + "localId" : "4086", "type" : "ListTypeSpecifier", "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DueDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "TargetValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "LastResult", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Performer", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - } ] - } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } ] - } - } ] + "localId" : "4087", + "name" : "{http://hl7.org/fhir}Resource", + "type" : "NamedTypeSpecifier" } - } - }, { - "name" : "Addresses", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", + }, + "signature" : [ ], + "operand" : [ { + "localId" : "4080", + "locator" : "112:28-112:78", + "type" : "Query", + "resultTypeSpecifier" : { + "localId" : "4083", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "4084", + "name" : "{http://hl7.org/fhir}Condition", + "type" : "NamedTypeSpecifier" + } + }, + "source" : [ { + "localId" : "4063", + "locator" : "112:29-112:41", + "alias" : "C", + "resultTypeSpecifier" : { + "localId" : "4069", + "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", + "localId" : "4070", + "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } + }, + "expression" : { + "localId" : "4064", + "locator" : "112:29-112:39", + "dataType" : "{http://hl7.org/fhir}Condition", + "templateId" : "http://hl7.org/fhir/StructureDefinition/Condition", + "type" : "Retrieve", + "resultTypeSpecifier" : { + "localId" : "4067", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "4068", + "name" : "{http://hl7.org/fhir}Condition", + "type" : "NamedTypeSpecifier" + } + }, + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } + } ], + "let" : [ ], + "relationship" : [ ], + "where" : { + "localId" : "4071", + "locator" : "112:43-112:77", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Equal", + "signature" : [ ], + "operand" : [ { + "localId" : "4079", + "name" : "ToString", + "libraryName" : "FHIRHelpers", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "4073", + "locator" : "112:49-112:52", + "resultTypeName" : "{http://hl7.org/fhir}id", + "path" : "id", + "scope" : "C", + "type" : "Property" + } ] + }, { + "localId" : "4077", + "locator" : "112:56-112:77", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "name" : "GetId", + "libraryName" : "DE", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "4078", + "name" : "ToString", + "libraryName" : "FHIRHelpers", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "4076", + "locator" : "112:65-112:76", + "resultTypeName" : "{http://hl7.org/fhir}string", + "path" : "reference", + "scope" : "GA", + "type" : "Property" + } ] + } ] } ] } - } + } ] }, { - "name" : "Notes", - "elementType" : { + "localId" : "4110", + "locator" : "113:13-113:82", + "name" : "CastToResources", + "type" : "FunctionRef", + "resultTypeSpecifier" : { + "localId" : "4111", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", + "localId" : "4112", + "name" : "{http://hl7.org/fhir}Resource", "type" : "NamedTypeSpecifier" } - } - }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", + }, + "signature" : [ ], + "operand" : [ { + "localId" : "4105", + "locator" : "113:29-113:81", + "type" : "Query", + "resultTypeSpecifier" : { + "localId" : "4108", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "4109", + "name" : "{http://hl7.org/fhir}Observation", + "type" : "NamedTypeSpecifier" + } + }, + "source" : [ { + "localId" : "4088", + "locator" : "113:30-113:44", + "alias" : "C", + "resultTypeSpecifier" : { + "localId" : "4094", + "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4095", + "name" : "{http://hl7.org/fhir}Observation", + "type" : "NamedTypeSpecifier" + } + }, + "expression" : { + "localId" : "4089", + "locator" : "113:30-113:42", + "dataType" : "{http://hl7.org/fhir}Observation", + "templateId" : "http://hl7.org/fhir/StructureDefinition/Observation", + "type" : "Retrieve", + "resultTypeSpecifier" : { + "localId" : "4092", "type" : "ListTypeSpecifier", "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", + "localId" : "4093", + "name" : "{http://hl7.org/fhir}Observation", "type" : "NamedTypeSpecifier" } - } + }, + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } + } ], + "let" : [ ], + "relationship" : [ ], + "where" : { + "localId" : "4096", + "locator" : "113:46-113:80", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Equal", + "signature" : [ ], + "operand" : [ { + "localId" : "4104", + "name" : "ToString", + "libraryName" : "FHIRHelpers", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "4098", + "locator" : "113:52-113:55", + "resultTypeName" : "{http://hl7.org/fhir}id", + "path" : "id", + "scope" : "C", + "type" : "Property" + } ] + }, { + "localId" : "4102", + "locator" : "113:59-113:80", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "name" : "GetId", + "libraryName" : "DE", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "4103", + "name" : "ToString", + "libraryName" : "FHIRHelpers", + "type" : "FunctionRef", + "signature" : [ ], + "operand" : [ { + "localId" : "4101", + "locator" : "113:68-113:79", + "resultTypeName" : "{http://hl7.org/fhir}string", + "path" : "reference", + "scope" : "GA", + "type" : "Property" + } ] + } ] + } ] + } + } ] + } ] + } + } + } + }, + "operand" : [ { + "localId" : "1250", + "name" : "goal", + "operandTypeSpecifier" : { + "localId" : "1249", + "locator" : "110:41-110:44", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "{http://hl7.org/fhir}Goal", + "type" : "NamedTypeSpecifier" + } + } ] + }, { + "localId" : "1283", + "locator" : "119:1-121:22", + "name" : "CastToResources", + "context" : "Patient", + "accessLevel" : "Public", + "type" : "FunctionDef", + "annotation" : [ { + "type" : "Annotation", + "s" : { + "r" : "1283", + "s" : [ { + "value" : [ "// Takes a list of Condition, Observation, ServiceRequest, etc. and cast to List\n// to enable union into generalized List\n// Otherwise, union returns, e.g. list>)\n","define function CastToResources(items List):\n " ] + }, { + "r" : "4144", + "s" : [ { + "r" : "4144", + "s" : [ { + "s" : [ { + "r" : "4132", + "s" : [ { + "r" : "4133", + "s" : [ { + "s" : [ { + "value" : [ "items" ] + } ] + } ] + }, { + "value" : [ " ","r" ] + } ] + } ] + }, { + "value" : [ "\n " ] + }, { + "r" : "4138", + "s" : [ { + "value" : [ "return " ] + }, { + "r" : "4139", + "s" : [ { + "r" : "4140", + "s" : [ { + "value" : [ "r" ] + } ] + }, { + "value" : [ " as " ] + }, { + "r" : "4141", + "s" : [ { + "value" : [ "Resource" ] + } ] + } ] + } ] + } ] + } ] + } ] + } + } ], + "resultTypeSpecifier" : { + "localId" : "4149", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "4150", + "name" : "{http://hl7.org/fhir}Resource", + "type" : "NamedTypeSpecifier" + } + }, + "expression" : { + "localId" : "4144", + "locator" : "120:2-121:22", + "type" : "Query", + "resultTypeSpecifier" : { + "localId" : "4147", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "4148", + "name" : "{http://hl7.org/fhir}Resource", + "type" : "NamedTypeSpecifier" + } + }, + "source" : [ { + "localId" : "4132", + "locator" : "120:2-120:8", + "alias" : "r", + "resultTypeSpecifier" : { + "localId" : "4136", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "4137", + "name" : "{http://hl7.org/fhir}Resource", + "type" : "NamedTypeSpecifier" + } + }, + "expression" : { + "localId" : "4133", + "locator" : "120:2-120:6", + "name" : "items", + "type" : "OperandRef", + "resultTypeSpecifier" : { + "localId" : "4134", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "4135", + "name" : "{http://hl7.org/fhir}Resource", + "type" : "NamedTypeSpecifier" + } + } + } + } ], + "let" : [ ], + "relationship" : [ ], + "return" : { + "localId" : "4138", + "locator" : "121:3-121:22", + "resultTypeSpecifier" : { + "localId" : "4142", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "4143", + "name" : "{http://hl7.org/fhir}Resource", + "type" : "NamedTypeSpecifier" + } + }, + "expression" : { + "localId" : "4139", + "locator" : "121:10-121:22", + "resultTypeName" : "{http://hl7.org/fhir}Resource", + "strict" : false, + "type" : "As", + "signature" : [ ], + "operand" : { + "localId" : "4140", + "locator" : "121:10", + "resultTypeName" : "{http://hl7.org/fhir}Resource", + "name" : "r", + "type" : "AliasRef" + }, + "asTypeSpecifier" : { + "localId" : "4141", + "locator" : "121:15-121:22", + "resultTypeName" : "{http://hl7.org/fhir}Resource", + "name" : "{http://hl7.org/fhir}Resource", + "type" : "NamedTypeSpecifier" + } + } + } + }, + "operand" : [ { + "localId" : "1288", + "name" : "items", + "operandTypeSpecifier" : { + "localId" : "1284", + "locator" : "119:39-119:52", + "type" : "ListTypeSpecifier", + "resultTypeSpecifier" : { + "localId" : "1286", + "type" : "ListTypeSpecifier", + "elementType" : { + "localId" : "1287", + "name" : "{http://hl7.org/fhir}Resource", + "type" : "NamedTypeSpecifier" + } + }, + "elementType" : { + "localId" : "1285", + "locator" : "119:44-119:51", + "resultTypeName" : "{http://hl7.org/fhir}Resource", + "name" : "{http://hl7.org/fhir}Resource", + "type" : "NamedTypeSpecifier" + } + } + } ] + }, { + "localId" : "1373", + "locator" : "150:1-162:5", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "name" : "LifecycleStatusText", + "context" : "Patient", + "accessLevel" : "Public", + "type" : "FunctionDef", + "annotation" : [ { + "type" : "Annotation", + "s" : { + "r" : "1373", + "s" : [ { + "value" : [ "","define function LifecycleStatusText(g Goal):\n " ] + }, { + "r" : "4275", + "s" : [ { + "r" : "4275", + "s" : [ { + "value" : [ "case\n " ] + }, { + "r" : "4276", + "s" : [ { + "value" : [ "when " ] + }, { + "r" : "4277", + "s" : [ { + "r" : "4280", + "s" : [ { + "r" : "4279", + "s" : [ { + "r" : "4278", + "s" : [ { + "value" : [ "g" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "4279", + "s" : [ { + "value" : [ "lifecycleStatus" ] + } ] + } ] }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } + "value" : [ "." ] + }, { + "r" : "4280", + "s" : [ { + "value" : [ "value" ] + } ] } ] - } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Overdue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - } ] - } - }, - "expression" : { - "localId" : "257", - "locator" : "42:12-42:24", - "name" : "ReportGoal", - "type" : "FunctionRef", - "resultTypeSpecifier" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Category", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Description", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ExpressedBy", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + }, { + "value" : [ " ","="," " ] + }, { + "r" : "4281", + "s" : [ { + "value" : [ "'active'" ] + } ] + } ] + }, { + "value" : [ " then\n " ] + }, { + "r" : "4282", + "s" : [ { + "value" : [ "'Active'" ] + } ] + } ] }, { - "name" : "StartDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ "\n " ] }, { - "name" : "Target", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DueDate", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "r" : "4283", + "s" : [ { + "value" : [ "when " ] + }, { + "r" : "4284", + "s" : [ { + "r" : "4287", + "s" : [ { + "r" : "4286", + "s" : [ { + "r" : "4285", + "s" : [ { + "value" : [ "g" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "4286", + "s" : [ { + "value" : [ "lifecycleStatus" ] + } ] + } ] }, { - "name" : "TargetValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ "." ] }, { - "name" : "LastResult", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ConceptName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Date", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultText", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultValue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ResultUnits", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "ReferenceRange", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Interpretation", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Flag", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Performer", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } - } ] - } - } - }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } ] - } + "r" : "4287", + "s" : [ { + "value" : [ "value" ] + } ] } ] - } - } + }, { + "value" : [ " ","="," " ] + }, { + "r" : "4288", + "s" : [ { + "value" : [ "'completed'" ] + } ] + } ] + }, { + "value" : [ " then\n " ] + }, { + "r" : "4289", + "s" : [ { + "value" : [ "'Completed'" ] + } ] + } ] }, { - "name" : "Addresses", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "DisplayName", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ "\n " ] + }, { + "r" : "4290", + "s" : [ { + "value" : [ "when " ] + }, { + "r" : "4291", + "s" : [ { + "r" : "4294", + "s" : [ { + "r" : "4293", + "s" : [ { + "r" : "4292", + "s" : [ { + "value" : [ "g" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "4293", + "s" : [ { + "value" : [ "lifecycleStatus" ] + } ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "4294", + "s" : [ { + "value" : [ "value" ] + } ] } ] - } - } + }, { + "value" : [ " ","="," " ] + }, { + "r" : "4295", + "s" : [ { + "value" : [ "'cancelled'" ] + } ] + } ] + }, { + "value" : [ " then\n " ] + }, { + "r" : "4296", + "s" : [ { + "value" : [ "'Cancelled'" ] + } ] + } ] }, { - "name" : "Notes", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } + "value" : [ "\n " ] }, { - "name" : "Provenance", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "type" : "TupleTypeSpecifier", - "element" : [ { - "name" : "Transmitter", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } + "r" : "4297", + "s" : [ { + "value" : [ "when " ] + }, { + "r" : "4298", + "s" : [ { + "r" : "4301", + "s" : [ { + "r" : "4300", + "s" : [ { + "r" : "4299", + "s" : [ { + "value" : [ "g" ] + } ] + }, { + "value" : [ "." ] + }, { + "r" : "4300", + "s" : [ { + "value" : [ "lifecycleStatus" ] + } ] + } ] }, { - "name" : "Author", - "elementType" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } - } + "value" : [ "." ] + }, { + "r" : "4301", + "s" : [ { + "value" : [ "value" ] + } ] } ] - } - } + }, { + "value" : [ " ","="," " ] + }, { + "r" : "4302", + "s" : [ { + "value" : [ "'on-hold'" ] + } ] + } ] + }, { + "value" : [ " then\n " ] + }, { + "r" : "4303", + "s" : [ { + "value" : [ "'On Hold'" ] + } ] + } ] }, { - "name" : "LearnMore", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}String", - "type" : "NamedTypeSpecifier" - } + "value" : [ "\n else\n " ] }, { - "name" : "Overdue", - "elementType" : { - "name" : "{urn:hl7-org:elm-types:r1}Boolean", - "type" : "NamedTypeSpecifier" - } + "r" : "4304", + "s" : [ { + "value" : [ "'Unknown'" ] + } ] + }, { + "value" : [ "\n end" ] } ] - }, + } ] + } ] + } + } ], + "expression" : { + "localId" : "4275", + "locator" : "151:3-162:5", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "type" : "Case", + "caseItem" : [ { + "localId" : "4276", + "locator" : "152:5-153:14", + "when" : { + "localId" : "4277", + "locator" : "152:10-152:43", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Equal", + "signature" : [ ], "operand" : [ { - "localId" : "30", - "locator" : "42:23", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "G", - "type" : "AliasRef" + "localId" : "4280", + "locator" : "152:10-152:32", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "path" : "value", + "type" : "Property", + "source" : { + "localId" : "4279", + "locator" : "152:10-152:26", + "resultTypeName" : "{http://hl7.org/fhir}GoalLifecycleStatus", + "path" : "lifecycleStatus", + "type" : "Property", + "source" : { + "localId" : "4278", + "locator" : "152:10", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "g", + "type" : "OperandRef" + } + } + }, { + "localId" : "4281", + "locator" : "152:36-152:43", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "active", + "type" : "Literal" + } ] + }, + "then" : { + "localId" : "4282", + "locator" : "153:7-153:14", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "Active", + "type" : "Literal" + } + }, { + "localId" : "4283", + "locator" : "154:5-155:17", + "when" : { + "localId" : "4284", + "locator" : "154:10-154:46", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Equal", + "signature" : [ ], + "operand" : [ { + "localId" : "4287", + "locator" : "154:10-154:32", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "path" : "value", + "type" : "Property", + "source" : { + "localId" : "4286", + "locator" : "154:10-154:26", + "resultTypeName" : "{http://hl7.org/fhir}GoalLifecycleStatus", + "path" : "lifecycleStatus", + "type" : "Property", + "source" : { + "localId" : "4285", + "locator" : "154:10", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "g", + "type" : "OperandRef" + } + } + }, { + "localId" : "4288", + "locator" : "154:36-154:46", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "completed", + "type" : "Literal" + } ] + }, + "then" : { + "localId" : "4289", + "locator" : "155:7-155:17", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "Completed", + "type" : "Literal" + } + }, { + "localId" : "4290", + "locator" : "156:5-157:17", + "when" : { + "localId" : "4291", + "locator" : "156:10-156:46", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Equal", + "signature" : [ ], + "operand" : [ { + "localId" : "4294", + "locator" : "156:10-156:32", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "path" : "value", + "type" : "Property", + "source" : { + "localId" : "4293", + "locator" : "156:10-156:26", + "resultTypeName" : "{http://hl7.org/fhir}GoalLifecycleStatus", + "path" : "lifecycleStatus", + "type" : "Property", + "source" : { + "localId" : "4292", + "locator" : "156:10", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "g", + "type" : "OperandRef" + } + } + }, { + "localId" : "4295", + "locator" : "156:36-156:46", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "cancelled", + "type" : "Literal" } ] + }, + "then" : { + "localId" : "4296", + "locator" : "157:7-157:17", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "Cancelled", + "type" : "Literal" + } + }, { + "localId" : "4297", + "locator" : "158:5-159:15", + "when" : { + "localId" : "4298", + "locator" : "158:10-158:44", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "type" : "Equal", + "signature" : [ ], + "operand" : [ { + "localId" : "4301", + "locator" : "158:10-158:32", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "path" : "value", + "type" : "Property", + "source" : { + "localId" : "4300", + "locator" : "158:10-158:26", + "resultTypeName" : "{http://hl7.org/fhir}GoalLifecycleStatus", + "path" : "lifecycleStatus", + "type" : "Property", + "source" : { + "localId" : "4299", + "locator" : "158:10", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "g", + "type" : "OperandRef" + } + } + }, { + "localId" : "4302", + "locator" : "158:36-158:44", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "on-hold", + "type" : "Literal" + } ] + }, + "then" : { + "localId" : "4303", + "locator" : "159:7-159:15", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "On Hold", + "type" : "Literal" } + } ], + "else" : { + "localId" : "4304", + "locator" : "161:7-161:15", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "Unknown", + "type" : "Literal" } }, "operand" : [ { - "name" : "goals", + "localId" : "1375", + "name" : "g", "operandTypeSpecifier" : { - "localId" : "27", - "locator" : "40:35-40:44", - "type" : "ListTypeSpecifier", - "resultTypeSpecifier" : { - "type" : "ListTypeSpecifier", - "elementType" : { - "name" : "{http://hl7.org/fhir}Goal", - "type" : "NamedTypeSpecifier" - } - }, - "elementType" : { - "localId" : "26", - "locator" : "40:40-40:43", - "resultTypeName" : "{http://hl7.org/fhir}Goal", - "name" : "{http://hl7.org/fhir}Goal", - "type" : "NamedTypeSpecifier" - } + "localId" : "1374", + "locator" : "150:39-150:42", + "resultTypeName" : "{http://hl7.org/fhir}Goal", + "name" : "{http://hl7.org/fhir}Goal", + "type" : "NamedTypeSpecifier" } } ] }, { - "localId" : "262", - "locator" : "31:1-34:3", + "localId" : "215", + "locator" : "33:1-36:3", "name" : "GoalSummary", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "s" : { - "r" : "262", + "r" : "215", "s" : [ { - "value" : [ "/*\nexport interface GoalSummary {\n Category?: string,\n Description: string,\n ExpressedBy?: string,\n StartDate?: string,\n Target?: GoalTarget[],\n Notes?: string[],\n Addresses?: ConditionSummary[],\n LearnMore?: string\n}\n\nexport interface GoalTarget {\n DueDate?: string,\n DisplayName?: string,\n TargetValue?: string,\n LastResult?: ObservationSummary,\n}\n*/\n","define ","GoalSummary",":\n " ] + "value" : [ "/*\nexport interface GoalSummary {\n Category?: string,\n Description: string,\n ExpressedBy?: string,\n StartDate?: string,\n Target?: GoalTarget[],\n LifecycleStatus?: string,\n AchievementStatus?: string,\n Notes?: string[],\n Addresses?: ConditionSummary[],\n LearnMore?: string\n}\n\nexport interface GoalTarget {\n DueDate?: string,\n DisplayName?: string,\n TargetValue?: string,\n LastResult?: ObservationSummary,\n}\n*/\n\n","define ","GoalSummary",":\n " ] }, { - "r" : "261", + "r" : "269", "s" : [ { "value" : [ "ReportGoals","(\n " ] }, { - "r" : "25", + "r" : "260", "s" : [ { "s" : [ { - "r" : "18", + "r" : "216", "s" : [ { - "r" : "17", + "r" : "243", "s" : [ { "s" : [ { "value" : [ "\"Active Goals\"" ] @@ -7183,28 +9177,28 @@ }, { "value" : [ " " ] }, { - "r" : "24", + "r" : "256", "s" : [ { "value" : [ "sort by " ] }, { - "r" : "23", + "r" : "255", "s" : [ { - "r" : "22", + "r" : "254", "s" : [ { - "r" : "21", + "r" : "248", "s" : [ { "value" : [ "(" ] }, { - "r" : "21", + "r" : "248", "s" : [ { - "r" : "19", + "r" : "249", "s" : [ { "value" : [ "start" ] } ] }, { "value" : [ " as " ] }, { - "r" : "20", + "r" : "253", "s" : [ { "value" : [ "FHIR",".","date" ] } ] @@ -7215,7 +9209,7 @@ }, { "value" : [ "." ] }, { - "r" : "22", + "r" : "254", "s" : [ { "value" : [ "value" ] } ] @@ -7232,150 +9226,203 @@ } } ], "resultTypeSpecifier" : { + "localId" : "2017", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2018", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "2019", "name" : "Category", "elementType" : { + "localId" : "2020", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2021", "name" : "Description", "elementType" : { + "localId" : "2022", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2023", "name" : "ExpressedBy", "elementType" : { + "localId" : "2024", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2025", "name" : "StartDate", "elementType" : { + "localId" : "2026", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2027", "name" : "Target", "elementType" : { + "localId" : "2028", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2029", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "2030", "name" : "DueDate", "elementType" : { + "localId" : "2031", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2032", "name" : "DisplayName", "elementType" : { + "localId" : "2033", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2034", "name" : "TargetValue", "elementType" : { + "localId" : "2035", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2036", "name" : "LastResult", "elementType" : { + "localId" : "2037", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "2038", "name" : "DisplayName", "elementType" : { + "localId" : "2039", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2040", "name" : "ConceptName", "elementType" : { + "localId" : "2041", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2042", "name" : "Date", "elementType" : { + "localId" : "2043", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2044", "name" : "ResultText", "elementType" : { + "localId" : "2045", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2046", "name" : "ResultValue", "elementType" : { + "localId" : "2047", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2048", "name" : "ResultUnits", "elementType" : { + "localId" : "2049", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2050", "name" : "ReferenceRange", "elementType" : { + "localId" : "2051", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2052", "name" : "Interpretation", "elementType" : { + "localId" : "2053", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2054", "name" : "Flag", "elementType" : { + "localId" : "2055", "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2056", "name" : "Performer", "elementType" : { + "localId" : "2057", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2058", "name" : "Notes", "elementType" : { + "localId" : "2059", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2060", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { + "localId" : "2061", "name" : "Provenance", "elementType" : { + "localId" : "2062", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2063", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "2064", "name" : "Transmitter", "elementType" : { + "localId" : "2065", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2066", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { + "localId" : "2067", "name" : "Author", "elementType" : { + "localId" : "2068", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2069", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } @@ -7384,8 +9431,10 @@ } } }, { + "localId" : "2070", "name" : "LearnMore", "elementType" : { + "localId" : "2071", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } @@ -7395,14 +9444,19 @@ } } }, { + "localId" : "2072", "name" : "Addresses", "elementType" : { + "localId" : "2073", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2074", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "2075", "name" : "DisplayName", "elementType" : { + "localId" : "2076", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } @@ -7410,34 +9464,62 @@ } } }, { + "localId" : "2077", + "name" : "LifecycleStatus", + "elementType" : { + "localId" : "2078", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2079", + "name" : "AchievementStatus", + "elementType" : { + "localId" : "2080", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2081", "name" : "Notes", "elementType" : { + "localId" : "2082", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2083", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { + "localId" : "2084", "name" : "Provenance", "elementType" : { + "localId" : "2085", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2086", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "2087", "name" : "Transmitter", "elementType" : { + "localId" : "2088", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2089", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { + "localId" : "2090", "name" : "Author", "elementType" : { + "localId" : "2091", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2092", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } @@ -7446,14 +9528,18 @@ } } }, { + "localId" : "2093", "name" : "LearnMore", "elementType" : { + "localId" : "2094", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2095", "name" : "Overdue", "elementType" : { + "localId" : "2096", "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier" } @@ -7461,155 +9547,208 @@ } }, "expression" : { - "localId" : "261", - "locator" : "32:3-34:3", + "localId" : "269", + "locator" : "34:3-36:3", "name" : "ReportGoals", "type" : "FunctionRef", "resultTypeSpecifier" : { + "localId" : "1937", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "1938", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "1939", "name" : "Category", "elementType" : { + "localId" : "1940", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1941", "name" : "Description", "elementType" : { + "localId" : "1942", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1943", "name" : "ExpressedBy", "elementType" : { + "localId" : "1944", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1945", "name" : "StartDate", "elementType" : { + "localId" : "1946", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1947", "name" : "Target", "elementType" : { + "localId" : "1948", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "1949", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "1950", "name" : "DueDate", "elementType" : { + "localId" : "1951", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1952", "name" : "DisplayName", "elementType" : { + "localId" : "1953", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1954", "name" : "TargetValue", "elementType" : { + "localId" : "1955", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1956", "name" : "LastResult", "elementType" : { + "localId" : "1957", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "1958", "name" : "DisplayName", "elementType" : { + "localId" : "1959", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1960", "name" : "ConceptName", "elementType" : { + "localId" : "1961", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1962", "name" : "Date", "elementType" : { + "localId" : "1963", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1964", "name" : "ResultText", "elementType" : { + "localId" : "1965", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1966", "name" : "ResultValue", "elementType" : { + "localId" : "1967", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1968", "name" : "ResultUnits", "elementType" : { + "localId" : "1969", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1970", "name" : "ReferenceRange", "elementType" : { + "localId" : "1971", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1972", "name" : "Interpretation", "elementType" : { + "localId" : "1973", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1974", "name" : "Flag", "elementType" : { + "localId" : "1975", "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1976", "name" : "Performer", "elementType" : { + "localId" : "1977", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "1978", "name" : "Notes", "elementType" : { + "localId" : "1979", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "1980", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { + "localId" : "1981", "name" : "Provenance", "elementType" : { + "localId" : "1982", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "1983", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "1984", "name" : "Transmitter", "elementType" : { + "localId" : "1985", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "1986", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { + "localId" : "1987", "name" : "Author", "elementType" : { + "localId" : "1988", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "1989", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } @@ -7618,8 +9757,10 @@ } } }, { + "localId" : "1990", "name" : "LearnMore", "elementType" : { + "localId" : "1991", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } @@ -7629,14 +9770,19 @@ } } }, { + "localId" : "1992", "name" : "Addresses", "elementType" : { + "localId" : "1993", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "1994", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "1995", "name" : "DisplayName", "elementType" : { + "localId" : "1996", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } @@ -7644,34 +9790,62 @@ } } }, { + "localId" : "1997", + "name" : "LifecycleStatus", + "elementType" : { + "localId" : "1998", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "1999", + "name" : "AchievementStatus", + "elementType" : { + "localId" : "2000", + "name" : "{urn:hl7-org:elm-types:r1}String", + "type" : "NamedTypeSpecifier" + } + }, { + "localId" : "2001", "name" : "Notes", "elementType" : { + "localId" : "2002", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2003", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { + "localId" : "2004", "name" : "Provenance", "elementType" : { + "localId" : "2005", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2006", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "2007", "name" : "Transmitter", "elementType" : { + "localId" : "2008", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2009", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { + "localId" : "2010", "name" : "Author", "elementType" : { + "localId" : "2011", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "2012", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } @@ -7680,97 +9854,114 @@ } } }, { + "localId" : "2013", "name" : "LearnMore", "elementType" : { + "localId" : "2014", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "2015", "name" : "Overdue", "elementType" : { + "localId" : "2016", "name" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "NamedTypeSpecifier" } } ] } }, + "signature" : [ ], "operand" : [ { - "localId" : "25", - "locator" : "33:5-33:66", + "localId" : "260", + "locator" : "35:5-35:66", "type" : "Query", "resultTypeSpecifier" : { + "localId" : "261", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "262", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } }, "source" : [ { - "localId" : "18", - "locator" : "33:5-33:20", + "localId" : "216", + "locator" : "35:5-35:20", "alias" : "G", "resultTypeSpecifier" : { + "localId" : "246", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "247", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "17", - "locator" : "33:5-33:18", + "localId" : "243", + "locator" : "35:5-35:18", "name" : "Active Goals", "type" : "ExpressionRef", "resultTypeSpecifier" : { + "localId" : "244", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "245", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } } } } ], + "let" : [ ], "relationship" : [ ], "sort" : { - "localId" : "24", - "locator" : "33:22-33:66", + "localId" : "256", + "locator" : "35:22-35:66", "by" : [ { - "localId" : "23", - "locator" : "33:30-33:66", + "localId" : "255", + "locator" : "35:30-35:66", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", "direction" : "descending", "type" : "ByExpression", "expression" : { - "localId" : "22", - "locator" : "33:30-33:55", + "localId" : "254", + "locator" : "35:30-35:55", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Date", "path" : "value", "type" : "Property", "source" : { - "localId" : "21", - "locator" : "33:30-33:49", + "localId" : "248", + "locator" : "35:30-35:49", "resultTypeName" : "{http://hl7.org/fhir}date", "strict" : false, "type" : "As", + "signature" : [ ], "operand" : { - "localId" : "19", - "locator" : "33:31-33:35", + "localId" : "249", + "locator" : "35:31-35:35", "name" : "start", "type" : "IdentifierRef", "resultTypeSpecifier" : { + "localId" : "250", "type" : "ChoiceTypeSpecifier", + "type" : [ ], "choice" : [ { + "localId" : "251", "name" : "{http://hl7.org/fhir}date", "type" : "NamedTypeSpecifier" }, { + "localId" : "252", "name" : "{http://hl7.org/fhir}CodeableConcept", "type" : "NamedTypeSpecifier" } ] } }, "asTypeSpecifier" : { - "localId" : "20", - "locator" : "33:40-33:48", + "localId" : "253", + "locator" : "35:40-35:48", "resultTypeName" : "{http://hl7.org/fhir}date", "name" : "{http://hl7.org/fhir}date", "type" : "NamedTypeSpecifier" @@ -7782,8 +9973,8 @@ } ] } }, { - "localId" : "288", - "locator" : "120:1-123:50", + "localId" : "3805", + "locator" : "124:1-127:50", "name" : "HasGoals", "context" : "Patient", "accessLevel" : "Public", @@ -7791,27 +9982,20 @@ "annotation" : [ { "type" : "Annotation", "s" : { - "r" : "288", + "r" : "3805", "s" : [ { - "value" : [ "// Returns a list of Goals that address this Condition\n","define function ","HasGoals","(","condition"," " ] - }, { - "r" : "273", - "s" : [ { - "value" : [ "Condition" ] - } ] - }, { - "value" : [ "):\n " ] + "value" : [ "// Returns a list of Goals that address this Condition\n","define function HasGoals(condition Condition):\n " ] }, { - "r" : "287", + "r" : "4181", "s" : [ { - "r" : "287", + "r" : "4181", "s" : [ { "s" : [ { - "r" : "275", + "r" : "4151", "s" : [ { - "r" : "274", + "r" : "4152", "s" : [ { - "r" : "274", + "r" : "4152", "s" : [ { "value" : [ "[","Goal","]" ] } ] @@ -7823,24 +10007,24 @@ }, { "value" : [ "\n " ] }, { - "r" : "286", + "r" : "4159", "s" : [ { "value" : [ "where " ] }, { - "r" : "286", + "r" : "4159", "s" : [ { "value" : [ "exists" ] }, { - "r" : "285", + "r" : "4176", "s" : [ { "value" : [ "(" ] }, { - "r" : "285", + "r" : "4176", "s" : [ { "s" : [ { - "r" : "277", + "r" : "4160", "s" : [ { - "r" : "276", + "r" : "4162", "s" : [ { "s" : [ { "value" : [ "goal",".","addresses" ] @@ -7853,22 +10037,22 @@ }, { "value" : [ "\n " ] }, { - "r" : "284", + "r" : "4167", "s" : [ { "value" : [ "where " ] }, { - "r" : "284", + "r" : "4167", "s" : [ { - "r" : "279", + "r" : "4169", "s" : [ { - "r" : "278", + "r" : "4168", "s" : [ { "value" : [ "condition" ] } ] }, { "value" : [ "." ] }, { - "r" : "279", + "r" : "4169", "s" : [ { "value" : [ "id" ] } ] @@ -7876,29 +10060,29 @@ }, { "value" : [ " ","="," " ] }, { - "r" : "283", + "r" : "4173", "s" : [ { - "r" : "280", + "r" : "4170", "s" : [ { "value" : [ "DE" ] } ] }, { "value" : [ "." ] }, { - "r" : "283", + "r" : "4173", "s" : [ { "value" : [ "GetId","(" ] }, { - "r" : "282", + "r" : "4172", "s" : [ { - "r" : "281", + "r" : "4171", "s" : [ { "value" : [ "GA" ] } ] }, { "value" : [ "." ] }, { - "r" : "282", + "r" : "4172", "s" : [ { "value" : [ "reference" ] } ] @@ -7921,130 +10105,157 @@ } } ], "resultTypeSpecifier" : { + "localId" : "4186", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4187", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "287", - "locator" : "121:3-123:50", + "localId" : "4181", + "locator" : "125:3-127:50", "type" : "Query", "resultTypeSpecifier" : { + "localId" : "4184", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4185", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } }, "source" : [ { - "localId" : "275", - "locator" : "121:3-121:13", + "localId" : "4151", + "locator" : "125:3-125:13", "alias" : "goal", "resultTypeSpecifier" : { + "localId" : "4157", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4158", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "274", - "locator" : "121:3-121:8", + "localId" : "4152", + "locator" : "125:3-125:8", "dataType" : "{http://hl7.org/fhir}Goal", "templateId" : "http://hl7.org/fhir/StructureDefinition/Goal", "type" : "Retrieve", "resultTypeSpecifier" : { + "localId" : "4155", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4156", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } - } + }, + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } } ], + "let" : [ ], "relationship" : [ ], "where" : { - "localId" : "286", - "locator" : "122:5-123:50", + "localId" : "4159", + "locator" : "126:5-127:50", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "Exists", + "signature" : [ ], "operand" : { - "localId" : "285", - "locator" : "122:17-123:50", + "localId" : "4176", + "locator" : "126:17-127:50", "type" : "Query", "resultTypeSpecifier" : { + "localId" : "4179", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4180", "name" : "{http://hl7.org/fhir}Reference", "type" : "NamedTypeSpecifier" } }, "source" : [ { - "localId" : "277", - "locator" : "122:18-122:34", + "localId" : "4160", + "locator" : "126:18-126:34", "alias" : "GA", "resultTypeSpecifier" : { + "localId" : "4165", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4166", "name" : "{http://hl7.org/fhir}Reference", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "276", - "locator" : "122:18-122:31", + "localId" : "4162", + "locator" : "126:18-126:31", "path" : "addresses", "scope" : "goal", "type" : "Property", "resultTypeSpecifier" : { + "localId" : "4163", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4164", "name" : "{http://hl7.org/fhir}Reference", "type" : "NamedTypeSpecifier" } } } } ], + "let" : [ ], "relationship" : [ ], "where" : { - "localId" : "284", - "locator" : "123:7-123:49", + "localId" : "4167", + "locator" : "127:7-127:49", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "Equal", + "signature" : [ ], "operand" : [ { + "localId" : "4175", "name" : "ToString", "libraryName" : "FHIRHelpers", "type" : "FunctionRef", + "signature" : [ ], "operand" : [ { - "localId" : "279", - "locator" : "123:13-123:24", + "localId" : "4169", + "locator" : "127:13-127:24", "resultTypeName" : "{http://hl7.org/fhir}id", "path" : "id", "type" : "Property", "source" : { - "localId" : "278", - "locator" : "123:13-123:21", + "localId" : "4168", + "locator" : "127:13-127:21", "resultTypeName" : "{http://hl7.org/fhir}Condition", "name" : "condition", "type" : "OperandRef" } } ] }, { - "localId" : "283", - "locator" : "123:28-123:49", + "localId" : "4173", + "locator" : "127:28-127:49", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "name" : "GetId", "libraryName" : "DE", "type" : "FunctionRef", + "signature" : [ ], "operand" : [ { + "localId" : "4174", "name" : "ToString", "libraryName" : "FHIRHelpers", "type" : "FunctionRef", + "signature" : [ ], "operand" : [ { - "localId" : "282", - "locator" : "123:37-123:48", + "localId" : "4172", + "locator" : "127:37-127:48", "resultTypeName" : "{http://hl7.org/fhir}string", "path" : "reference", "scope" : "GA", @@ -8057,36 +10268,37 @@ } }, "operand" : [ { + "localId" : "3807", "name" : "condition", "operandTypeSpecifier" : { - "localId" : "273", - "locator" : "120:36-120:44", + "localId" : "3806", + "locator" : "124:36-124:44", "resultTypeName" : "{http://hl7.org/fhir}Condition", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } } ] }, { - "localId" : "292", - "locator" : "80:1-82:36", + "localId" : "3794", + "locator" : "84:1-86:36", "name" : "Conditions with Goals", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "s" : { - "r" : "292", + "r" : "3794", "s" : [ { "value" : [ "","define ","\"Conditions with Goals\"",":\n " ] }, { - "r" : "291", + "r" : "3846", "s" : [ { "s" : [ { - "r" : "271", + "r" : "3795", "s" : [ { - "r" : "270", + "r" : "3796", "s" : [ { - "r" : "270", + "r" : "3796", "s" : [ { "value" : [ "[","Condition","]" ] } ] @@ -8098,19 +10310,19 @@ }, { "value" : [ "\n " ] }, { - "r" : "290", + "r" : "3803", "s" : [ { "value" : [ "where " ] }, { - "r" : "290", + "r" : "3803", "s" : [ { "value" : [ "exists " ] }, { - "r" : "289", + "r" : "3808", "s" : [ { "value" : [ "HasGoals","(" ] }, { - "r" : "272", + "r" : "3804", "s" : [ { "value" : [ "condition" ] } ] @@ -8124,70 +10336,87 @@ } } ], "resultTypeSpecifier" : { + "localId" : "3849", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3850", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "291", - "locator" : "81:3-82:36", + "localId" : "3846", + "locator" : "85:3-86:36", "type" : "Query", "resultTypeSpecifier" : { + "localId" : "3847", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3848", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } }, "source" : [ { - "localId" : "271", - "locator" : "81:3-81:23", + "localId" : "3795", + "locator" : "85:3-85:23", "alias" : "condition", "resultTypeSpecifier" : { + "localId" : "3801", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3802", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "270", - "locator" : "81:3-81:13", + "localId" : "3796", + "locator" : "85:3-85:13", "dataType" : "{http://hl7.org/fhir}Condition", "templateId" : "http://hl7.org/fhir/StructureDefinition/Condition", "type" : "Retrieve", "resultTypeSpecifier" : { + "localId" : "3799", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3800", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } - } + }, + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } } ], + "let" : [ ], "relationship" : [ ], "where" : { - "localId" : "290", - "locator" : "82:5-82:36", + "localId" : "3803", + "locator" : "86:5-86:36", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "Exists", + "signature" : [ ], "operand" : { - "localId" : "289", - "locator" : "82:18-82:36", + "localId" : "3808", + "locator" : "86:18-86:36", "name" : "HasGoals", "type" : "FunctionRef", "resultTypeSpecifier" : { + "localId" : "3844", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3845", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } }, + "signature" : [ ], "operand" : [ { - "localId" : "272", - "locator" : "82:27-82:35", + "localId" : "3804", + "locator" : "86:27-86:35", "resultTypeName" : "{http://hl7.org/fhir}Condition", "name" : "condition", "type" : "AliasRef" @@ -8196,26 +10425,26 @@ } } }, { - "localId" : "300", - "locator" : "84:1-86:40", + "localId" : "3852", + "locator" : "88:1-90:40", "name" : "Conditions without Goals", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "s" : { - "r" : "300", + "r" : "3852", "s" : [ { "value" : [ "","define ","\"Conditions without Goals\"",":\n " ] }, { - "r" : "299", + "r" : "3867", "s" : [ { "s" : [ { - "r" : "294", + "r" : "3853", "s" : [ { - "r" : "293", + "r" : "3854", "s" : [ { - "r" : "293", + "r" : "3854", "s" : [ { "value" : [ "[","Condition","]" ] } ] @@ -8227,23 +10456,23 @@ }, { "value" : [ "\n " ] }, { - "r" : "298", + "r" : "3861", "s" : [ { "value" : [ "where " ] }, { - "r" : "298", + "r" : "3861", "s" : [ { "value" : [ "not " ] }, { - "r" : "297", + "r" : "3862", "s" : [ { "value" : [ "exists " ] }, { - "r" : "296", + "r" : "3864", "s" : [ { "value" : [ "HasGoals","(" ] }, { - "r" : "295", + "r" : "3863", "s" : [ { "value" : [ "condition" ] } ] @@ -8258,75 +10487,93 @@ } } ], "resultTypeSpecifier" : { + "localId" : "3870", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3871", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "299", - "locator" : "85:3-86:40", + "localId" : "3867", + "locator" : "89:3-90:40", "type" : "Query", "resultTypeSpecifier" : { + "localId" : "3868", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3869", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } }, "source" : [ { - "localId" : "294", - "locator" : "85:3-85:23", + "localId" : "3853", + "locator" : "89:3-89:23", "alias" : "condition", "resultTypeSpecifier" : { + "localId" : "3859", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3860", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "293", - "locator" : "85:3-85:13", + "localId" : "3854", + "locator" : "89:3-89:13", "dataType" : "{http://hl7.org/fhir}Condition", "templateId" : "http://hl7.org/fhir/StructureDefinition/Condition", "type" : "Retrieve", "resultTypeSpecifier" : { + "localId" : "3857", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3858", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } - } + }, + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } } ], + "let" : [ ], "relationship" : [ ], "where" : { - "localId" : "298", - "locator" : "86:5-86:40", + "localId" : "3861", + "locator" : "90:5-90:40", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "Not", + "signature" : [ ], "operand" : { - "localId" : "297", - "locator" : "86:15-86:40", + "localId" : "3862", + "locator" : "90:15-90:40", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "Exists", + "signature" : [ ], "operand" : { - "localId" : "296", - "locator" : "86:22-86:40", + "localId" : "3864", + "locator" : "90:22-90:40", "name" : "HasGoals", "type" : "FunctionRef", "resultTypeSpecifier" : { + "localId" : "3865", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3866", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } }, + "signature" : [ ], "operand" : [ { - "localId" : "295", - "locator" : "86:31-86:39", + "localId" : "3863", + "locator" : "90:31-90:39", "resultTypeName" : "{http://hl7.org/fhir}Condition", "name" : "condition", "type" : "AliasRef" @@ -8336,8 +10583,8 @@ } } }, { - "localId" : "320", - "locator" : "127:1-135:3", + "localId" : "3884", + "locator" : "131:1-139:3", "name" : "HasEvidence", "context" : "Patient", "accessLevel" : "Public", @@ -8345,33 +10592,26 @@ "annotation" : [ { "type" : "Annotation", "s" : { - "r" : "320", + "r" : "3884", "s" : [ { - "value" : [ "// Returns a list of resources that provide evidence for this Condition.\n// TODO: expand to support CodeableConcept as evidence.\n","define function ","HasEvidence","(","condition"," " ] - }, { - "r" : "304", - "s" : [ { - "value" : [ "Condition" ] - } ] - }, { - "value" : [ "):\n " ] + "value" : [ "// Returns a list of resources that provide evidence for this Condition.\n// TODO: expand to support CodeableConcept as evidence.\n","define function HasEvidence(condition Condition):\n " ] }, { - "r" : "319", + "r" : "4188", "s" : [ { - "r" : "319", + "r" : "4188", "s" : [ { "value" : [ "flatten" ] }, { - "r" : "318", + "r" : "4230", "s" : [ { "value" : [ "( " ] }, { - "r" : "318", + "r" : "4230", "s" : [ { "s" : [ { - "r" : "306", + "r" : "4189", "s" : [ { - "r" : "305", + "r" : "4201", "s" : [ { "s" : [ { "value" : [ "condition",".","evidence",".","detail" ] @@ -8384,18 +10624,18 @@ }, { "value" : [ "\n " ] }, { - "r" : "317", + "r" : "4206", "s" : [ { "value" : [ "return \n " ] }, { - "r" : "316", + "r" : "4224", "s" : [ { "s" : [ { - "r" : "308", + "r" : "4207", "s" : [ { - "r" : "307", + "r" : "4208", "s" : [ { - "r" : "307", + "r" : "4208", "s" : [ { "value" : [ "[","Observation","]" ] } ] @@ -8407,22 +10647,22 @@ }, { "value" : [ " " ] }, { - "r" : "315", + "r" : "4215", "s" : [ { "value" : [ "where " ] }, { - "r" : "315", + "r" : "4215", "s" : [ { - "r" : "310", + "r" : "4217", "s" : [ { - "r" : "309", + "r" : "4216", "s" : [ { "value" : [ "res" ] } ] }, { "value" : [ "." ] }, { - "r" : "310", + "r" : "4217", "s" : [ { "value" : [ "id" ] } ] @@ -8430,29 +10670,29 @@ }, { "value" : [ " ","="," " ] }, { - "r" : "314", + "r" : "4221", "s" : [ { - "r" : "311", + "r" : "4218", "s" : [ { "value" : [ "DE" ] } ] }, { "value" : [ "." ] }, { - "r" : "314", + "r" : "4221", "s" : [ { "value" : [ "GetId","(" ] }, { - "r" : "313", + "r" : "4220", "s" : [ { - "r" : "312", + "r" : "4219", "s" : [ { "value" : [ "E" ] } ] }, { "value" : [ "." ] }, { - "r" : "313", + "r" : "4220", "s" : [ { "value" : [ "reference" ] } ] @@ -8475,80 +10715,105 @@ } } ], "resultTypeSpecifier" : { + "localId" : "4241", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4242", "name" : "{http://hl7.org/fhir}Resource", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "319", - "locator" : "128:3-135:3", + "localId" : "4188", + "locator" : "132:3-139:3", "type" : "Flatten", "resultTypeSpecifier" : { + "localId" : "4239", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4240", "name" : "{http://hl7.org/fhir}Resource", "type" : "NamedTypeSpecifier" } }, + "signature" : [ ], "operand" : { - "localId" : "318", - "locator" : "128:10-135:3", + "localId" : "4230", + "locator" : "132:10-139:3", "type" : "Query", "resultTypeSpecifier" : { + "localId" : "4234", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4235", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4236", "name" : "{http://hl7.org/fhir}Observation", "type" : "NamedTypeSpecifier" } } }, "source" : [ { - "localId" : "306", - "locator" : "128:12-128:38", + "localId" : "4189", + "locator" : "132:12-132:38", "alias" : "E", "resultTypeSpecifier" : { + "localId" : "4204", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4205", "name" : "{http://hl7.org/fhir}Reference", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "305", - "locator" : "128:12-128:36", + "localId" : "4201", + "locator" : "132:12-132:36", "type" : "Flatten", "resultTypeSpecifier" : { + "localId" : "4202", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4203", "name" : "{http://hl7.org/fhir}Reference", "type" : "NamedTypeSpecifier" } }, + "signature" : [ ], "operand" : { + "localId" : "4199", "type" : "Query", "source" : [ { + "localId" : "4198", "alias" : "$this", "expression" : { + "localId" : "4191", "path" : "evidence", "type" : "Property", "source" : { + "localId" : "4190", "name" : "condition", "type" : "OperandRef" } } } ], + "let" : [ ], + "relationship" : [ ], "where" : { + "localId" : "4195", "type" : "Not", + "signature" : [ ], "operand" : { + "localId" : "4194", "type" : "IsNull", + "signature" : [ ], "operand" : { + "localId" : "4193", "path" : "detail", "type" : "Property", "source" : { + "localId" : "4192", "name" : "$this", "type" : "AliasRef" } @@ -8556,11 +10821,14 @@ } }, "return" : { + "localId" : "4200", "distinct" : false, "expression" : { + "localId" : "4197", "path" : "detail", "type" : "Property", "source" : { + "localId" : "4196", "name" : "$this", "type" : "AliasRef" } @@ -8569,89 +10837,110 @@ } } } ], + "let" : [ ], "relationship" : [ ], "return" : { - "localId" : "317", - "locator" : "129:5-130:61", + "localId" : "4206", + "locator" : "133:5-134:61", "resultTypeSpecifier" : { + "localId" : "4227", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4228", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4229", "name" : "{http://hl7.org/fhir}Observation", "type" : "NamedTypeSpecifier" } } }, "expression" : { - "localId" : "316", - "locator" : "130:9-130:61", + "localId" : "4224", + "locator" : "134:9-134:61", "type" : "Query", "resultTypeSpecifier" : { + "localId" : "4225", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4226", "name" : "{http://hl7.org/fhir}Observation", "type" : "NamedTypeSpecifier" } }, "source" : [ { - "localId" : "308", - "locator" : "130:9-130:24", + "localId" : "4207", + "locator" : "134:9-134:24", "alias" : "res", "resultTypeSpecifier" : { + "localId" : "4213", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4214", "name" : "{http://hl7.org/fhir}Observation", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "307", - "locator" : "130:9-130:21", + "localId" : "4208", + "locator" : "134:9-134:21", "dataType" : "{http://hl7.org/fhir}Observation", "templateId" : "http://hl7.org/fhir/StructureDefinition/Observation", "type" : "Retrieve", "resultTypeSpecifier" : { + "localId" : "4211", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4212", "name" : "{http://hl7.org/fhir}Observation", "type" : "NamedTypeSpecifier" } - } + }, + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } } ], + "let" : [ ], "relationship" : [ ], "where" : { - "localId" : "315", - "locator" : "130:26-130:61", + "localId" : "4215", + "locator" : "134:26-134:61", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "Equal", + "signature" : [ ], "operand" : [ { + "localId" : "4223", "name" : "ToString", "libraryName" : "FHIRHelpers", "type" : "FunctionRef", + "signature" : [ ], "operand" : [ { - "localId" : "310", - "locator" : "130:32-130:37", + "localId" : "4217", + "locator" : "134:32-134:37", "resultTypeName" : "{http://hl7.org/fhir}id", "path" : "id", "scope" : "res", "type" : "Property" } ] }, { - "localId" : "314", - "locator" : "130:41-130:61", + "localId" : "4221", + "locator" : "134:41-134:61", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "name" : "GetId", "libraryName" : "DE", "type" : "FunctionRef", + "signature" : [ ], "operand" : [ { + "localId" : "4222", "name" : "ToString", "libraryName" : "FHIRHelpers", "type" : "FunctionRef", + "signature" : [ ], "operand" : [ { - "localId" : "313", - "locator" : "130:50-130:60", + "localId" : "4220", + "locator" : "134:50-134:60", "resultTypeName" : "{http://hl7.org/fhir}string", "path" : "reference", "scope" : "E", @@ -8665,36 +10954,37 @@ } }, "operand" : [ { + "localId" : "3886", "name" : "condition", "operandTypeSpecifier" : { - "localId" : "304", - "locator" : "127:39-127:47", + "localId" : "3885", + "locator" : "131:39-131:47", "resultTypeName" : "{http://hl7.org/fhir}Condition", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } } ] }, { - "localId" : "324", - "locator" : "88:1-90:39", + "localId" : "3873", + "locator" : "92:1-94:39", "name" : "Conditions with Evidence", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "s" : { - "r" : "324", + "r" : "3873", "s" : [ { "value" : [ "","define ","\"Conditions with Evidence\"",":\n " ] }, { - "r" : "323", + "r" : "3943", "s" : [ { "s" : [ { - "r" : "302", + "r" : "3874", "s" : [ { - "r" : "301", + "r" : "3875", "s" : [ { - "r" : "301", + "r" : "3875", "s" : [ { "value" : [ "[","Condition","]" ] } ] @@ -8706,19 +10996,19 @@ }, { "value" : [ "\n " ] }, { - "r" : "322", + "r" : "3882", "s" : [ { "value" : [ "where " ] }, { - "r" : "322", + "r" : "3882", "s" : [ { "value" : [ "exists " ] }, { - "r" : "321", + "r" : "3887", "s" : [ { "value" : [ "HasEvidence","(" ] }, { - "r" : "303", + "r" : "3883", "s" : [ { "value" : [ "condition" ] } ] @@ -8732,70 +11022,87 @@ } } ], "resultTypeSpecifier" : { + "localId" : "3946", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3947", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "323", - "locator" : "89:3-90:39", + "localId" : "3943", + "locator" : "93:3-94:39", "type" : "Query", "resultTypeSpecifier" : { + "localId" : "3944", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3945", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } }, "source" : [ { - "localId" : "302", - "locator" : "89:3-89:23", + "localId" : "3874", + "locator" : "93:3-93:23", "alias" : "condition", "resultTypeSpecifier" : { + "localId" : "3880", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3881", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "301", - "locator" : "89:3-89:13", + "localId" : "3875", + "locator" : "93:3-93:13", "dataType" : "{http://hl7.org/fhir}Condition", "templateId" : "http://hl7.org/fhir/StructureDefinition/Condition", "type" : "Retrieve", "resultTypeSpecifier" : { + "localId" : "3878", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3879", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } - } + }, + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } } ], + "let" : [ ], "relationship" : [ ], "where" : { - "localId" : "322", - "locator" : "90:5-90:39", + "localId" : "3882", + "locator" : "94:5-94:39", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "Exists", + "signature" : [ ], "operand" : { - "localId" : "321", - "locator" : "90:18-90:39", + "localId" : "3887", + "locator" : "94:18-94:39", "name" : "HasEvidence", "type" : "FunctionRef", "resultTypeSpecifier" : { + "localId" : "3941", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3942", "name" : "{http://hl7.org/fhir}Resource", "type" : "NamedTypeSpecifier" } }, + "signature" : [ ], "operand" : [ { - "localId" : "303", - "locator" : "90:30-90:38", + "localId" : "3883", + "locator" : "94:30-94:38", "resultTypeName" : "{http://hl7.org/fhir}Condition", "name" : "condition", "type" : "AliasRef" @@ -8804,32 +11111,32 @@ } } }, { - "localId" : "328", - "locator" : "92:1-93:45", + "localId" : "3949", + "locator" : "96:1-97:45", "name" : "Display Conditions without Goals", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "s" : { - "r" : "328", + "r" : "3949", "s" : [ { "value" : [ "","define ","\"Display Conditions without Goals\"",":\n " ] }, { - "r" : "327", + "r" : "3954", "s" : [ { - "r" : "325", + "r" : "3950", "s" : [ { "value" : [ "DE" ] } ] }, { "value" : [ "." ] }, { - "r" : "327", + "r" : "3954", "s" : [ { "value" : [ "DisplayNames","(" ] }, { - "r" : "326", + "r" : "3951", "s" : [ { "value" : [ "\"Conditions without Goals\"" ] } ] @@ -8841,33 +11148,40 @@ } } ], "resultTypeSpecifier" : { + "localId" : "3959", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3960", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "327", - "locator" : "93:3-93:45", + "localId" : "3954", + "locator" : "97:3-97:45", "name" : "DisplayNames", "libraryName" : "DE", "type" : "FunctionRef", "resultTypeSpecifier" : { + "localId" : "3957", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3958", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, + "signature" : [ ], "operand" : [ { - "localId" : "326", - "locator" : "93:19-93:44", + "localId" : "3951", + "locator" : "97:19-97:44", "name" : "Conditions without Goals", "type" : "ExpressionRef", "resultTypeSpecifier" : { + "localId" : "3952", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3953", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } @@ -8875,26 +11189,26 @@ } ] } }, { - "localId" : "351", - "locator" : "95:1-103:5", + "localId" : "3962", + "locator" : "99:1-107:5", "name" : "Display Conditions with Goals", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "s" : { - "r" : "351", + "r" : "3962", "s" : [ { "value" : [ "","define ","\"Display Conditions with Goals\"",":\n " ] }, { - "r" : "350", + "r" : "4033", "s" : [ { "s" : [ { - "r" : "330", + "r" : "3963", "s" : [ { - "r" : "329", + "r" : "3964", "s" : [ { - "r" : "329", + "r" : "3964", "s" : [ { "value" : [ "[","Condition","]" ] } ] @@ -8909,15 +11223,15 @@ "s" : [ { "value" : [ "let " ] }, { - "r" : "333", + "r" : "3971", "s" : [ { "value" : [ "goals",": " ] }, { - "r" : "332", + "r" : "3973", "s" : [ { "value" : [ "HasGoals","(" ] }, { - "r" : "331", + "r" : "3972", "s" : [ { "value" : [ "condition" ] } ] @@ -8928,15 +11242,15 @@ }, { "value" : [ ",\n " ] }, { - "r" : "336", + "r" : "3978", "s" : [ { "value" : [ "evidence",": " ] }, { - "r" : "335", + "r" : "3980", "s" : [ { "value" : [ "HasEvidence","(" ] }, { - "r" : "334", + "r" : "3979", "s" : [ { "value" : [ "condition" ] } ] @@ -8948,19 +11262,19 @@ }, { "value" : [ "\n " ] }, { - "r" : "338", + "r" : "3985", "s" : [ { "value" : [ "where " ] }, { - "r" : "338", + "r" : "3985", "s" : [ { "value" : [ "exists" ] }, { - "r" : "337", + "r" : "3986", "s" : [ { "value" : [ "(" ] }, { - "r" : "337", + "r" : "3986", "s" : [ { "value" : [ "goals" ] } ] @@ -8972,31 +11286,31 @@ }, { "value" : [ " " ] }, { - "r" : "349", + "r" : "3991", "s" : [ { "value" : [ "return " ] }, { - "r" : "348", + "r" : "3992", "s" : [ { "value" : [ "{\n " ] }, { "s" : [ { "value" : [ "Condition",": " ] }, { - "r" : "341", + "r" : "3995", "s" : [ { - "r" : "339", + "r" : "3993", "s" : [ { "value" : [ "DE" ] } ] }, { "value" : [ "." ] }, { - "r" : "341", + "r" : "3995", "s" : [ { "value" : [ "DisplayName","(" ] }, { - "r" : "340", + "r" : "3994", "s" : [ { "value" : [ "condition" ] } ] @@ -9011,20 +11325,20 @@ "s" : [ { "value" : [ "HasEvidence",": " ] }, { - "r" : "344", + "r" : "4000", "s" : [ { - "r" : "342", + "r" : "3996", "s" : [ { "value" : [ "DE" ] } ] }, { "value" : [ "." ] }, { - "r" : "344", + "r" : "4000", "s" : [ { "value" : [ "DisplayNames","(" ] }, { - "r" : "343", + "r" : "3997", "s" : [ { "value" : [ "evidence" ] } ] @@ -9039,20 +11353,20 @@ "s" : [ { "value" : [ "HasGoals",": " ] }, { - "r" : "347", + "r" : "4009", "s" : [ { - "r" : "345", + "r" : "4005", "s" : [ { "value" : [ "DE" ] } ] }, { "value" : [ "." ] }, { - "r" : "347", + "r" : "4009", "s" : [ { "value" : [ "DisplayNames","(" ] }, { - "r" : "346", + "r" : "4006", "s" : [ { "value" : [ "goals" ] } ] @@ -9070,29 +11384,39 @@ } } ], "resultTypeSpecifier" : { + "localId" : "4044", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4045", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "4046", "name" : "Condition", "elementType" : { + "localId" : "4047", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "4048", "name" : "HasEvidence", "elementType" : { + "localId" : "4049", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4050", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { + "localId" : "4051", "name" : "HasGoals", "elementType" : { + "localId" : "4052", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4053", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } @@ -9101,33 +11425,43 @@ } }, "expression" : { - "localId" : "350", - "locator" : "96:3-103:5", + "localId" : "4033", + "locator" : "100:3-107:5", "type" : "Query", "resultTypeSpecifier" : { + "localId" : "4034", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4035", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "4036", "name" : "Condition", "elementType" : { + "localId" : "4037", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "4038", "name" : "HasEvidence", "elementType" : { + "localId" : "4039", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4040", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { + "localId" : "4041", "name" : "HasGoals", "elementType" : { + "localId" : "4042", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4043", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } @@ -9136,88 +11470,106 @@ } }, "source" : [ { - "localId" : "330", - "locator" : "96:3-96:23", + "localId" : "3963", + "locator" : "100:3-100:23", "alias" : "condition", "resultTypeSpecifier" : { + "localId" : "3969", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3970", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "329", - "locator" : "96:3-96:13", + "localId" : "3964", + "locator" : "100:3-100:13", "dataType" : "{http://hl7.org/fhir}Condition", "templateId" : "http://hl7.org/fhir/StructureDefinition/Condition", "type" : "Retrieve", "resultTypeSpecifier" : { + "localId" : "3967", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3968", "name" : "{http://hl7.org/fhir}Condition", "type" : "NamedTypeSpecifier" } - } + }, + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] } } ], "let" : [ { - "localId" : "333", - "locator" : "97:9-97:34", + "localId" : "3971", + "locator" : "101:9-101:34", "identifier" : "goals", "resultTypeSpecifier" : { + "localId" : "3976", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3977", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "332", - "locator" : "97:16-97:34", + "localId" : "3973", + "locator" : "101:16-101:34", "name" : "HasGoals", "type" : "FunctionRef", "resultTypeSpecifier" : { + "localId" : "3974", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3975", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } }, + "signature" : [ ], "operand" : [ { - "localId" : "331", - "locator" : "97:25-97:33", + "localId" : "3972", + "locator" : "101:25-101:33", "resultTypeName" : "{http://hl7.org/fhir}Condition", "name" : "condition", "type" : "AliasRef" } ] } }, { - "localId" : "336", - "locator" : "98:9-98:40", + "localId" : "3978", + "locator" : "102:9-102:40", "identifier" : "evidence", "resultTypeSpecifier" : { + "localId" : "3983", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3984", "name" : "{http://hl7.org/fhir}Resource", "type" : "NamedTypeSpecifier" } }, "expression" : { - "localId" : "335", - "locator" : "98:19-98:40", + "localId" : "3980", + "locator" : "102:19-102:40", "name" : "HasEvidence", "type" : "FunctionRef", "resultTypeSpecifier" : { + "localId" : "3981", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3982", "name" : "{http://hl7.org/fhir}Resource", "type" : "NamedTypeSpecifier" } }, + "signature" : [ ], "operand" : [ { - "localId" : "334", - "locator" : "98:31-98:39", + "localId" : "3979", + "locator" : "102:31-102:39", "resultTypeName" : "{http://hl7.org/fhir}Condition", "name" : "condition", "type" : "AliasRef" @@ -9226,18 +11578,21 @@ } ], "relationship" : [ ], "where" : { - "localId" : "338", - "locator" : "99:5-99:23", + "localId" : "3985", + "locator" : "103:5-103:23", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "type" : "Exists", + "signature" : [ ], "operand" : { - "localId" : "337", - "locator" : "99:17-99:23", + "localId" : "3986", + "locator" : "103:17-103:23", "name" : "goals", "type" : "QueryLetRef", "resultTypeSpecifier" : { + "localId" : "3989", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3990", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } @@ -9245,32 +11600,42 @@ } }, "return" : { - "localId" : "349", - "locator" : "99:25-103:5", + "localId" : "3991", + "locator" : "103:25-107:5", "resultTypeSpecifier" : { + "localId" : "4023", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4024", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "4025", "name" : "Condition", "elementType" : { + "localId" : "4026", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "4027", "name" : "HasEvidence", "elementType" : { + "localId" : "4028", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4029", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { + "localId" : "4030", "name" : "HasGoals", "elementType" : { + "localId" : "4031", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4032", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } @@ -9279,31 +11644,40 @@ } }, "expression" : { - "localId" : "348", - "locator" : "99:32-103:5", + "localId" : "3992", + "locator" : "103:32-107:5", "type" : "Tuple", "resultTypeSpecifier" : { + "localId" : "4014", "type" : "TupleTypeSpecifier", "element" : [ { + "localId" : "4015", "name" : "Condition", "elementType" : { + "localId" : "4016", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, { + "localId" : "4017", "name" : "HasEvidence", "elementType" : { + "localId" : "4018", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4019", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } } }, { + "localId" : "4020", "name" : "HasGoals", "elementType" : { + "localId" : "4021", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4022", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } @@ -9313,15 +11687,16 @@ "element" : [ { "name" : "Condition", "value" : { - "localId" : "341", - "locator" : "100:20-100:44", + "localId" : "3995", + "locator" : "104:20-104:44", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "name" : "DisplayName", "libraryName" : "DE", "type" : "FunctionRef", + "signature" : [ ], "operand" : [ { - "localId" : "340", - "locator" : "100:35-100:43", + "localId" : "3994", + "locator" : "104:35-104:43", "resultTypeName" : "{http://hl7.org/fhir}Condition", "name" : "condition", "type" : "AliasRef" @@ -9330,26 +11705,31 @@ }, { "name" : "HasEvidence", "value" : { - "localId" : "344", - "locator" : "101:22-101:46", + "localId" : "4000", + "locator" : "105:22-105:46", "name" : "DisplayNames", "libraryName" : "DE", "type" : "FunctionRef", "resultTypeSpecifier" : { + "localId" : "4003", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4004", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, + "signature" : [ ], "operand" : [ { - "localId" : "343", - "locator" : "101:38-101:45", + "localId" : "3997", + "locator" : "105:38-105:45", "name" : "evidence", "type" : "QueryLetRef", "resultTypeSpecifier" : { + "localId" : "3998", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "3999", "name" : "{http://hl7.org/fhir}Resource", "type" : "NamedTypeSpecifier" } @@ -9359,26 +11739,31 @@ }, { "name" : "HasGoals", "value" : { - "localId" : "347", - "locator" : "102:19-102:40", + "localId" : "4009", + "locator" : "106:19-106:40", "name" : "DisplayNames", "libraryName" : "DE", "type" : "FunctionRef", "resultTypeSpecifier" : { + "localId" : "4012", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4013", "name" : "{urn:hl7-org:elm-types:r1}String", "type" : "NamedTypeSpecifier" } }, + "signature" : [ ], "operand" : [ { - "localId" : "346", - "locator" : "102:35-102:39", + "localId" : "4006", + "locator" : "106:35-106:39", "name" : "goals", "type" : "QueryLetRef", "resultTypeSpecifier" : { + "localId" : "4007", "type" : "ListTypeSpecifier", "elementType" : { + "localId" : "4008", "name" : "{http://hl7.org/fhir}Goal", "type" : "NamedTypeSpecifier" } diff --git a/src/data-services/fhirService.ts b/src/data-services/fhirService.ts index 92dfecf..0013d02 100644 --- a/src/data-services/fhirService.ts +++ b/src/data-services/fhirService.ts @@ -43,7 +43,7 @@ const carePlanPath = 'CarePlan?status=active&category=assess-plan' + provenanceS const careTeamPath = 'CareTeam?category=longitudinal' + provenanceSearch const careTeamPath_include = 'CareTeam?_include=CareTeam:participant' + provenanceSearch -const goalsPath = 'Goal?lifecycle-status=active,completed' + provenanceSearch +const goalsPath = 'Goal?lifecycle-status=active,completed,cancelled' + provenanceSearch /// Epic allows multiple category codes only >= Aug 2021 release // const conditionsPath = 'Condition?category=problem-list-item,health-concern,LG41762-2&clinical-status=active'; @@ -658,10 +658,10 @@ const getFHIRQueries = async (client: Client, clientScope: string | undefined, // Thus, it has been converted and added back for testing purposes. // Commented out on 28 March, 2024 because survey is not supported by any EHRs at this time. - // const surveyResults: Observation[] | undefined = await loadFHIRQuery('Obs Survey', 'Observation', - // surveyResultsPath, true, client, clientScope, 93, setAndLogProgressState, setAndLogErrorMessageState) - // surveyResults && setResourcesLoadedCountState(++resourcesLoadedCount) - const surveyResults = undefined // required if we decide not to use the above code as was the case prior + const surveyResults: Observation[] | undefined = await loadFHIRQuery('Obs Survey', 'Observation', + surveyResultsPath, true, client, clientScope, 93, setAndLogProgressState, setAndLogErrorMessageState) + surveyResults && setResourcesLoadedCountState(++resourcesLoadedCount) + // const surveyResults = undefined // required if we decide not to use the above code as was the case prior curResourceName = 'Vitals' let vitalSigns: Observation[] | undefined diff --git a/src/data-services/mccCqlService.ts b/src/data-services/mccCqlService.ts index 387058e..3394e13 100644 --- a/src/data-services/mccCqlService.ts +++ b/src/data-services/mccCqlService.ts @@ -23,6 +23,7 @@ function getPatientSource(data: FHIRData): unknown { ...getBundleEntries(data.serviceRequests), ...getBundleEntries(data.labResults), ...getBundleEntries(data.vitalSigns), + ...getBundleEntries(data.surveyResults), ...getBundleEntries(data.goals), ...getBundleEntries(data.provenance), ] diff --git a/src/data-services/models/cqlSummary.ts b/src/data-services/models/cqlSummary.ts index db62a49..5c419d2 100644 --- a/src/data-services/models/cqlSummary.ts +++ b/src/data-services/models/cqlSummary.ts @@ -74,6 +74,8 @@ export interface GoalSummary { ExpressedBy?: string, StartDate?: string, Target?: GoalTarget[], + LifecycleStatus?: string, + AchievementStatus?: string, Addresses?: DataElementSummary[], Notes?: string[], Provenance?: ProvenanceSummary[], From 639802093285a6a9fbf5d596eac8d51fe8e09bec Mon Sep 17 00:00:00 2001 From: Sean <> Date: Fri, 26 Apr 2024 16:41:12 -0400 Subject: [PATCH 2/7] Updates for unshare data Modifed text for share data Added un share data Added loging to get supplemental client to improve debugging --- src/App.tsx | 11 +- src/Home.tsx | 13 +- src/components/shared-data/ShareData.tsx | 5 +- .../unshared-data/ProviderLogin.tsx | 554 ++++++++++++++++++ src/components/unshared-data/UnShareData.tsx | 71 +++ .../unshared-data/UnSharedDataSummary.tsx | 54 ++ src/data-services/endpoints/providers.json | 8 + src/data-services/fhirService.ts | 7 +- 8 files changed, 718 insertions(+), 5 deletions(-) create mode 100644 src/components/unshared-data/ProviderLogin.tsx create mode 100644 src/components/unshared-data/UnShareData.tsx create mode 100644 src/components/unshared-data/UnSharedDataSummary.tsx diff --git a/src/App.tsx b/src/App.tsx index 6482070..62cb942 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -51,6 +51,8 @@ import ConditionEditForm from './components/edit-forms/ConditionEditForm'; import GoalEditForm from './components/edit-forms/GoalEditForm'; import ProviderLogin from "./components/shared-data/ProviderLogin"; import ShareData from "./components/shared-data/ShareData"; +import UnShareData from "./components/unshared-data/UnShareData"; + import SharedDataSummary from "./components/shared-data/SharedDataSummary"; import SessionProtected from './components/session-timeout/SessionProtected'; import { SessionTimeoutPage } from './components/session-timeout/SessionTimeoutPage'; @@ -758,6 +760,11 @@ class App extends React.Component { + + + + + @@ -802,7 +809,9 @@ class App extends React.Component { + errorType={this.state.errorType} userErrorMessage={this.state.userErrorMessage} developerErrorMessage={this.state.developerErrorMessage} errorCaught={this.state.errorCaught} + canShareData={this.state.canShareData} + /> diff --git a/src/Home.tsx b/src/Home.tsx index cc7cd33..f0f7078 100644 --- a/src/Home.tsx +++ b/src/Home.tsx @@ -25,6 +25,7 @@ interface HomeProps { userErrorMessage: string | undefined, developerErrorMessage: string | undefined, errorCaught: Error | string | unknown, + canShareData?: boolean } interface HomeState { @@ -190,13 +191,23 @@ export default class Home extends React.Component {
- {typeof sdsurl !== 'undefined' ? ( + { this.props.canShareData ? (

Share your health data
Share your health data

) : (

)}
+ +
+ { this.props.canShareData ? ( +

+

Withdraw your health data
+ Opt out of sharing your health data

+ ) : (

)} +
+ +
Disclaimer

This application is provided for informational purposes only and does not constitute medical advice or professional services. The information provided should not be used for diagnosing or treating a health problem or disease, and those seeking personal medical advice should consult with a licensed physician. Always seek the advice of your doctor or other qualified health provider regarding a medical condition. Never disregard professional medical advice or delay in seeking it because of something you have read in this application. If you think you may have a medical emergency, call 911 or go to the nearest emergency room immediately. No physician-patient relationship is created by this application or its use. Neither OHSU, nor its employees, nor any contributor to this application, makes any representations, express or implied, with respect to the information herein or to its use.

diff --git a/src/components/shared-data/ShareData.tsx b/src/components/shared-data/ShareData.tsx index 38cc43e..dba10f1 100644 --- a/src/components/shared-data/ShareData.tsx +++ b/src/components/shared-data/ShareData.tsx @@ -78,6 +78,7 @@ export default function ShareData(props: ShareDataProps) { } return ( + @@ -87,10 +88,10 @@ export default function ShareData(props: ShareDataProps) { - Add a consent statement and buttons to 'Agree' or 'Disagree' before sharing data. + We are collecting this data as part of a research project to evaluate the effectiveness of the MyCarePlanner application. - Sharing required authentication into the shared data store repository, e.g. a Personal Health Repository(PHR). + Your data will be stored in a secure database and will only be shared with the research team, as described in the consent form. diff --git a/src/components/unshared-data/ProviderLogin.tsx b/src/components/unshared-data/ProviderLogin.tsx new file mode 100644 index 0000000..6bba8a3 --- /dev/null +++ b/src/components/unshared-data/ProviderLogin.tsx @@ -0,0 +1,554 @@ +import React from 'react' +import { useState, useEffect } from 'react' +import { RouteComponentProps, useHistory } from 'react-router-dom' +import FHIR from 'fhirclient' +import { getFHIRData } from '../../data-services/fhirService' +import { + ProviderEndpoint, buildAvailableEndpoints, getMatchingProviderEndpointsFromName, + isProviderEndpointInProviderEndpoints +} from '../../data-services/providerEndpointService' +import { + isGivenEndpointMatchesLastActiveEndpoint, isEndpointStillAuthorized, saveSelectedEndpoints, + deleteSelectedEndpoints, getLauncherData +} from '../../data-services/persistenceService' + +import Box from '@mui/material/Box' +import Button from '@mui/material/Button' +import Grid from '@mui/material/Grid' +import Typography from '@mui/material/Typography' +import FormControl from '@mui/material/FormControl' +import InputLabel from '@mui/material/InputLabel' +import Select, { SelectChangeEvent } from '@mui/material/Select' +import { FHIRData } from '../../data-services/models/fhirResources' + +import { Theme, useTheme } from '@mui/material/styles' +import OutlinedInput from '@mui/material/OutlinedInput' +import MenuItem from '@mui/material/MenuItem' +import Chip from '@mui/material/Chip' + +import { getSupplementalDataClient } from '../../data-services/fhirService' +import Client from 'fhirclient/lib/Client' + +interface Props extends RouteComponentProps { + setFhirDataStates: (data: FHIRData[] | undefined) => void, + setAndLogProgressState: (message: string, value: number) => void, + setResourcesLoadedCountState: (count: number) => void, + setAndLogErrorMessageState: (errorType: string, userErrorMessage: string, + developerErrorMessage: string, errorCaught: Error | string | unknown) => void, + resetErrorMessageState: () => void, +} + +interface LocationState { + fhirDataCollection?: FHIRData[], +} + +export default function ProviderLogin(props: Props) { + const { fhirDataCollection } = props.location.state as LocationState + + let history = useHistory() + + const [launcherEndpointFromForage, setLauncherEndpointFromForage] = + useState() + const [sdsClient, setSdsClient] = useState(null) + + useEffect(() => { + const fetchLauncherData = async () => { + try { + setLauncherEndpointFromForage(await getLauncherData()) + } catch (e) { + console.error(`Error fetching launcher data within ProviderLogin useEffect: ${e}`) + } + } + fetchLauncherData() + }, []) // Empty for now as should only need to set on component mount because a new launcher is a re-mount + + useEffect(() => { + const fetchSdsClient = async () => { + try { + const sdsClient: Client | undefined = await getSupplementalDataClient(null) + if (sdsClient) { + setSdsClient(sdsClient) + } else { + console.error("SDS client is untruthy") + } + } catch (error) { + console.error("Error fetching SDS Client:", error) + } + } + fetchSdsClient(); + }, []) // Empty dependency array to run only on component mount. + // If we want this everytime, just call getSupplementalDataClient where needed instead + + const availableEndpoints: ProviderEndpoint[] = buildAvailableEndpoints() + const [selectedEndpointNames, setselectedEndpointNames] = useState([]) + + const authorizeSelectedEndpoints = async (endpointsToAuthorize: ProviderEndpoint[]): Promise => { + console.log('authorizeSelectedEndpoints(): endpointsToAuthorize: ', JSON.stringify(endpointsToAuthorize)) + + if (endpointsToAuthorize && endpointsToAuthorize.length > 0) { + const endpointsLength = endpointsToAuthorize.length + + // Loop endpoints to see if any exist that are not already authorized (however unlikely that may be) + // TODO: Consider getting all endpoints first, then after fully looping, decide what to do + for (let i = 0; i < endpointsLength; i++) { + const curEndpoint: ProviderEndpoint = endpointsToAuthorize[i] + console.log("curEndpoint", curEndpoint) + const issServerUrl = curEndpoint.config!.iss + console.log("issServerUrl", issServerUrl) + const isLastIndex = i === endpointsLength - 1 + console.log("isLastIndex: " + isLastIndex) + + // Check for prior auths from another load or session just in case so we can save some time + if (await isEndpointStillAuthorized(issServerUrl!, false)) { // false so checking ALL endpoints in local storage vs just last one + console.log("This endpoint IS authorized") + console.log("curEndpoint issServerUrl " + issServerUrl + " at index " + i + " and count " + (i + 1) + "/" + endpointsLength + + " is still authorized. Will not waste time reauthorizing: ", curEndpoint) + + if (isLastIndex) { + console.log("All endpoints are already authorized.") + + // Do NOT need to save data for endpoints to be loaded as we don't need to reload the app + console.log("Deleting multi-select endpoints from local storage so they don't intefere with future selections") + deleteSelectedEndpoints() + + console.log("Loading data from all endpoints without leaving the application") + await loadSelectedEndpoints(endpointsToAuthorize) // TODO: Consider returning true and having handleSubmit call this instead based on true + } + + } else { + console.log("This endpoint is NOT authorized") + console.log("curEndpoint issServerUrl " + issServerUrl + " at index " + i + + " and count " + (i + 1) + "/" + endpointsLength + + " is NOT authorized.", curEndpoint) + + // Save selected endpoints so app load after exiting app for auth knows that it is a multi load of specific endpoints + console.log("At Least one endpoint is not authorized yet...Saving multi-select endpoints") + const selectedEndpointsToSave: string[] = + endpointsToAuthorize + .map((curEndpoint, index) => { + if (curEndpoint.config && curEndpoint.config.iss) { + console.log("matched endpoint: " + curEndpoint.config.iss) + return curEndpoint.config.iss + } + return undefined + }) + .filter((endpoint) => endpoint !== undefined) + .map((endpoint) => endpoint as string) + console.log("selectedEndpointsToSave: ", JSON.stringify(selectedEndpointsToSave)) + saveSelectedEndpoints(selectedEndpointsToSave) + + console.log("Reauthorizing curEndpoint.config!:", curEndpoint.config!) + // The following authorization will exit the application. Therefore, if it's not the last index, + // then we will have more endpoints to authorize when we return, on load. + if (isLastIndex) { + console.log("Authorizing last index") + } else { + console.log("Not last index, Authorizing index " + i) + } + console.error("curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) + console.error("curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) + console.error("curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) + console.error("curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) + console.error("curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) + + FHIR.oauth2.authorize(curEndpoint.config!) + + console.error("b curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) + console.error("b curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) + console.error("b curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) + console.error("b curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) + + + break + } + + } + + } else { + console.log("endpointsToAuthorize is untruthy or has no data") + } + + } + + const loadAuthorizedSelectedEndpointMulti = async (selectedEndpoint: ProviderEndpoint, + isMultipleProviders: boolean, fhirDataCollectionIndex: number): Promise => { + console.log('loadAuthorizedSelectedEndpointMulti(): selectedEndpoint: ' + JSON.stringify(selectedEndpoint)) + console.log('loadAuthorizedSelectedEndpointMulti(): isMultipleProviders: ' + isMultipleProviders) + console.log('loadAuthorizedSelectedEndpointMulti(): fhirDataCollectionIndex: ' + fhirDataCollectionIndex) + + if (selectedEndpoint !== null) { + const issServerUrl = selectedEndpoint.config!.iss + console.log('issServerUrl:', issServerUrl) + + let fhirDataFromStoredEndpoint: FHIRData | undefined = undefined + + console.log("fhirDataFromStoredEndpoint = await getFHIRData(true, issServerUrl!)") + if (selectedEndpoint.name.includes('SDS') && sdsClient) { + console.log('loading sds data in ProviderLogin.tsx as part of a multi login') + fhirDataFromStoredEndpoint = await getFHIRData(true, issServerUrl!, sdsClient, + props.setAndLogProgressState, props.setResourcesLoadedCountState, props.setAndLogErrorMessageState) + console.log('sdsData', fhirDataFromStoredEndpoint) + fhirDataFromStoredEndpoint.serverName = selectedEndpoint.name + } else { + fhirDataFromStoredEndpoint = await getFHIRData(true, issServerUrl!, null, + props.setAndLogProgressState, props.setResourcesLoadedCountState, props.setAndLogErrorMessageState) + fhirDataFromStoredEndpoint.serverName = selectedEndpoint.name + } + console.log("fhirDataFromStoredEndpoint", JSON.stringify(fhirDataFromStoredEndpoint)) + + return fhirDataFromStoredEndpoint + } else { + console.error("endpoint === null") + } + } + + // Note: We can't load here most of the time (unless all are already authorized, then we load here) + // as this multiselect can only really kick off the auth logic (vs the data). After application (re)load, + // after all authorized, we call similar logic again + const loadSelectedEndpoints = async (endpointsToLoad: ProviderEndpoint[]): Promise => { + console.log('loadSelectedEndpoints()') + const fhirDataCollection: FHIRData[] = [] + + try { + console.log("redirecting to '/' right away as loading multiple endpoints") + history.push('/') + + let index: number = 0; + for (const curSelectedEndpoint of endpointsToLoad) { + console.log('curSelectedEndpoint #' + (index + 1) + ' at index: ' + index + ' with value:', curSelectedEndpoint) + + // Reset of state to undefined for loader and error message reset have to happen after each index is loaded + // in this multi version vs all at end like in singular version + console.log('setting fhirData to undefined so progess indicator is triggered while new data is loaded subsequently') + props.setFhirDataStates(undefined) + props.resetErrorMessageState() + + const curFhirDataLoaded: FHIRData | undefined = + await loadAuthorizedSelectedEndpointMulti(curSelectedEndpoint, true, index) + if (curFhirDataLoaded) { + curFhirDataLoaded.serverName = curSelectedEndpoint.name; + + console.log("curFhirDataLoaded.serverName:", curFhirDataLoaded.serverName) + console.log("curFhirDataLoaded:", curFhirDataLoaded) + console.log("fhirDataCollection:", fhirDataCollection) + console.log("Adding curFhirDataLoaded to fhirDataCollection") + fhirDataCollection.push(curFhirDataLoaded) + console.log("fhirDataCollection:", fhirDataCollection) + } else { + console.error("Error: No FHIR Data loaded for the current index (" + index + "). " + + curSelectedEndpoint?.name + " was not pushed to fhirDataCollection!") + } + index++; + } + } catch (err) { + console.log(`Failure in loadSelectedEndpoints: ${err}`) + // TODO: MULTI-PROVIDER: Make this a terminating error + } finally { + props.setFhirDataStates(fhirDataCollection!) + console.log("fhirDataCollection complete in loadSelectedEndpoints:", fhirDataCollection) + } + + } + + const handleSubmit = async (event: React.FormEvent) => { + event.preventDefault() + + if (selectedEndpointNames) { + + if (selectedEndpointNames.length === 0) { + console.log("selectedEndpoint array is empty") + return // Cannot continue so returning but this should not be possible since we have disabled the login button in this case + } else if (selectedEndpointNames.length > 0) { + console.log("selectedEndpoint array has data") + + let matchingProviderEndpoints: ProviderEndpoint[] = + await getMatchingProviderEndpointsFromName(availableEndpoints, selectedEndpointNames) + console.log('matchingProviderEndpoints: ', matchingProviderEndpoints); + + if (matchingProviderEndpoints && matchingProviderEndpoints.length > 0) { + console.log(`${matchingProviderEndpoints.length} additional providers selected.`) + + try { + // Always include the launcher endpoint in addition to other providers selected: + if (launcherEndpointFromForage) { + console.log("launcherEndpointFromForage: ", launcherEndpointFromForage) + // Only add if NOT already selected/existing somehow in matchingProviderEndpoints + if (!isProviderEndpointInProviderEndpoints(launcherEndpointFromForage, matchingProviderEndpoints)) { + console.log(`Adding launcher ${JSON.stringify(launcherEndpointFromForage)} + to the beginning of the matchingProviderEndpoints ProviderEndpoint[]`) + matchingProviderEndpoints.unshift(launcherEndpointFromForage) + } else { + console.log("Won't add launcher as it is already selected") + } + } else { + console.error(`LauncherEndpointFromLocalStorage is + ${launcherEndpointFromForage === null ? null : undefined}! Cannot add it to other providers...`) + } + + // Always add SDS, if not null, and add it as the 2nd item in the array so that the order is: + // 1: Launcher, 2: SDS 1..*, 3: Additional Providers + if (sdsClient) { // TODO: Either here or in getSupplementalDataClient or in the useEffect, check URL is valid + console.log("SDS is truthy, adding to selected endpoints") + const sdsEndpoint: ProviderEndpoint = + { + // The name could be an env variable too, everything could be... 'SDS' could be there by default to enforce logic + // If there's only ever one SDS, name could just be, SDS, and not ever be an env var + // For now, some of this is hardcoded + // But, if not using env vars, we could make a function that creates a name based on the client id + // or other identifying information within the sdsClient + name: 'SDS', + config: { + iss: process.env.REACT_APP_SHARED_DATA_ENDPOINT, + redirectUri: "./index.html", + clientId: process.env.REACT_APP_SHARED_DATA_CLIENT_ID, // only used when Shared Data is a separate FHIR server with its own SMART launch flow (which it isn't now) + scope: process.env.REACT_APP_SHARED_DATA_SCOPE + } + } + matchingProviderEndpoints.splice(1, 0, sdsEndpoint) // inject at index 1 (2nd position) + } else { + console.log("SDS is untruthy, not adding to selected endpoints") + } + + + // Loop selectedEndpoint logic for all available providers + await authorizeSelectedEndpoints(matchingProviderEndpoints) + // TODO: MULTI-PROVIDER: Consider calling loadSelectedEndpoints if we have authorizeSelectedEndpoints return + // a boolean and base the call on that being true in the limited cases + console.log('Finished loading multiple matching provider endpoints...'); + + } catch (error) { + console.error('Error loading multiple matching provider Endpoints:', error); + } + + } else { + console.error('matchingProviderEndpoints is untruthy or empty') + } + + } + + } else { + console.error('selectedEndpointNames is untruthy', selectedEndpointNames) + } + + } + + // TODO: Consider this as a feature for TEST/DEBUG purposes, only visible in debug mode, to call this function, which will only load a single endpoint + // The ProviderLogin component is for loading additional EHRs which are in addition to the launcher EHR. Therefore, the only single login in the future + // Would be the launcher. In the future it will always be a multi-login (unless there's an error and the launcher is unknown, but multi can handle that), + // the launcher EHR, plus 1..* additional EHRs, giving us a 2..* total logins from ProviderLogin at (almost) all times. + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const loadSelectedEndpointSingle = async (selectedEndpoint: ProviderEndpoint, + isMultipleProviders: boolean, fhirDataCollectionIndex: number): Promise => { + console.log('loadSelectedEndpointSingle(): selectedEndpoint: ' + selectedEndpoint) + console.log('loadSelectedEndpointSingle(): isMultipleProviders: ' + isMultipleProviders) + console.log('loadSelectedEndpointSingle(): fhirDataCollectionIndex: ' + fhirDataCollectionIndex) + + if (selectedEndpoint !== null) { + const issServerUrl = selectedEndpoint.config!.iss + console.log('issServerUrl:', issServerUrl) + + //!FUNCTION DIFF! isLastLoadMultiSelect related code including check in main if case. + // Otherwise, we'd have a bug where we'd load multi - data when choosing single in some cases + // Single to multi should be fine, as it will automatically expand, and call a separate function anyway + const isLastLoadMultiSelect = fhirDataCollection && fhirDataCollection.length > 1 + if (isLastLoadMultiSelect) { + // TODO: MULTI-PROVIDER: Add logic to allow single load after multi which retains relevant data, if any (may be a new endpoint, so may be none) + console.log("Last load was multi-select, can't reload single select data without further logic (match url and reduce fhirDataColleciton array") + } else { + console.log("Last load was single-select") + } + if (await isGivenEndpointMatchesLastActiveEndpoint(issServerUrl!) && !isLastLoadMultiSelect) { + console.log("is last endpoint") + if (await isEndpointStillAuthorized(issServerUrl!, true)) { // Only checks last endpoint + console.log("is last endpoint and IS authorized") + console.log("Redirect w/o a refresh as the data should be in our React state already") + // It may seem silly that a user would do this (select the same thing they are already viewing) + // but it will happen at least by accident at some point, and thus we won't reload the data, but will just go home since the data is already there + // TODO: Consider more error checking of fhirData, check important properties? + // TODO: Make sure we are fully handling back button during authorization situations + // (Should be handled with empty fhir data case, and should be handled by local storage, but need to ensure user experience makes sense in such situations. + // If local storage becomes corrupt in production, it's external so difficult to manage - so want to ensure that is tested for all edge cases prior to prod deployment) + if (fhirDataCollection && fhirDataCollection[fhirDataCollectionIndex]) { + process.env.REACT_APP_TEST_PERSISTENCE === 'true' && + console.log("fhirData is truthy, navigating home w/o reload or passing data:", + JSON.stringify(fhirDataCollection[fhirDataCollectionIndex])) + if (!isMultipleProviders) { + // If there is only one provider, and we already have the data, we can just navigate back + history.push('/') + } else { + // Otherwise, if multiple providers, we need to reload the data, if it's not the first item in the colleciton + // TODO: Add logic to check for and handle above for performance. + // TODO: Authorization logic has to be rewritten. Need to compare fhirDataCollection to localStorage + // For now, we need to test reauthorizing everything I think with data aggregation + // Then support dropping reaut later. So, need to bypass a lot of this logic to test... + console.log("is last loaded endpoint but we are loading multiple providers, reauthorizing for now", + fhirDataCollection && fhirDataCollection[fhirDataCollectionIndex]) + FHIR.oauth2.authorize(selectedEndpoint.config!) + } + // TODO: Do we need to handle a case where the endpoint is the same, but the user wants to select a different patient? + // If so, they don't need a reauth, but they do need to be redirected to choose a new patient... + } else { + process.env.REACT_APP_TEST_PERSISTENCE === 'true' && + console.log("fhirData is falsey, reauthorizing as data cannot be trusted/does not exist:", + fhirDataCollection && fhirDataCollection[fhirDataCollectionIndex]) + // TODO: Consider externalizing logic in "NOT last endpoint but IS already/still authorized" and use that in this case + // It should work fine as the local storage fhirAccessState should be in tact and we can fetch the data from the server w/o a reauth + FHIR.oauth2.authorize(selectedEndpoint.config!) + } + } else { + console.log("is last endpoint but is NOT authorized - reauthorizing") + // Techincally, if needed, we could redirect w/o refresh as in the "is last endpoint and IS authorized" path, + // but for now we are going to assume the data may have changed enough at this point to require a reauthorization + FHIR.oauth2.authorize(selectedEndpoint.config!) + } + } else { + console.log("NOT last endpoint") + if (await isEndpointStillAuthorized(issServerUrl!, false)) { // This checks all endpoints in array, not just last endpoint accessed + console.log("NOT last endpoint but IS already/still authorized") + try { + console.log('Reload data (which is NOT local at this point, other than the fhirAccessData state object) without requiring reauthorization/redirect') + let fhirDataFromStoredEndpoint: FHIRData | undefined = undefined + try { + console.log('setting fhirData to undefined so progess indicator is triggered while new data is loaded subsequently') + props.setFhirDataStates(undefined) + props.resetErrorMessageState() + console.log("redirecting to '/'") + history.push('/') + console.log("fhirDataFromStoredEndpoint = await getFHIRData(true, issServerUrl!)") + fhirDataFromStoredEndpoint = await getFHIRData(true, issServerUrl!, null, + props.setAndLogProgressState, props.setResourcesLoadedCountState, props.setAndLogErrorMessageState) + fhirDataFromStoredEndpoint.serverName = selectedEndpoint.name + } catch (err) { + console.log(`Failure calling getFHIRData(true, issServerUrl!) from ProviderLogin.tsx handleSubmit: ${err}`) + console.log('fallback to authorization due to above failure') + // TODO: Add logic to ensure that fhirAccess obj and array are not updated (or are reverted) from a faulty no-auth load attempt + // Note: We don't need to setAndLogErrorMessageState/can catch the error because we have provided an alternative application path + // Once the application redirects, when it reloads, any error will be handled by the getFhirData call in componentDidMount + FHIR.oauth2.authorize(selectedEndpoint.config!) + } finally { + console.log('Set fhir data states with Route prop directly using App callback function') + props.setFhirDataStates([fhirDataFromStoredEndpoint!]) + } + } catch (err) { + // Catches if setFhirDataStates in finally fails + console.log(`Failure setting fhir data states after getFHIRData call in ProviderLogin.tsx handleSubmit: ${err}`) + console.log('fallback to authorization due to above failure') + // TODO: Add logic to ensure that fhirAccess obj and array are not updated (or are reverted) from a faulty no-auth load attempt + FHIR.oauth2.authorize(selectedEndpoint.config!) + } + } else { + console.log("NOT last endpoint and NOT still authorized - reauthorizing") + FHIR.oauth2.authorize(selectedEndpoint.config!).catch(err => { + // Todo: Handle this (and all other redirects) properly in the UI (notify the user) and in the logic if needed + // Also, may need a time out if the server is not returning an error and it just infinitely loads otherwise + console.log("Failed to redirect and authorize: " + err) + }) + } + } + } else { + console.error("endpoint === null") + } + } + + const handleReset = (event: React.FormEvent) => { + history.goBack() + } + + const handleChange = (event: SelectChangeEvent) => { + const targetVal = event.target.value + console.log('targetVal:', targetVal) + + if (!targetVal) { + console.error("selectedEndpointNames is somehow untruthy, setting to empty") + setselectedEndpointNames([]) + } else { + const parsedProviderEndpoints: string[] = + typeof targetVal === 'string' ? targetVal.split(',') : targetVal + setselectedEndpointNames(parsedProviderEndpoints) + console.log('selectedEndpointNames (parsedProviderEndpoints)', selectedEndpointNames) + } + } + + const theme = useTheme(); + const getStyles = (availableEndpointName: string, selectedEndpointNames: string[] | null, + theme: Theme): any => { + return { + fontWeight: + selectedEndpointNames?.indexOf(availableEndpointName) === -1 + ? theme.typography.fontWeightRegular + : theme.typography.fontWeightBold + } + } + + return ( + <> + + + {/*

selectedEndpointNames: {selectedEndpointNames}

*/} + + + Health Provider Login + + + Original Provider: {launcherEndpointFromForage ? + launcherEndpointFromForage?.name : + 'Unknown: Please select the original provider manually from the list in addtion to other providers.'} + + + + + + + + + Select one or more additional healthcare providers + + + + + + + + + + + + + + + +
+ + ) + +} diff --git a/src/components/unshared-data/UnShareData.tsx b/src/components/unshared-data/UnShareData.tsx new file mode 100644 index 0000000..86b63c3 --- /dev/null +++ b/src/components/unshared-data/UnShareData.tsx @@ -0,0 +1,71 @@ +import * as React from 'react' +import { useHistory } from 'react-router-dom' +// import FHIR from 'fhirclient' + +import Box from '@mui/material/Box' +import Button from '@mui/material/Button' +import Grid from '@mui/material/Grid' +import Typography from '@mui/material/Typography' +import { FHIRData } from '../../data-services/models/fhirResources' +import { ConditionSummary } from '../../data-services/models/cqlSummary' +// import { getSupplementalDataClient } from '../../data-services/fhirService' +// import Client from 'fhirclient/lib/Client' +import { getSupplementalDataClient, updateSharedDataResource } from '../../data-services/fhirService'; +import { Practitioner } from '../../data-services/fhir-types/fhir-r4' +import Client from 'fhirclient/lib/Client' +interface ShareDataProps { + + fhirDataCollection?: FHIRData[] + +} + +export default function UnShareData(props: ShareDataProps) { + + let history = useHistory() + + const handleSubmit = (event: React.FormEvent) => { + + event.preventDefault(); + + history.goBack() + } + + const handleReset = (event: React.FormEvent) => { + history.goBack() + } + + return ( + + + + + Withdraw Your Health Data + + + + + + You may choose to withdraw your data. Selecting this option will delete all of your health information from this application and the database. + + + + + + + + + + + + + + + ) +} + + + diff --git a/src/components/unshared-data/UnSharedDataSummary.tsx b/src/components/unshared-data/UnSharedDataSummary.tsx new file mode 100644 index 0000000..2e09d35 --- /dev/null +++ b/src/components/unshared-data/UnSharedDataSummary.tsx @@ -0,0 +1,54 @@ +import * as React from 'react' +import { useHistory } from 'react-router-dom' +import { getSupplementalDataClient } from '../../data-services/fhirService' + +import Box from '@mui/material/Box' +import Button from '@mui/material/Button' +import Grid from '@mui/material/Grid' +import Typography from '@mui/material/Typography' + +export default function SharedDataSummary() { + let history = useHistory() + + const handleSubmit = (event: React.FormEvent) => { + event.preventDefault() + let sdsClient = getSupplementalDataClient(null) + if (sdsClient !== undefined) { + // Get and display Shared Data + } + } + + const handleReset = (event: React.FormEvent) => { + history.goBack() + } + + return ( + + + + Shared Health Data Summary + + + + + + Login to the shared data store repository to display the aggregated summary from other providers that was previously retrieved and shared. + + + + + + + + + + + + + + ) +} diff --git a/src/data-services/endpoints/providers.json b/src/data-services/endpoints/providers.json index 16af5f6..7d0de04 100644 --- a/src/data-services/endpoints/providers.json +++ b/src/data-services/endpoints/providers.json @@ -25,5 +25,13 @@ "clientId": "5fa54c47-ed80-405b-a0b7-611eee5d0159", "scope": "launch launch/patient openid fhirUser patient/Patient.read patient/Practitioner.read patient/RelatedPerson.read patient/Condition.read patient/DiagnosticReport.read patient/Observation.read patient/Procedure.read patient/CarePlan.read patient/CareTeam.read patient/Goal.read patient/Immunization.read patient/MedicationRequest.read patient/ServiceRequest.read patient/Task.read patient/Questionnaire.read patient/QuestionnaireResponse.write patient/Goal.write patient/MedicationRequest.write patient/Condition.write patient/Provenance.read" } + }, + { + "name": "SDS: eCare Shared Data", + "config": { + "iss": "https://gw.interop.community/eCareSharedData/open/", + "redirectUri": "./index.html", + "scope": "launch/patient openid fhirUser patient/*.read patient/*.write" + } } ] diff --git a/src/data-services/fhirService.ts b/src/data-services/fhirService.ts index 0013d02..49b7972 100644 --- a/src/data-services/fhirService.ts +++ b/src/data-services/fhirService.ts @@ -191,6 +191,11 @@ export const getSupplementalDataClient = async (patientId: string | null): Promi const sdsScope = process.env.REACT_APP_SHARED_DATA_SCOPE const sdsClientId = process.env.REACT_APP_SHARED_DATA_CLIENT_ID + console.log('getSupplementalDataClient authURL: ', authURL) + console.log('getSupplementalDataClient sdsURL: ', sdsURL) + console.log('getSupplementalDataClient sdsScope: ', sdsScope) + console.log('getSupplementalDataClient sdsClientId: ', sdsClientId) + if (sdsClientId && sdsURL) { console.log('getSupplementalDataClient if (sdsClientId && sdsURL) == true; authorize in using client id') const sdsFhirAccessDataObject: fhirclient.ClientState | undefined = @@ -220,7 +225,7 @@ export const getSupplementalDataClient = async (patientId: string | null): Promi if (sdsFhirAccessDataObject.tokenResponse) { sdsFhirAccessDataObject.tokenResponse.scope = sdsScope } - console.log("getSupplementalDataClient getSupplementalDataClient() sdsFhirAccessDataObject = ", sdsFhirAccessDataObject) + console.log("getSupplementalDataClient getSupplementalDataClient() sdsFhirAccessDataObject = ", JSON.stringify( sdsFhirAccessDataObject)) // Connect to the client sdsClient = FHIR.client(sdsFhirAccessDataObject) console.log("getSupplementalDataClient FHIR.client(sdsFhirAccessDataObject) sdsClient = ", sdsClient) From e9885f98873c7f8ad01ca71e2d0a24855f7bf804 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Fri, 26 Apr 2024 22:04:43 -0400 Subject: [PATCH 3/7] Support empty SDS, other SDS fixes --- src/App.tsx | 127 +++++++++++++++---- src/Home.tsx | 25 ++-- src/components/shared-data/ProviderLogin.tsx | 73 ++++++++--- src/data-services/fhirService.ts | 27 ++-- src/data-services/providerEndpointService.ts | 87 ++++++------- src/launch.js | 6 +- 6 files changed, 227 insertions(+), 118 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 6482070..71b449f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,7 +4,7 @@ import React from 'react'; import { Switch, Route, RouteComponentProps } from 'react-router-dom'; import { Tab, Box, Paper } from '@mui/material'; import { TabList, TabPanel, TabContext } from '@mui/lab'; -import { Task } from './data-services/fhir-types/fhir-r4'; +import { Patient, Task } from './data-services/fhir-types/fhir-r4'; import HomeIcon from '@mui/icons-material/Home'; import ContentPasteIcon from '@mui/icons-material/ContentPaste'; @@ -327,37 +327,78 @@ class App extends React.Component { } setLoadAndMergeSDSIfAvailable = async (launcherPatientId: string | undefined, launcherData: FHIRData) => { + if (launcherPatientId) { console.log('connect to SDS so we can verify it can exist') const tempSDSClient = await this.setSupplementalDataClient(launcherPatientId) + const launcherOnlyMessage = "Loading the launcher only, the SDS will not be loaded." + if (this.state.supplementalDataClient && this.state.canShareData) { - // TODO: convert this to use multi login code to see if that resolves issue with duplicate meld original data? + // TODO: convert this to use multi login code? + + // Configure the SDS client to get FHIR Data console.log('We can connect to the SDS, so, add it to loader (read) SDS data') const serverUrl = this.state.supplementalDataClient.state.serverUrl const serverUrlFromEnvVar = process.env.REACT_APP_SHARED_DATA_ENDPOINT console.log(`Dynamic SDS serverUrl (using this for now...): ${serverUrl}`) console.log(`Static SDS serverUrl (verify it's the same...): ${serverUrlFromEnvVar}`) console.log('tempSDSClient', tempSDSClient) - console.log('this.state.supplementalDataClient: Is this the same as tempSDS? It should be! If not, then we are sending the wrong data to getFhirData', + console.log(`this.state.supplementalDataClient: Is this the same as tempSDS? It should be! + If not, then we are sending the wrong data to getFhirData`, this.state.supplementalDataClient) - this.setFhirDataStates(undefined) this.resetErrorMessageState() - const sdsData: FHIRData = await getFHIRData(true, serverUrl, this.state.supplementalDataClient, - this.setAndLogProgressState, this.setResourcesLoadedCountState, this.setAndLogErrorMessageState) - console.log('SDS data: ', sdsData) - sdsData.serverName = 'SDS Data' - const mergedFhirDataCollection: FHIRData[] = [sdsData, launcherData] - console.log('Merged (launcher and SDS) data', mergedFhirDataCollection) - this.setFhirDataStates(mergedFhirDataCollection) + + try { + // Use the SDS client to get FHIR Data + const sdsData: FHIRData = await getFHIRData(true, serverUrl, this.state.supplementalDataClient, + this.setAndLogProgressState, this.setResourcesLoadedCountState, this.setAndLogErrorMessageState) + console.log('SDS data: ', sdsData) + sdsData.serverName = 'SDS Data' + + // Merge launcher and SDS Data and set states + const mergedFhirDataCollection: FHIRData[] = [sdsData, launcherData] + console.log('Merged (launcher and SDS) data', mergedFhirDataCollection) + this.setFhirDataStates(mergedFhirDataCollection) + } catch (err) { + // Note: This should be a very rare event + // TODO: Exnternalize this and other exceptions into one function to reduce duplicate code... + const userMessage: string = `There is an issue loading a seemingly valid SDS. + Loading the launcher only.` + const devMessage: string = `The SDS cannot be used due to an error while running + getFHIRData with the SDS client: ` + launcherOnlyMessage + this.setAndLogErrorMessageState('Non-terminating', userMessage, devMessage, err) + + // Ensure the app doesn't try to use this invalid client + this.setState({ supplementalDataClient: undefined }) + this.setState({ canShareData: false }) + // TODO: What other issues might this cause... leftover localForage in getFhirData, etc.? + } + } else { - console.log('No SDS due to !this.state.supplementalDataClient || !this.state.canShareData, so just loading the launcher') + // TODO: Exnternalize this and other exceptions (like the one above) + // into one function to reduce duplicate code... + // TODO: Consider throwing an exception and handling there when else condition met vs using else itself + const userMessage: string = "The SDS is invalid. Loading the launcher only." + const devMessage: string = `The SDS cannot be used due to an invalid SDS configuration, + a missing patient, or otherwise: ` + launcherOnlyMessage + this.setAndLogErrorMessageState('Non-terminating', userMessage, devMessage, + "!this.state.supplementalDataClient || !this.state.canShareData") + + // Ensure the app doesn't try to use this invalid client + this.setState({ supplementalDataClient: undefined }) + this.setState({ canShareData: false }) + // TODO: What other issues might this cause... leftover localForage in getFhirData, etc.? + this.setFhirDataStates([launcherData]) } + } else { + // TODO: Set this to non-terminating as well and include all code from other 'exceptions'? console.log('No SDS due to !launcherPatientId, so just loading the launcher') this.setFhirDataStates([launcherData]) } + } // TODO: MULTI-PROVIDER: This code is copioed into this class for now from the function in ProviderLOgin @@ -425,7 +466,8 @@ class App extends React.Component { let fhirDataFromStoredEndpoint: FHIRData | undefined = undefined console.log("fhirDataFromStoredEndpoint = await getFHIRData(true, issServerUrl!)") - // !FUNCTION DIFF!: Props changed to this for setAndLogProgressState, setResourcesLoadedCountState, and setAndLogErrorMessageState, + // !FUNCTION DIFF!: Props changed to this for setAndLogProgressState, setResourcesLoadedCountState, + // and setAndLogErrorMessageState // TODO SDS: Maybe check if this is the sds, if it is, do the correct getFHIRData call if (selectedEndpoint.name.includes('SDS') && this.state.supplementalDataClient) { console.log('loading sds data in App.tsx but not on first load/with a launcher') @@ -560,16 +602,57 @@ class App extends React.Component { setSupplementalDataClient = async (patientId: string): Promise => { console.log('setSupplementalDataClient()') - const client = await getSupplementalDataClient(patientId) - // const client = await getSupplementalDataClient() + let client = await getSupplementalDataClient(patientId) + if (client) { - const stillValid = await isSavedTokenStillValid(client.state) - this.setState({ supplementalDataClient: client }) - this.setState({ canShareData: stillValid }) + // We have a valid client for the SDS, but, we don't know if it has any data yet + // (or a valid patient / patient with data) + // Ensure we have data by running a query such as the following before proceeding + // Query to run: https://gw.interop.community/MCCSDSEmpty/open/Patient/petient-id + // If we don't get: "resourceType": "Patient", (and instead get something like: "resourceType": "OperationOutcome") + // Return undefined. + // Note: We are only checking for a patient (below) at this time, can consider adding data check/above query later. + // If we want to go further, and we get back a Patient, we can check that: "id": "patient-name", + // If either of those fail, we don't load the SDS... + + const sdsMessageSuffix = "The SDS client will not be used." + let isSDSReadError = false + let sdsPatient: Patient | undefined + if (client.patient.id !== null) { + console.log("client.patient.id !== null, using client.patient.read()") + try { + sdsPatient = await client.patient.read() as Patient + console.log("Valid ") + } catch (err) { + console.warn("Warning: SDS Patient cannot be read via client.patient.read(): " + sdsMessageSuffix) + isSDSReadError = true + } + } else { + console.log("client.patient.id === null, using client.user.read() isntead of client.patient.read()") + try { + sdsPatient = await client.user.read() as Patient + } catch (err) { + console.warn("Warning: SDS Patient cannot be read via client.user.read(): " + sdsMessageSuffix) + isSDSReadError = true + } + } + + if (!isSDSReadError) { + console.log("Valid SDS patient read: Using SDS client", sdsPatient ? sdsPatient : "unknown") + + const stillValid = await isSavedTokenStillValid(client.state) + this.setState({ supplementalDataClient: client }) + this.setState({ canShareData: stillValid }) + + console.log("***** PatientID = " + client.getPatientId() ?? "") + console.log("***** User ID = " + client.getUserId() ?? "") + console.log("***** Can share data = " + stillValid ?? "?") + } else { + console.warn(`Warning: Invalid SDS patient read: Overriding valid client to undefined + and not setting state for supplementalDataClient or canShareData`) + client = undefined + } - console.log("***** PatientID = " + client.getPatientId() ?? "") - console.log("***** User ID = " + client.getUserId() ?? "") - console.log("***** Can share data = " + stillValid ?? "?") } return client } @@ -698,7 +781,7 @@ class App extends React.Component { public render(): JSX.Element { // process.env.REACT_APP_DEBUG_LOG === "true" && console.log("APP component RENDERED!") - let patient = this.state.patientSummaries; + // let patient = this.state.patientSummaries; let editFormData: EditFormData = { fhirDataCollection: this.state.fhirDataCollection, patientSummaries: this.state.patientSummaries, diff --git a/src/Home.tsx b/src/Home.tsx index cc7cd33..944dba2 100644 --- a/src/Home.tsx +++ b/src/Home.tsx @@ -52,15 +52,15 @@ export default class Home extends React.Component { // TODO:MULTI-PROVIDER: Change patient name list to provider name and display single patient name at top public render(): JSX.Element { - const sdsurl = process.env.REACT_APP_SHARED_DATA_ENDPOINT; - + const sdsurl = process.env.REACT_APP_SHARED_DATA_ENDPOINT + let fhirDataCollection = this.props.fhirDataCollection - let patients = this.props.patientSummaries; - let screenings = this.props.screenings?.filter(s => s.notifyPatient); + let patients = this.props.patientSummaries + let screenings = this.props.screenings?.filter(s => s.notifyPatient) // let tasks = this.props.tasks; - const hhsBanner = process.env.REACT_APP_HHS_BANNER === 'false'; + const hhsBanner = process.env.REACT_APP_HHS_BANNER === 'false' return (
@@ -76,7 +76,7 @@ export default class Home extends React.Component { {!fhirDataCollection || (fhirDataCollection && (fhirDataCollection[0]?.caregiverName === undefined)) ? '' :

Caregiver {fhirDataCollection && fhirDataCollection[0]?.caregiverName}

} - {(patients === undefined) ? '' : + {(!patients) ? '' :
{!fhirDataCollection || (fhirDataCollection && (fhirDataCollection[0]?.caregiverName === undefined)) ? '' : 'for '} {/* {patient?.fullName} ({patient?.gender}) Age {patient?.age} */} @@ -94,9 +94,10 @@ export default class Home extends React.Component { return (
  • { - fhirDataCollection && fhirDataCollection[index].isSDS ? + fhirDataCollection && fhirDataCollection[index] && fhirDataCollection[index]?.isSDS ? <>SDS for {curPatient?.fullName} (age {curPatient?.age}) {fhirDataCollection[index].serverName} : - <>{curPatient?.fullName} (age {curPatient?.age}) {fhirDataCollection![index].serverName} + (fhirDataCollection && fhirDataCollection[index]) && + <>{curPatient?.fullName} (age {curPatient?.age}) {fhirDataCollection[index].serverName} // TODO: Consider adding an isLauncher option (need to add to datatype first) }
  • @@ -177,17 +178,17 @@ export default class Home extends React.Component { } - +
    - +

    Shared Health Records
    Retrieve records from additional healthcare providers

    - +
    - +
    {typeof sdsurl !== 'undefined' ? ( diff --git a/src/components/shared-data/ProviderLogin.tsx b/src/components/shared-data/ProviderLogin.tsx index 6bba8a3..0a2998f 100644 --- a/src/components/shared-data/ProviderLogin.tsx +++ b/src/components/shared-data/ProviderLogin.tsx @@ -28,6 +28,7 @@ import Chip from '@mui/material/Chip' import { getSupplementalDataClient } from '../../data-services/fhirService' import Client from 'fhirclient/lib/Client' +import { Patient } from '../../data-services/fhir-types/fhir-r4' interface Props extends RouteComponentProps { setFhirDataStates: (data: FHIRData[] | undefined) => void, @@ -49,7 +50,7 @@ export default function ProviderLogin(props: Props) { const [launcherEndpointFromForage, setLauncherEndpointFromForage] = useState() - const [sdsClient, setSdsClient] = useState(null) + const [sdsClient, setSdsClient] = useState(null) useEffect(() => { const fetchLauncherData = async () => { @@ -62,11 +63,43 @@ export default function ProviderLogin(props: Props) { fetchLauncherData() }, []) // Empty for now as should only need to set on component mount because a new launcher is a re-mount + // TODO: There is a MUCH better way to do this, such as use the version in App.tsx + // WITH setSupplementalDataClient logic and not repeat code, or use a service, + // or put code at a lower level in getSupplementalDataClient), etc. useEffect(() => { const fetchSdsClient = async () => { try { - const sdsClient: Client | undefined = await getSupplementalDataClient(null) + let sdsClient: Client | undefined = await getSupplementalDataClient(null) if (sdsClient) { + const sdsMessageSuffix = "The SDS client will not be used." + let isSDSReadError = false + let sdsPatient: Patient | undefined + if (sdsClient.patient.id !== null) { + console.log("client.patient.id !== null, using client.patient.read()") + try { + sdsPatient = await sdsClient.patient.read() as Patient + console.log("Valid ") + } catch (err) { + console.warn("Warning: SDS Patient cannot be read via client.patient.read(): " + sdsMessageSuffix) + isSDSReadError = true + } + } else { + console.log("client.patient.id === null, using client.user.read() isntead of client.patient.read()") + try { + sdsPatient = await sdsClient.user.read() as Patient + } catch (err) { + console.warn("Warning: SDS Patient cannot be read via client.user.read(): " + sdsMessageSuffix) + isSDSReadError = true + } + } + + if (!isSDSReadError) { + console.log("Valid SDS patient read: Using SDS client", sdsPatient ? sdsPatient : "unknown") + } else { + console.warn(`Warning: Invalid SDS patient read: Overriding valid client to undefined + and not setting state for supplementalDataClient or canShareData`) + sdsClient = undefined + } setSdsClient(sdsClient) } else { console.error("SDS client is untruthy") @@ -95,13 +128,22 @@ export default function ProviderLogin(props: Props) { console.log("curEndpoint", curEndpoint) const issServerUrl = curEndpoint.config!.iss console.log("issServerUrl", issServerUrl) + console.log("SDS URL (process.env.REACT_APP_SHARED_DATA_ENDPOINT)", process.env.REACT_APP_SHARED_DATA_ENDPOINT) const isLastIndex = i === endpointsLength - 1 console.log("isLastIndex: " + isLastIndex) + // Note: If it's the SDS we don't check for authorization of that endpoint, as it's shared, + // and because we can't authorize w/o a client id, which the SDS itself might not have + // We shouldn't need this logic as there is a gatekeeper on bad SDSs (we don't add them in the first place) + // to be checked against authorizeSelectedEndpoints, but, just in case it slips through... + const isSDSUrl: boolean = issServerUrl === process.env.REACT_APP_SHARED_DATA_ENDPOINT + console.log('isSDSUrl: ', isSDSUrl) + // Check for prior auths from another load or session just in case so we can save some time - if (await isEndpointStillAuthorized(issServerUrl!, false)) { // false so checking ALL endpoints in local storage vs just last one + if (isSDSUrl || await isEndpointStillAuthorized(issServerUrl!, false)) { // false param so checking ALL endpoints in local storage vs just last one console.log("This endpoint IS authorized") - console.log("curEndpoint issServerUrl " + issServerUrl + " at index " + i + " and count " + (i + 1) + "/" + endpointsLength + + console.log("curEndpoint issServerUrl " + issServerUrl + " at index " + i + " and count " + + (i + 1) + "/" + endpointsLength + " is still authorized. Will not waste time reauthorizing: ", curEndpoint) if (isLastIndex) { @@ -145,19 +187,10 @@ export default function ProviderLogin(props: Props) { } else { console.log("Not last index, Authorizing index " + i) } - console.error("curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) - console.error("curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) - console.error("curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) - console.error("curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) - console.error("curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) + console.warn("Before authorize: curEndpoint.config! " + JSON.stringify(curEndpoint.config!)) FHIR.oauth2.authorize(curEndpoint.config!) - - console.error("b curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) - console.error("b curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) - console.error("b curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) - console.error("b curEndpoint.config! "+ JSON.stringify(curEndpoint.config!)) - + console.warn("After authorize: curEndpoint.config! " + JSON.stringify(curEndpoint.config!)) break } @@ -226,7 +259,7 @@ export default function ProviderLogin(props: Props) { const curFhirDataLoaded: FHIRData | undefined = await loadAuthorizedSelectedEndpointMulti(curSelectedEndpoint, true, index) if (curFhirDataLoaded) { - curFhirDataLoaded.serverName = curSelectedEndpoint.name; + curFhirDataLoaded.serverName = curSelectedEndpoint.name console.log("curFhirDataLoaded.serverName:", curFhirDataLoaded.serverName) console.log("curFhirDataLoaded:", curFhirDataLoaded) @@ -241,8 +274,11 @@ export default function ProviderLogin(props: Props) { index++; } } catch (err) { + // NOTE: If we reach here and we aren't on the last index of the endpoints + // then we won't be able to load all of them and see them all. + // It would be better to find a way to handle the error and skip the specific issue + // so we only miss loading the resources with issues. console.log(`Failure in loadSelectedEndpoints: ${err}`) - // TODO: MULTI-PROVIDER: Make this a terminating error } finally { props.setFhirDataStates(fhirDataCollection!) console.log("fhirDataCollection complete in loadSelectedEndpoints:", fhirDataCollection) @@ -285,7 +321,8 @@ export default function ProviderLogin(props: Props) { ${launcherEndpointFromForage === null ? null : undefined}! Cannot add it to other providers...`) } - // Always add SDS, if not null, and add it as the 2nd item in the array so that the order is: + // Add SDS, if not null, and is valid (not missing patient, etc. which would make it undefined as per logic) + // Add it as the 2nd item in the array so that the order is: // 1: Launcher, 2: SDS 1..*, 3: Additional Providers if (sdsClient) { // TODO: Either here or in getSupplementalDataClient or in the useEffect, check URL is valid console.log("SDS is truthy, adding to selected endpoints") diff --git a/src/data-services/fhirService.ts b/src/data-services/fhirService.ts index 0013d02..d17aedf 100644 --- a/src/data-services/fhirService.ts +++ b/src/data-services/fhirService.ts @@ -181,8 +181,6 @@ export const supplementalDataIsAvailable = (): Boolean => { && sdsScope !== undefined && sdsScope?.length > 0 } -// Original -// export const getSupplementalDataClient = async (): Promise => { export const getSupplementalDataClient = async (patientId: string | null): Promise => { console.log('getSupplementalDataClient Start'); let sdsClient: Client | undefined @@ -192,7 +190,7 @@ export const getSupplementalDataClient = async (patientId: string | null): Promi const sdsClientId = process.env.REACT_APP_SHARED_DATA_CLIENT_ID if (sdsClientId && sdsURL) { - console.log('getSupplementalDataClient if (sdsClientId && sdsURL) == true; authorize in using client id') + console.log('getSupplementalDataClient if (sdsClientId && sdsURL) == true; authorize in using client id') const sdsFhirAccessDataObject: fhirclient.ClientState | undefined = await extractFhirAccessDataObjectIfGivenEndpointMatchesAnyPriorEndpoint(sdsURL) if (sdsFhirAccessDataObject) { @@ -202,19 +200,18 @@ export const getSupplementalDataClient = async (patientId: string | null): Promi else if (authURL && sdsURL && sdsScope) { console.log('getSupplementalDataClient else if (authURL && sdsURL && sdsScope) == true; authorize using existing token') - - console.log('getSupplementalDataClient authURL: ', authURL) - console.log('getSupplementalDataClient sdsURL: ', sdsURL) - console.log('getSupplementalDataClient sdsScope: ', sdsScope) + console.log('getSupplementalDataClient authURL: ', authURL) + console.log('getSupplementalDataClient sdsURL: ', sdsURL) + console.log('getSupplementalDataClient sdsScope: ', sdsScope) const authFhirAccessDataObject: fhirclient.ClientState | undefined = await extractFhirAccessDataObjectIfGivenEndpointMatchesAnyPriorEndpoint(authURL) + console.log('getSupplementalDataClient found extractFhirAccessDataObjectIfGivenEndpointMatchesAnyPriorEndpoint using ' + authURL); - console.log('getSupplementalDataClient found extractFhirAccessDataObjectIfGivenEndpointMatchesAnyPriorEndpoint using ' + authURL); if (authFhirAccessDataObject) { console.log("getSupplementalDataClient authFhirAccessDataObject is truthy") // Replace the serverURL and client scope with Shared Data endpoint and scope - var sdsFhirAccessDataObject = authFhirAccessDataObject + let sdsFhirAccessDataObject = authFhirAccessDataObject sdsFhirAccessDataObject.serverUrl = sdsURL sdsFhirAccessDataObject.scope = sdsScope if (sdsFhirAccessDataObject.tokenResponse) { @@ -230,6 +227,11 @@ export const getSupplementalDataClient = async (patientId: string | null): Promi } } + // TODO: Consider check here if SDS is empty and return undefined if so. + // Unfortunately, we wouldn't have the specificity of the error (which is why it wasn't done here), but, + // The program will always know at the most root level that this SDS is not useful, which may be better. + // This includes that knowledge in ProviderLogin w/o the additional logic it has now to determine that. + console.log('getSupplementalDataClient End'); return sdsClient } @@ -428,7 +430,7 @@ export const getFHIRData = async (authorized: boolean, serverUrl: string | null, // setAndLogProgressState, setResourcesLoadedCountState, setAndLogErrorMessageState) const getFHIRDataResult: FHIRData = await getFHIRResources(client, clientScope, supportsInclude, setAndLogProgressState, setResourcesLoadedCountState, setAndLogErrorMessageState) - if (clientOverride) { + if (clientOverride) { getFHIRDataResult.isSDS = true getFHIRDataResult.serverName = "SDS" } @@ -460,7 +462,6 @@ const getFHIRResources = async (client: Client, clientScope: string | undefined, // We could consider that if something is null, to grab from one of these locations (needs reauth required if local), // so it's not null, and can be populated in most cases setAndLogProgressState("Reading patient data", 20) - const patient: Patient = client.patient.id !== null ? await client.patient.read() as Patient @@ -820,14 +821,14 @@ export function createSharedDataResource(resource: Resource) { export function updateSharedDataResource(resource: Resource,serverUrl?: string ) { return getSupplementalDataClient(null) .then((client: Client | undefined) => { - try { + try { if (serverUrl) { const fhirHeaderRequestOption = {} as fhirclient.RequestOptions; const fhirHeaders = new Headers(); // fhirHeaders.append('X-Partition-Name',serverUrl); fhirHeaderRequestOption.headers = fhirHeaders; return client?.update(resource as fhirclient.FHIR.Resource,fhirHeaderRequestOption) - } else { + } else { return client?.update(resource as fhirclient.FHIR.Resource) } } diff --git a/src/data-services/providerEndpointService.ts b/src/data-services/providerEndpointService.ts index 16b307a..f9f93b6 100644 --- a/src/data-services/providerEndpointService.ts +++ b/src/data-services/providerEndpointService.ts @@ -1,11 +1,6 @@ import { fhirclient } from 'fhirclient/lib/types' +import Providers from './endpoints/providers.json' -import Providers from './endpoints/providers.json'; - - - - -const fs = require('fs'); export class ProviderEndpoint { name: string config?: fhirclient.AuthorizeParams @@ -17,22 +12,26 @@ export class ProviderEndpoint { } export const buildAvailableEndpoints = (endpointsToAdd?: ProviderEndpoint[]): ProviderEndpoint[] => { - - let availableEndpoints: ProviderEndpoint[] = []; - let jsonArray = JSON.parse(JSON.stringify(Providers).toString()); + console.log("buildAvailableEndpoints()") + let availableEndpoints: ProviderEndpoint[] = [] + let jsonArray = JSON.parse(JSON.stringify(Providers).toString()) const providers: ProviderEndpoint[] = jsonArray.map((item: any) => { return { name: item.name, config: item.config - }; -}); + } + }) availableEndpoints = availableEndpoints.concat(providers); + console.log("buildAvailableEndpoints: process.env.REACT_APP_SHARED_DATA_CLIENT_ID: ", process.env.REACT_APP_SHARED_DATA_CLIENT_ID) + console.log("buildAvailableEndpoints: process.env.REACT_APP_SHARED_DATA_ENDPOINT: ", process.env.REACT_APP_SHARED_DATA_ENDPOINT) + console.log("buildAvailableEndpoints: process.env.REACT_APP_SHARED_DATA_SCOPE: ", process.env.REACT_APP_SHARED_DATA_SCOPE) if (process.env.REACT_APP_SHARED_DATA_CLIENT_ID && process.env.REACT_APP_SHARED_DATA_ENDPOINT && process.env.REACT_APP_SHARED_DATA_SCOPE) { + console.log("Adding SDS with clientId to availableEndpoints") availableEndpoints = availableEndpoints.concat( { - "name": "eCare Shared Data", + "name": "SDS: eCare Shared Data", "config": { "iss": process.env.REACT_APP_SHARED_DATA_ENDPOINT, "redirectUri": "./index.html", @@ -41,48 +40,36 @@ export const buildAvailableEndpoints = (endpointsToAdd?: ProviderEndpoint[]): Pr } } ) - } + console.log("availableEndpoints after concat: ", availableEndpoints) + } else { + console.log(`Not adding SDS to the availableEndpoints with clientId as at least one of the following env vars are not truthy: + process.env.REACT_APP_SHARED_DATA_CLIENT_ID, process.env.REACT_APP_SHARED_DATA_ENDPOINT, + or process.env.REACT_APP_SHARED_DATA_SCOPE). + Note: We may still add the SDS without a clientId, though.`) + } + if (process.env.REACT_APP_SHARED_DATA_ENDPOINT && process.env.REACT_APP_SHARED_DATA_SCOPE + && !process.env.REACT_APP_SHARED_DATA_CLIENT_ID) { + console.log("Adding SDS without clientId to availableEndpoints") + availableEndpoints = availableEndpoints.concat( + { + "name": "SDS: eCare Shared Data", + "config": { + "iss": process.env.REACT_APP_SHARED_DATA_ENDPOINT, + "redirectUri": "./index.html", + "clientId": "", + "scope": process.env.REACT_APP_SHARED_DATA_SCOPE + } + } + ) + console.log("availableEndpoints after concat: ", availableEndpoints) + } - // TODO: Remove this from the drop down list, but, leave it in availableEndpoints build. - // Maybe these should be two dif things, what is seen/can be selected, and what exists. - // Maybe don't need this at all... maybe can find a better way to track... (local forage, - // or buiding from SDS client data, or just building from SDS env vars - // Maybe we need this though so that when the application leaves, and returns, for a new auth, - // And it tries to access the localFOrage version of selectedEndpoints, it has something to reference? - // SO probably need to add this, and remove from dropdown, but keep in build? - // if (process.env.REACT_APP_ADD_SDS_SANDBOX_TO_PROVIDER_LOGIN_DROPDOWN === 'true') { - // ...Summary: + // TODO: Visually remove SDS from dropdown list (but leave it in programmatically) // The SDS cannot be a launcher, however, the endpoint NEEDS to be added for the application logic to work. // Because, when one leaves the application to authorize, these endpoints are saved to local storage (temporarilly), // and referenced in the logic in that scenario to know what to load on a fresh application launch. - // Thus, we should probably separate this list and the dropdown list, or, at a minimum, remove this from the dropdown - // list visually, or just not add it, within that logic - // Original Meld Test Data SDS - // availableEndpoints.push( - // { - // name: 'SDS Test Data: eCareSharedData Meld Sandbox', - // config: { - // iss: process.env.REACT_APP_SHARED_DATA_ENDPOINT, - // redirectUri: "./index.html", - // clientId: 'xxx', // only used when Shared Data is a separate FHIR server with its own SMART launch flow (which it isn't now) - // scope: process.env.REACT_APP_SHARED_DATA_SCOPE - // } - // } - // ) - // Petient-specific SDS - // availableEndpoints.push( - // { - // name: 'SDS Test Data: eCarePatientData Meld Sandbox', - // config: { - // iss: process.env.REACT_APP_SHARED_DATA_ENDPOINT, - // redirectUri: "./index.html", - // clientId: 'xxx', - // scope: process.env.REACT_APP_SHARED_DATA_SCOPE - // } - // } - // ) - + return availableEndpoints } @@ -93,7 +80,7 @@ export const getMatchingProviderEndpointsFromName = async (availableEndpoints: P selectedEndpointNames: string[]): Promise => { return availableEndpoints.filter(availableEndpoint => { console.log('availableEndpoint.name: ', availableEndpoint?.name) - return selectedEndpointNames.includes(availableEndpoint?.name); + return selectedEndpointNames.includes(availableEndpoint?.name) }) } diff --git a/src/launch.js b/src/launch.js index 51c5727..2436bc5 100644 --- a/src/launch.js +++ b/src/launch.js @@ -15,10 +15,9 @@ const cernerScopePilot = process.env.REACT_APP_CERNER_SANDBOX_ENDPOINT_SCOPE const nextgenScope = "launch launch/patient openid fhirUser offline_access patient/Patient.read patient/Practitioner.read patient/RelatedPerson.read patient/Condition.read patient/DiagnosticReport.read patient/Observation.read patient/Procedure.read patient/CarePlan.read patient/CareTeam.read patient/Goal.read patient/Immunization.read patient/MedicationRequest.read patient/Medication.read patient/Provenance.read patient/Organization.read" const meldScope = "patient/Goal.write patient/Practitioner.read patient/CareTeam.read launch/patient patient/Questionnaire.read openid patient/Goal.read patient/Immunization.read launch patient/ServiceRequest.read patient/Procedure.read fhirUser patient/RelatedPerson.read patient/Provenance.read patient/MedicationRequest.read patient/Task.read patient/Patient.read patient/DiagnosticReport.read patient/Condition.write patient/Condition.read patient/QuestionnaireResponse.write patient/MedicationRequest.write patient/Observation.read patient/CarePlan.read" - const meldmatch = "https://gw.interop.community/"+process.env.REACT_APP_MELD_SANDBOX_NAME+"/data" - + const availableEndpoints = [ { // OHSU FHIR dev @@ -36,6 +35,7 @@ const availableEndpoints = [ }, { // Meld Synthea test data sandbox + // Replace REACT_APP_MELD_SANDBOX_NAME and REACT_APP_MELD_SANDBOX_CLIENT_ID with the MELD launcher you want to use issMatch: iss => iss.startsWith(meldmatch), redirectUri: "./index.html", clientId: process.env.REACT_APP_MELD_SANDBOX_CLIENT_ID, @@ -125,7 +125,7 @@ const availableEndpoints = [ } ] -if (process.env.REACT_APP_SHARED_DATA_CLIENT_ID +if (process.env.REACT_APP_SHARED_DATA_CLIENT_ID && process.env.REACT_APP_SHARED_DATA_ENDPOINT && process.env.REACT_APP_SHARED_DATA_SCOPE) { availableEndpoints.push( { From c3f020cb122405746277827bb4c7932f159522fa Mon Sep 17 00:00:00 2001 From: Sai Kiran Reddy Konda Date: Mon, 6 May 2024 11:42:50 -0400 Subject: [PATCH 4/7] sort and filter --- src/components/sort-modal/sortModal.tsx | 11 +- .../sort-only-modal/sortOnlyModal.css | 13 + .../sort-only-modal/sortOnlyModal.tsx | 54 ++ src/components/summaries/ConditionList.tsx | 215 ++++---- src/components/summaries/GoalList.tsx | 473 +++++++++--------- src/components/summaries/ImmunizationList.tsx | 277 +++++----- src/components/summaries/LabResultList.tsx | 195 ++++---- src/components/summaries/MedicationList.tsx | 187 ++++--- .../summaries/ServiceRequestList.tsx | 122 +++-- src/components/summaries/VitalsList.tsx | 193 +++---- 10 files changed, 947 insertions(+), 793 deletions(-) create mode 100644 src/components/sort-only-modal/sortOnlyModal.css create mode 100644 src/components/sort-only-modal/sortOnlyModal.tsx diff --git a/src/components/sort-modal/sortModal.tsx b/src/components/sort-modal/sortModal.tsx index 9a29e0b..1f88006 100644 --- a/src/components/sort-modal/sortModal.tsx +++ b/src/components/sort-modal/sortModal.tsx @@ -4,21 +4,26 @@ import { Button, Form, Modal } from 'react-bootstrap'; interface SortModalProps { showModal: boolean; closeModal: () => void; - onSubmit: (sortOption: string, filterOption: string) => void; + onSubmit: (sortOption: string, filterOption: string[]) => void; sortingOptions: { value: string; label: string }[]; // Array of sorting options filteringOptions: { value: string; label: string }[]; } export const SortModal: React.FC = ({ showModal, closeModal, onSubmit, sortingOptions, filteringOptions }) => { const [sortOption, setSortOption] = React.useState(''); - const [filterOption, setFilterOption] = React.useState(''); + const [filterOption, setFilterOption] = React.useState([]); const handleSortOptionChange = (event: React.ChangeEvent) => { setSortOption(event.target.value); }; const handleFilterOptionChange = (event: React.ChangeEvent) => { - setFilterOption(event.target.value); + const value = event.target.value; + if (event.target.checked) { + setFilterOption(prevOptions => [...prevOptions, value]); // Add value to the array + } else { + setFilterOption(prevOptions => prevOptions.filter(option => option !== value)); // Remove value from the array + } }; const handleSubmit = () => { diff --git a/src/components/sort-only-modal/sortOnlyModal.css b/src/components/sort-only-modal/sortOnlyModal.css new file mode 100644 index 0000000..10ba01a --- /dev/null +++ b/src/components/sort-only-modal/sortOnlyModal.css @@ -0,0 +1,13 @@ +.close-button svg path, .submit-button svg path { + fill: rgb(var(--color-light-text)) !important; +} +/* .radio-color { + background-color: #0d6efd; + border-color: #0d6efd; */ +/* } */ +input[type="radio"] { + background-color: red; +} +#default-radio{ + background-color: red; +} \ No newline at end of file diff --git a/src/components/sort-only-modal/sortOnlyModal.tsx b/src/components/sort-only-modal/sortOnlyModal.tsx new file mode 100644 index 0000000..56b9761 --- /dev/null +++ b/src/components/sort-only-modal/sortOnlyModal.tsx @@ -0,0 +1,54 @@ +import React from 'react'; +import { Button, Form, Modal } from 'react-bootstrap'; + +interface SortOnlyModalProps { + showModal: boolean; + closeModal: () => void; + onSubmit: (sortOption: string) => void; + sortingOptions: { value: string; label: string }[]; // Array of sorting options +} + +export const SortOnlyModal: React.FC = ({ showModal, closeModal, onSubmit, sortingOptions }) => { + const [sortOption, setSortOption] = React.useState(''); + + const handleSortOptionChange = (event: React.ChangeEvent) => { + setSortOption(event.target.value); + }; + + const handleSubmit = () => { + onSubmit(sortOption); + }; + + return ( + <> + + + Sort Options + + +
    + {sortingOptions.map(option => ( + + ))} + +
    + + + + +
    + + ); +}; diff --git a/src/components/summaries/ConditionList.tsx b/src/components/summaries/ConditionList.tsx index 0cbdcd9..fb883ec 100644 --- a/src/components/summaries/ConditionList.tsx +++ b/src/components/summaries/ConditionList.tsx @@ -1,11 +1,12 @@ import '../../Home.css'; -import React, { useEffect, useState } from 'react'; +import React, { FC, useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; import { FHIRData, displayDate } from '../../data-services/models/fhirResources'; import { ConditionSummary } from '../../data-services/models/cqlSummary'; import { Summary, SummaryRowItem, SummaryRowItems } from './Summary'; import { BusySpinner } from '../busy-spinner/BusySpinner'; import { SortModal } from '../sort-modal/sortModal'; +import { SortOnlyModal } from '../sort-only-modal/sortOnlyModal'; interface ConditionListProps { fhirDataCollection?: FHIRData[], @@ -13,119 +14,110 @@ interface ConditionListProps { canShareData?: boolean, } -interface ConditionListState { -} - -export const ConditionList: React.FC = (props: ConditionListProps) => { +export const ConditionList: FC = ({ fhirDataCollection, conditionSummaryMatrix, canShareData }) => { process.env.REACT_APP_DEBUG_LOG === "true" && console.log("ConditionList component RENDERED!") const [showModal, setShowModal] = useState(false); const [sortingOption, setSortingOption] = useState(''); - const [filteringOption, setFilteringOption] = useState(''); + const [filteringOption, setFilteringOption] = useState([]); const [sortedAndFilteredMatrix, setSortedAndFilteredMatrix] = useState(); const [filteringOptions, setFilteringOptions] = useState<{ value: string; label: string }[]>([]); - const conSumMatrix: ConditionSummary[][] | undefined = props.conditionSummaryMatrix useEffect(() => { applySortingAndFiltering(); - }, [props.conditionSummaryMatrix, sortingOption, filteringOption]); + }, [conditionSummaryMatrix, sortingOption, filteringOption]); useEffect(() => { - if (props.conditionSummaryMatrix) { + if (conditionSummaryMatrix) { generateFilteringOptions(); } - }, [props.conditionSummaryMatrix]); + }, [conditionSummaryMatrix]); const closeModal = () => { setShowModal(false); }; - const handleSortFilterSubmit = (sortOption: string, filterOption: string) => { + const handleSortFilterSubmit = (sortOption: string, filterOption?: string[]) => { setSortingOption(sortOption); - setFilteringOption(filterOption); + if(filterOption){ + setFilteringOption(filterOption); + } setShowModal(false); }; const generateFilteringOptions = () => { - if (!props.conditionSummaryMatrix) return; - - const provenanceValues: string[] = []; - - props.conditionSummaryMatrix.forEach(conditionSummaries => { - conditionSummaries.forEach(condition => { - condition.Provenance?.forEach(provenance => { - if (provenance.Transmitter) { - provenanceValues.push(provenance.Transmitter); - } - }); - }); - }); - - const uniqueProvenanceValues = Array.from(new Set(provenanceValues)); + if (!fhirDataCollection || fhirDataCollection.length === 0) { + setFilteringOptions([]); + return; + } - const options = uniqueProvenanceValues.map(value => ({ - value: value, - label: value, + const uniqueServerNames = Array.from(new Set(fhirDataCollection.map(data => data.serverName))); + const options = uniqueServerNames.map(value => ({ + value: value || '', + label: value || '', })); setFilteringOptions(options); }; + + const sortingOptions = [ + { value: 'alphabetical-az', label: 'Alphabetical: A-Z' }, + { value: 'alphabetical-za', label: 'Alphabetical: Z-A' }, + { value: 'newest', label: 'Date Created: Newest' }, + { value: 'oldest', label: 'Date Created: Oldest' }, + ]; const applySortingAndFiltering = () => { - if (!props.conditionSummaryMatrix) return; - - let sortedMatrix = props.conditionSummaryMatrix; - if (sortingOption === 'alphabetical-az') { - sortedMatrix = props.conditionSummaryMatrix.map(conditionSummaries => - [...conditionSummaries].sort((a, b) => { - const nameA = a.CommonName ?? a.ConceptName ?? 'Missing Condition Name'; - const nameB = b.CommonName ?? b.ConceptName ?? 'Missing Condition Name'; - return nameA.localeCompare(nameB); - }) - ); - } else if (sortingOption === 'alphabetical-za') { - sortedMatrix = props.conditionSummaryMatrix.map(conditionSummaries => - [...conditionSummaries].sort((a, b) => { - const nameA = a.CommonName ?? a.ConceptName ?? 'Missing Condition Name'; - const nameB = b.CommonName ?? b.ConceptName ?? 'Missing Condition Name'; - return nameB.localeCompare(nameA); - }) - ); - } else if (sortingOption === 'newest') { - sortedMatrix = props.conditionSummaryMatrix.map(conditionSummaries => - [...conditionSummaries].sort((a, b) => { - if (a.OnsetDate && b.OnsetDate) { - return b.OnsetDate.localeCompare(a.OnsetDate); - } else if (!a.OnsetDate) { - return 1; - } else { - return -1; - } - }) - ); - } else if (sortingOption === 'oldest') { - sortedMatrix = props.conditionSummaryMatrix.map(conditionSummaries => - [...conditionSummaries].sort((a, b) => { - if (a.OnsetDate && b.OnsetDate) { - return a.OnsetDate.localeCompare(b.OnsetDate); - } else if (!a.OnsetDate) { - return -1; - } else { - return 1; - } - }) - ); - } + if (!conditionSummaryMatrix) return; - let filteredMatrix = sortedMatrix; - if (filteringOption) { - filteredMatrix = sortedMatrix.map(conditionSummaries => - conditionSummaries.filter(condition => - condition.Provenance?.some(provenance => provenance.Transmitter === filteringOption) - ) - ); + let filteredAndSortedMatrix = [...conditionSummaryMatrix]; + + if (filteringOption.length > 0 && fhirDataCollection) { + const filteredMatrix: ConditionSummary[][] = []; + + // Iterate over the goalSummaryMatrix length and push empty arrays to filteredMatrix + for (let i = 0; i < conditionSummaryMatrix!.length; i++) { + filteredMatrix.push([]); + } + + filteringOption.forEach(option => { + // Find the index of the selected option in the filteringOptions array + const index = filteringOptions.findIndex(item => item.value === option); + // If index is found, push the corresponding entry from goalSummaryMatrix to filteredMatrix + if (index !== -1) { + filteredMatrix[index] = filteredAndSortedMatrix[index]; + } + }); + + filteredAndSortedMatrix = filteredMatrix.filter(matrix => matrix !== undefined); + } + + + switch (sortingOption) { + case 'alphabetical-az': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (a.CommonName || '').localeCompare(b.CommonName || '')) + ); + break; + case 'alphabetical-za': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (b.CommonName || '').localeCompare(a.CommonName || '')) + ); + break; + case 'newest': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (b.OnsetDate || '').localeCompare(a.OnsetDate || '')) + ); + break; + case 'oldest': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (a.OnsetDate || '').localeCompare(b.OnsetDate || '')) + ); + break; + default: + break; } - setSortedAndFilteredMatrix(filteredMatrix); + setSortedAndFilteredMatrix(filteredAndSortedMatrix); }; return ( @@ -134,32 +126,45 @@ export const ConditionList: React.FC = (props: ConditionList

    Current Health Issues

    - {props.fhirDataCollection === undefined + {fhirDataCollection === undefined && <>

    Reading your clinical records...

    - + } - {props.canShareData - ?

    Add a Health Concern

    + {canShareData + ?

    + Add a Health Concern + +

    :

    } - setShowModal(true)}> - SORT/FILTER - - {showModal ? ( - - ) : null} + {fhirDataCollection && fhirDataCollection.length === 1 ? ( // Checking for single provider + setShowModal(true)}> + SORT + + ) : ( + setShowModal(true)}> + SORT/FILTER + + )} + {showModal && ( // Conditional rendering of modal based on the number of providers + fhirDataCollection && fhirDataCollection.length === 1 ? ( + + ) : ( + + ) + )} { sortedAndFilteredMatrix?.map((conditionSummary, index) => { @@ -169,12 +174,12 @@ export const ConditionList: React.FC = (props: ConditionList { conditionSummary && conditionSummary.length > 0 && conditionSummary[0]?.ConceptName === 'init' ?

    Loading...

    - : (!conditionSummary || conditionSummary.length < 1) && props.fhirDataCollection !== undefined + : (!conditionSummary || conditionSummary.length < 1) && fhirDataCollection !== undefined ?

    No records found.

    :
    {conditionSummary?.map((cond, idx) => ( - + ))}
    } diff --git a/src/components/summaries/GoalList.tsx b/src/components/summaries/GoalList.tsx index f8ae89e..b6ce42c 100644 --- a/src/components/summaries/GoalList.tsx +++ b/src/components/summaries/GoalList.tsx @@ -1,331 +1,316 @@ import '../../Home.css'; -import React , { useEffect, useState } from 'react'; +import React, { FC, useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; -import { FHIRData, displayDate } from '../../data-services/models/fhirResources'; +import { FHIRData } from '../../data-services/models/fhirResources'; import { GoalSummary, GoalTarget } from '../../data-services/models/cqlSummary'; import { Summary, SummaryRowItem, SummaryRowItems } from './Summary'; import { BusySpinner } from '../busy-spinner/BusySpinner'; import { SortModal } from '../sort-modal/sortModal'; -import { Button } from '@mui/material'; +import { SortOnlyModal } from '../sort-only-modal/sortOnlyModal'; + interface GoalListProps { - fhirDataCollection?: FHIRData[], - goalSummaryMatrix?: GoalSummary[][], - canShareData?: boolean, + fhirDataCollection?: FHIRData[]; + goalSummaryMatrix?: GoalSummary[][]; + canShareData?: boolean; } -export const GoalList: React.FC = (props: GoalListProps) => { +export const GoalList: FC = ({ fhirDataCollection, goalSummaryMatrix, canShareData }) => { process.env.REACT_APP_DEBUG_LOG === "true" && console.log("GoalList component RENDERED!") const [showModal, setShowModal] = useState(false); - const [sortingOption, setSortingOption] = useState(''); // State for sorting option - const [filteringOption, setFilteringOption] = useState(''); // State for filtering option + const [sortingOption, setSortingOption] = useState(''); + const [filteringOption, setFilteringOption] = useState([]); const [sortedAndFilteredMatrix, setSortedAndFilteredMatrix] = useState(); const [filteringOptions, setFilteringOptions] = useState<{ value: string; label: string }[]>([]); - const goalSumMatrix: GoalSummary[][] | undefined = props.goalSummaryMatrix - useEffect(() => { applySortingAndFiltering(); - }, [goalSumMatrix, sortingOption, filteringOption]); + }, [goalSummaryMatrix, sortingOption, filteringOption]); useEffect(() => { - if (goalSumMatrix) { - generateFilteringOptions(); + if (goalSummaryMatrix) { + generateFilteringOptions(); } -}, [goalSumMatrix]); + }, [goalSummaryMatrix]); - const closeModal = ()=>{ - setShowModal(false) - } + const closeModal = () => { + setShowModal(false); + }; - const handleSortFilterSubmit = (sortOption: string, filterOption: string) => { + const handleSortFilterSubmit = (sortOption: string, filterOption?: string[]) => { setSortingOption(sortOption); + if(filterOption){ setFilteringOption(filterOption); + } setShowModal(false); }; const generateFilteringOptions = () => { - if (!goalSumMatrix) return; - - const provenanceValues: string[] = []; - - goalSumMatrix.forEach(providerGoals => { - providerGoals.forEach(goal => { - goal.Provenance?.forEach(provenance => { - if (provenance.Transmitter) { - provenanceValues.push(provenance.Transmitter); - } - }); - }); - }); - - const uniqueProvenanceValues = Array.from(new Set(provenanceValues)); + if (!fhirDataCollection || fhirDataCollection.length === 0) { + setFilteringOptions([]); + return; + } - const options = uniqueProvenanceValues.map(value => ({ - value: value, - label: value, + const uniqueServerNames = Array.from(new Set(fhirDataCollection.map(data => data.serverName))); + const options = uniqueServerNames.map(value => ({ + value: value || '', + label: value || '', })); setFilteringOptions(options); -}; + }; const sortingOptions = [ { value: 'alphabetical-az', label: 'Alphabetical: A-Z' }, { value: 'alphabetical-za', label: 'Alphabetical: Z-A' }, { value: 'newest', label: 'Date Created: Newest' }, - { value: 'oldest', label: 'Date Created: Oldest' } -]; - - - -const applySortingAndFiltering = () => { - if (!goalSumMatrix) return; - - let sortedMatrix = goalSumMatrix; - if (sortingOption === 'alphabetical-az') { - sortedMatrix = goalSumMatrix.map(providerGoals => - [...providerGoals].sort((a, b) => (a.Description || '').localeCompare(b.Description || '')) - ); - } else if (sortingOption === 'alphabetical-za') { - sortedMatrix = goalSumMatrix.map(providerGoals => - [...providerGoals].sort((a, b) => (b.Description || '').localeCompare(a.Description || '')) - ); - } else if (sortingOption === 'newest') { - sortedMatrix = goalSumMatrix.map(providerGoals => - [...providerGoals].sort((a, b) => { - if (a.StartDate && b.StartDate) { - return b.StartDate.localeCompare(a.StartDate); - } else if (!a.StartDate) { - return 1; - } else { - return -1; - } - }) - ); - } else if (sortingOption === 'oldest') { - sortedMatrix = goalSumMatrix.map(providerGoals => - [...providerGoals].sort((a, b) => { - if (a.StartDate && b.StartDate) { - return a.StartDate.localeCompare(b.StartDate); - } else if (!a.StartDate) { - return -1; - } else { - return 1; - } - }) - ); - } - - let filteredMatrix = sortedMatrix; - if (filteringOption) { - filteredMatrix = sortedMatrix.map(providerGoals => - providerGoals.filter(goal => - goal.Provenance?.some(provenance => provenance.Transmitter === filteringOption) - ) - ); -} - - setSortedAndFilteredMatrix(filteredMatrix); -}; + { value: 'oldest', label: 'Date Created: Oldest' }, + ]; + + const applySortingAndFiltering = () => { + if (!goalSummaryMatrix) return; + + let filteredAndSortedMatrix = [...goalSummaryMatrix]; + + if (filteringOption.length > 0 && fhirDataCollection) { + const filteredMatrix: GoalSummary[][] = []; + + // Iterate over the goalSummaryMatrix length and push empty arrays to filteredMatrix + for (let i = 0; i < goalSummaryMatrix!.length; i++) { + filteredMatrix.push([]); + } + + filteringOption.forEach(option => { + // Find the index of the selected option in the filteringOptions array + const index = filteringOptions.findIndex(item => item.value === option); + // If index is found, push the corresponding entry from goalSummaryMatrix to filteredMatrix + if (index !== -1) { + filteredMatrix[index] = filteredAndSortedMatrix[index]; + } + }); + + filteredAndSortedMatrix = filteredMatrix.filter(matrix => matrix !== undefined); + } + + + switch (sortingOption) { + case 'alphabetical-az': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (a.Description || '').localeCompare(b.Description || '')) + ); + break; + case 'alphabetical-za': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (b.Description || '').localeCompare(a.Description || '')) + ); + break; + case 'newest': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (b.StartDate || '').localeCompare(a.StartDate || '')) + ); + break; + case 'oldest': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (a.StartDate || '').localeCompare(b.StartDate || '')) + ); + break; + default: + break; + } - // // Function to sort the goalSumMatrix based on the selected option - // const sortGoalSumMatrix = (matrix: GoalSummary[][] | undefined, option: string) => { - // // Implement sorting logic based on the selected option - // // For example, you can use array.sort() method - // // and update goalSumMatrix state with the sorted array - // }; - - // // Function to filter the goalSumMatrix based on the selected option - // const filterGoalSumMatrix = (matrix: GoalSummary[][] | undefined, option: string) => { - // // Implement filtering logic based on the selected option - // // and update goalSumMatrix state with the filtered array - // }; + setSortedAndFilteredMatrix(filteredAndSortedMatrix); + }; return (
    -

    Health Goals

    - {props.fhirDataCollection === undefined - && <>

    Reading your clinical records...

    - + {fhirDataCollection === undefined && ( + <> +

    Reading your clinical records...

    + - } - - {props.canShareData - ?

    Add a New Goal

    - :

    } - - setShowModal(true)}>SORT/FILTER - {showModal ? :null} - - { - sortedAndFilteredMatrix?.map((goalSummary, index) => { - - return ( -

    - { - goalSummary && goalSummary.length > 0 && goalSummary[0]?.Description === 'init' - ?

    Loading...

    - : (!goalSummary || goalSummary.length < 1) && props.fhirDataCollection !== undefined - ?

    No records found.

    - : -
    - {goalSummary?.map((goal, idx) => ( - - ))} -
    - } + )} + + {canShareData && ( +

    + + Add a New Goal + +

    + )} + + {fhirDataCollection && fhirDataCollection.length === 1 ? ( // Checking for single provider + setShowModal(true)}> + SORT + + ) : ( + setShowModal(true)}> + SORT/FILTER + + )} + {showModal && ( // Conditional rendering of modal based on the number of providers + fhirDataCollection && fhirDataCollection.length === 1 ? ( + + ) : ( + + ) + )} + + {sortedAndFilteredMatrix?.map((goalSummary, index) => ( +
    + {goalSummary && goalSummary.length > 0 && goalSummary[0]?.Description === 'init' ? ( +

    Loading...

    + ) : !goalSummary || goalSummary.length < 1 ? ( +

    No records found.

    + ) : ( +
    + {goalSummary?.map((goal, idx) => ( + + ))}
    - ) - - }) - } - + )} +
    + ))}
    - ) + ); +}; -} +const buildRows = (goal: GoalSummary, theSource?: string): SummaryRowItems => { + let rows: SummaryRowItems = [ + { + isHeader: true, + twoColumns: false, + data1: goal.Description, + data2: '', + }, + { + isHeader: false, + twoColumns: true, + data1: goal.ExpressedBy, + data2: goal.StartDate === null ? '' : 'Start: ' + goal.StartDate, + }, + ]; -const buildRows = (goal: GoalSummary, theSource?:string): SummaryRowItems => { - let rows: SummaryRowItems = - [ - { - isHeader: true, - twoColumns: false, - data1: goal.Description, - data2: '', - }, - { - isHeader: false, - twoColumns: true, - data1: goal.ExpressedBy, - data2: goal.StartDate === null ? '' - : 'Start: ' + displayDate(goal.StartDate), - }, - ] - - const targets: SummaryRowItems = buildTargets(goal) + const targets: SummaryRowItems = buildTargets(goal); if (targets?.length) { - rows = rows.concat(targets) + rows = rows.concat(targets); } - const status: SummaryRowItem = { - isHeader: false, - twoColumns: false, - data1: 'Status: ' + (goal.LifecycleStatus ?? 'Unknown') + (goal.AchievementStatus === null ? '' : ' -- ' + goal.AchievementStatus), - data2:'', - } - rows = rows.concat(status) - const addresses: SummaryRowItems | undefined = goal.Addresses?.map((focus) => ( - { - isHeader: false, - twoColumns: false, - data1: 'Focus: ' + (focus.DisplayName ?? 'Unknown'), - data2: '', - } - )) + const addresses: SummaryRowItems | undefined = goal.Addresses?.map(concern => ({ + isHeader: false, + twoColumns: false, + data1: 'Addresses: ' + (concern.DisplayName ?? 'Unknown'), + data2: '', + })); if (addresses?.length) { - rows = rows.concat(addresses) + rows = rows.concat(addresses); } - if (goal.LearnMore !== undefined && goal.LearnMore !== null) { - const learnMore: SummaryRowItem = { - isHeader: false, - twoColumns: false, - data1: - { event.preventDefault(); window.open(goal.LearnMore); } - }>Learn More - , - data2: '', - } - rows.push(learnMore) - } + const learnMore: SummaryRowItem = { + isHeader: false, + twoColumns: false, + data1: + goal.LearnMore === undefined || goal.LearnMore === null ? '' : ( + { + event.preventDefault(); + window.open(goal.LearnMore); + }} + > + Learn More + + ), + data2: '', + }; + rows.push(learnMore); - const notes: SummaryRowItems | undefined = goal.Notes?.map((note) => ( - { - isHeader: false, - twoColumns: false, - data1: 'Note: ' + note, - data2: '', - } - )) + const notes: SummaryRowItems | undefined = goal.Notes?.map(note => ({ + isHeader: false, + twoColumns: false, + data1: 'Note: ' + note, + data2: '', + })); if (notes?.length) { - rows = rows.concat(notes) - } - - const provenance: SummaryRowItems | undefined = goal.Provenance?.map((provenance) => ( - { - isHeader: false, - twoColumns: false, - data1: 'Source: ' + provenance.Transmitter ?? '', - data2: provenance.Author ?? '', - } - )) - if (provenance?.length) { - rows = rows.concat(provenance) + rows = rows.concat(notes); } - const hasProvenance = goal.Provenance?.length ?? 0 > 0 - if (theSource && !hasProvenance) { + if (theSource) { const source: SummaryRowItem = { isHeader: false, twoColumns: false, - data1: 'Source ' + theSource, + data1: 'From ' + theSource, data2: '', - } - rows.push(source) + }; + rows.push(source); } - return rows -} + const provenance: SummaryRowItems | undefined = goal.Provenance?.map(provenance => ({ + isHeader: false, + twoColumns: true, + data1: 'Source: ' + (provenance.Transmitter ?? ''), + data2: provenance.Author ?? '', + })); + if (provenance?.length) { + rows = rows.concat(provenance); + } -const buildTargets = (goal: GoalSummary): SummaryRowItems => { - let targets: SummaryRowItems = [] + return rows; +}; - goal.Target?.forEach((curTarget) => { +const buildTargets = (goal: GoalSummary): SummaryRowItems => { + let targets: SummaryRowItems = []; - let isPushLastResultTextAndDateOnly: boolean = (curTarget.DueDate === null || curTarget.DueDate === undefined) - && (curTarget.TargetValue === null || curTarget.TargetValue === undefined) + goal.Target?.forEach(curTarget => { + let isPushLastResultTextAndDateOnly: boolean = + (curTarget.DueDate === null || curTarget.DueDate === undefined) && + (curTarget.TargetValue === null || curTarget.TargetValue === undefined); - let isPushTargetValueAndDueDateOnly: boolean = !curTarget.LastResult || !curTarget.LastResult.Date + let isPushTargetValueAndDueDateOnly: boolean = !curTarget.LastResult || !curTarget.LastResult.Date; - let isPushBoth = !isPushLastResultTextAndDateOnly && !isPushTargetValueAndDueDateOnly + let isPushBoth = !isPushLastResultTextAndDateOnly && !isPushTargetValueAndDueDateOnly; if (isPushLastResultTextAndDateOnly && !isPushTargetValueAndDueDateOnly) { - // Skip targetValueAndDueDate, add lastResultTextAndDate only - targets.push(buildLastResultTextAndDate(curTarget)) + targets.push(buildLastResultTextAndDate(curTarget)); } else if (isPushTargetValueAndDueDateOnly && !isPushLastResultTextAndDateOnly) { - // Skip lastResultTextAndDate, add targetValueAndDueDate only - targets.push(buildTargetValueAndDueDate(curTarget)) + targets.push(buildTargetValueAndDueDate(curTarget)); } else if (isPushBoth) { - // Push both targetValueAndDueDate and lastResultTextAndDate as enough data is valid - targets.push(buildTargetValueAndDueDate(curTarget)) - targets.push(buildLastResultTextAndDate(curTarget)) + targets.push(buildTargetValueAndDueDate(curTarget)); + targets.push(buildLastResultTextAndDate(curTarget)); } + }); - }) - - return targets -} + return targets; +}; const buildLastResultTextAndDate = (curTarget: GoalTarget): SummaryRowItem => { return { isHeader: false, twoColumns: false, - data1: 'Last Value: ' + (curTarget.LastResult?.ResultText ?? '?') + ' on ' + displayDate(curTarget.LastResult?.Date), + data1: 'Last Value: ' + (curTarget.LastResult?.ResultText ?? '?') + ' on ' + (curTarget.LastResult?.Date || ''), data2: '', - } -} + }; +}; const buildTargetValueAndDueDate = (curTarget: GoalTarget): SummaryRowItem => { return { isHeader: false, twoColumns: true, - data1: curTarget.TargetValue === null ? '' : 'Target: ' + curTarget?.TargetValue, - data2: curTarget.DueDate === null ? '' : 'Due: ' + displayDate(curTarget?.DueDate), - } -} \ No newline at end of file + data1: curTarget.TargetValue === null ? '' : 'Target: ' + curTarget.TargetValue, + data2: curTarget.DueDate === null ? '' : 'Due: ' + curTarget.DueDate, + }; +}; diff --git a/src/components/summaries/ImmunizationList.tsx b/src/components/summaries/ImmunizationList.tsx index bb2dc79..27e5f6a 100644 --- a/src/components/summaries/ImmunizationList.tsx +++ b/src/components/summaries/ImmunizationList.tsx @@ -1,131 +1,162 @@ -import '../../Home.css'; -import React, { useState, useEffect } from 'react'; +import React, { FC, useState, useEffect } from 'react'; import { FHIRData, displayDate } from '../../data-services/models/fhirResources'; import { Summary, SummaryRowItem, SummaryRowItems } from './Summary'; import { Immunization } from '../../data-services/fhir-types/fhir-r4'; import { BusySpinner } from '../busy-spinner/BusySpinner'; import { SortModal } from '../sort-modal/sortModal'; +import { SortOnlyModal } from '../sort-only-modal/sortOnlyModal'; + interface ImmunizationListProps { - fhirDataCollection?: FHIRData[], + fhirDataCollection?: FHIRData[]; } -export const ImmunizationList: React.FC = (props: ImmunizationListProps) => { - process.env.REACT_APP_DEBUG_LOG === "true" && console.log("ImmunizationList component RENDERED!") +export const ImmunizationList: FC = ({fhirDataCollection}) => { + process.env.REACT_APP_DEBUG_LOG === "true" && console.log("ImmunizationList component RENDERED!"); const [sortedImmunizations, setSortedImmunizations] = useState([]); const [showModal, setShowModal] = useState(false); const [sortOption, setSortOption] = useState(''); - const [filterOption, setFilterOption] = useState(''); + const [filterOption, setFilterOption] = useState([]); const [filteringOptions, setFilteringOptions] = useState<{ value: string; label: string }[]>([]); - console.log("ImmunizationList", props.fhirDataCollection); + useEffect(() => { + applySortingAndFiltering(); + }, [fhirDataCollection, sortOption, filterOption]); useEffect(() => { - applySorting(); - }, [props.fhirDataCollection, sortOption, filterOption]); + generateFilteringOptions(); + }, [fhirDataCollection]); const closeModal = () => { setShowModal(false); }; - const handleSortFilterSubmit = (sortOption: string, filterOption: string) => { + const handleSortFilterSubmit = (sortOption: string, filterOption?: string[]) => { setSortOption(sortOption); + if(filterOption){ setFilterOption(filterOption); + } setShowModal(false); }; - const applySorting = () => { - const sorted = props.fhirDataCollection?.map(data => { - let immunizations = data?.immunizations; - if (sortOption === 'newest') { - immunizations = immunizations?.sort((a, b) => { - const dateA = a.occurrenceDateTime ?? a.recorded; - const dateB = b.occurrenceDateTime ?? b.recorded; - return dateB.localeCompare(dateA); - }); - } else if (sortOption === 'oldest') { - immunizations = immunizations?.sort((a, b) => { - const dateA = a.occurrenceDateTime ?? a.recorded; - const dateB = b.occurrenceDateTime ?? b.recorded; - return dateA.localeCompare(dateB); - }); - } else if (sortOption === 'alphabetical-az') { - immunizations = immunizations?.sort((a, b) => { - const nameA = a.vaccineCode?.text?.toUpperCase() ?? ''; - const nameB = b.vaccineCode?.text?.toUpperCase() ?? ''; - return nameA.localeCompare(nameB); - }); - } else if(sortOption === 'alphabetical-za'){ - immunizations = immunizations?.sort((a, b) => { - const nameA = a.vaccineCode?.text?.toUpperCase() ?? ''; - const nameB = b.vaccineCode?.text?.toUpperCase() ?? ''; - return nameB.localeCompare(nameA); - }); - } - - if (filterOption) { - immunizations = immunizations?.filter((immunization) => immunization.location?.display === filterOption); - } - - return immunizations || []; - }); - - setSortedImmunizations(sorted); - }; - const generateFilteringOptions = () => { - if (!props.fhirDataCollection) return; - - const sourceValues: string[] = []; - - props.fhirDataCollection.forEach(data => { - data?.immunizations?.forEach(immunization => { - if (immunization.location?.display) { - sourceValues.push(immunization.location.display); - } - }); - }); - - const uniqueSourceValues = Array.from(new Set(sourceValues)); + if (!fhirDataCollection || fhirDataCollection.length === 0) { + setFilteringOptions([]); + return; + } - const options = uniqueSourceValues.map(value => ({ - value: value, - label: value + const uniqueServerNames = Array.from(new Set(fhirDataCollection.map(data => data.serverName))); + const options = uniqueServerNames.map(value => ({ + value: value || '', + label: value || '', })); setFilteringOptions(options); }; + const sortingOptions = [ + { value: 'alphabetical-az', label: 'Alphabetical: A-Z' }, + { value: 'alphabetical-za', label: 'Alphabetical: Z-A' }, + { value: 'newest', label: 'Date Created: Newest' }, + { value: 'oldest', label: 'Date Created: Oldest' }, + ]; + + const applySortingAndFiltering = () => { + if (!fhirDataCollection) return; + + const filtered = fhirDataCollection.map(data => { + let immunizations = data?.immunizations; + + // Filtering logic modified to filter based on serverName + if (filterOption.length > 0) { + immunizations = immunizations?.filter(immunization => + data.serverName && filterOption.includes(data.serverName) + ); + } + + return immunizations || []; + }); + + // Apply sorting to the filtered immunizations + const sorted = filtered.map(immunizations => { + if (!immunizations) return []; + + // Sorting logic remains the same as before + switch (sortOption) { + case 'newest': + return immunizations.sort((a, b) => { + const dateA = a.occurrenceDateTime ?? a.recorded; + const dateB = b.occurrenceDateTime ?? b.recorded; + return dateB.localeCompare(dateA); + }); + case 'oldest': + return immunizations.sort((a, b) => { + const dateA = a.occurrenceDateTime ?? a.recorded; + const dateB = b.occurrenceDateTime ?? b.recorded; + return dateA.localeCompare(dateB); + }); + case 'alphabetical-az': + return immunizations.sort((a, b) => { + const nameA = a.vaccineCode?.text?.toUpperCase() ?? ''; + const nameB = b.vaccineCode?.text?.toUpperCase() ?? ''; + return nameA.localeCompare(nameB); + }); + case 'alphabetical-za': + return immunizations.sort((a, b) => { + const nameA = a.vaccineCode?.text?.toUpperCase() ?? ''; + const nameB = b.vaccineCode?.text?.toUpperCase() ?? ''; + return nameB.localeCompare(nameA); + }); + default: + return immunizations; + } + }); + setSortedImmunizations(sorted); + }; + return (

    Immunizations

    - {props.fhirDataCollection === undefined - && <>

    Reading your clinical records...

    - + {fhirDataCollection === undefined && ( + <> +

    Reading your clinical records...

    + - } - - setShowModal(true)}> - SORT/FILTER - - + )} + +{fhirDataCollection && fhirDataCollection.length === 1 ? ( // Checking for single provider + setShowModal(true)}> + SORT + + ) : ( + setShowModal(true)}> + SORT/FILTER + + )} + {showModal && ( // Conditional rendering of modal based on the number of providers + fhirDataCollection && fhirDataCollection.length === 1 ? ( + + ) : ( + + ) + )} {sortedImmunizations?.map((immunizations, idx) => (
    {immunizations && immunizations.length > 0 ? ( - immunizations.map((med, mIdx) => ( - + immunizations.map((imm, mIdx) => ( + )) ) : (

    No immunization records for this provider.

    @@ -134,47 +165,43 @@ export const ImmunizationList: React.FC = (props: Immuniz ))}
    + ); +}; - ) -} +const buildRows = (imm: Immunization, theSource?: string): SummaryRowItems => { + let rows: SummaryRowItems = [ + { + isHeader: true, + twoColumns: false, + data1: imm.vaccineCode?.text ?? "No text", + data2: '', + }, + { + isHeader: false, + twoColumns: false, + data1: 'Administered on: ' + (imm.occurrenceDateTime ? displayDate(imm.occurrenceDateTime) : 'Unknown'), + data2: '', + }, + ]; -const buildRows = (med: Immunization, theSource?:string): SummaryRowItems => { - let rows: SummaryRowItems = - [ - { - isHeader: true, - twoColumns: false, - data1: med.vaccineCode?.text ?? "No text", - data2: '', - }, - { - isHeader: false, - twoColumns: false, - data1: 'Administered on: ' + (med.occurrenceDateTime ? displayDate(med.occurrenceDateTime) : 'Unknown'), - data2: '', - }, - ] - - if (med.location) { + if (imm.location) { const location: SummaryRowItem = { isHeader: false, twoColumns: false, - data1: 'Location: ' + med.location?.display, - data2: undefined - } - rows.push(location) + data1: 'Location: ' + imm.location?.display, + data2: undefined, + }; + rows.push(location); } - const notes: SummaryRowItems | undefined = med.note?.map((note) => ( - { - isHeader: false, - twoColumns: false, - data1: note.text ? 'Note: ' + note.text : '', - data2: '', - } - )) + const notes: SummaryRowItems | undefined = imm.note?.map((note) => ({ + isHeader: false, + twoColumns: false, + data1: note.text ? 'Note: ' + note.text : '', + data2: '', + })); if (notes?.length) { - rows = rows.concat(notes) + rows = rows.concat(notes); } if (theSource) { @@ -183,9 +210,9 @@ const buildRows = (med: Immunization, theSource?:string): SummaryRowItems => { twoColumns: false, data1: 'From ' + theSource, data2: '', - } - rows.push(source) + }; + rows.push(source); } -console.log("rows", rows); - return rows -} + + return rows; +}; \ No newline at end of file diff --git a/src/components/summaries/LabResultList.tsx b/src/components/summaries/LabResultList.tsx index 2a1461f..6ea4628 100644 --- a/src/components/summaries/LabResultList.tsx +++ b/src/components/summaries/LabResultList.tsx @@ -1,117 +1,122 @@ import '../../Home.css'; -import React, { useState, useEffect } from 'react'; +import React, { FC, useState, useEffect } from 'react'; import { Link } from "react-router-dom"; import { FHIRData, displayDate } from '../../data-services/models/fhirResources'; import { ObservationSummary } from '../../data-services/models/cqlSummary'; import { Summary, SummaryRowItem, SummaryRowItems } from './Summary'; import { BusySpinner } from '../busy-spinner/BusySpinner'; import { SortModal } from '../sort-modal/sortModal'; +import { SortOnlyModal } from '../sort-only-modal/sortOnlyModal'; interface LabResultListProps { fhirDataCollection?: FHIRData[], labResultSummaryMatrix?: ObservationSummary[][], } -interface LabResultListState { -} - -export const LabResultList: React.FC = (props: LabResultListProps) => { +export const LabResultList: FC = ({ fhirDataCollection, labResultSummaryMatrix }) => { process.env.REACT_APP_DEBUG_LOG === "true" && console.log("LabResultList component RENDERED!") const [showModal, setShowModal] = useState(false); const [sortingOption, setSortingOption] = useState(''); - const [filteringOption, setFilteringOption] = useState(''); + const [filteringOption, setFilteringOption] = useState([]); const [sortedAndFilteredMatrix,setSortedAndFilteredMatrix] = useState(); const [filteringOptions, setFilteringOptions] = useState<{value: string; label: string}[]>([]); - const labResMatrix: ObservationSummary[][] | undefined = props.labResultSummaryMatrix - useEffect(() => { applySortingAndFiltering(); - }, [props.labResultSummaryMatrix, sortingOption, filteringOption]); + }, [labResultSummaryMatrix, sortingOption, filteringOption]); useEffect(() => { - if (props.labResultSummaryMatrix) { + if (labResultSummaryMatrix) { generateFilteringOptions(); } - }, [props.labResultSummaryMatrix]); + }, [labResultSummaryMatrix]); const closeModal = () => { setShowModal(false); }; - const handleSortFilterSubmit = (sortOption: string, filterOption: string) => { + const handleSortFilterSubmit = (sortOption: string, filterOption?: string[]) => { setSortingOption(sortOption); - setFilteringOption(filterOption); + if(filterOption){ + setFilteringOption(filterOption); + } setShowModal(false); }; const generateFilteringOptions = () => { - if (!props.labResultSummaryMatrix) return; - - const provenanceValues: string[] = []; - - props.labResultSummaryMatrix.forEach(providerObservations => { - providerObservations.forEach(observation => { - observation.Provenance?.forEach(provenance => { - if (provenance.Transmitter) { - provenanceValues.push(provenance.Transmitter); - } - }); - }); - }); - - const uniqueProvenanceValues = Array.from(new Set(provenanceValues)); + if (!fhirDataCollection || fhirDataCollection.length === 0) { + setFilteringOptions([]); + return; + } - const options = uniqueProvenanceValues.map(value => ({ - value: value, - label: value + const uniqueServerNames = Array.from(new Set(fhirDataCollection.map(data => data.serverName))); + const options = uniqueServerNames.map(value => ({ + value: value || '', + label: value || '', })); setFilteringOptions(options); }; + const sortingOptions = [ + { value: 'alphabetical-az', label: 'Alphabetical: A-Z' }, + { value: 'alphabetical-za', label: 'Alphabetical: Z-A' }, + { value: 'newest', label: 'Date Created: Newest' }, + { value: 'oldest', label: 'Date Created: Oldest' }, + ]; + const applySortingAndFiltering = () => { - if (!props.labResultSummaryMatrix) return; - - let sortedMatrix = props.labResultSummaryMatrix; - if (sortingOption === 'alphabetical-az') { - sortedMatrix = props.labResultSummaryMatrix.map(providerObservations => - [...providerObservations].sort((a, b) => - (a.DisplayName ?? '').localeCompare(b.DisplayName ?? '') - ) - ); - } else if (sortingOption === 'alphabetical-za') { - sortedMatrix = props.labResultSummaryMatrix.map(providerObservations => - [...providerObservations].sort((a, b) => - (b.DisplayName ?? '').localeCompare(a.DisplayName ?? '') - ) - ); - } else if (sortingOption === 'newest') { - sortedMatrix = props.labResultSummaryMatrix.map(providerObservations => - [...providerObservations].sort((a, b) => - (b.Date ?? '').localeCompare(a.Date ?? '') - ) - ); - } else if (sortingOption === 'oldest') { - sortedMatrix = props.labResultSummaryMatrix.map(providerObservations => - [...providerObservations].sort((a, b) => - (a.Date ?? '').localeCompare(b.Date ?? '') - ) - ); - } + if (!labResultSummaryMatrix) return; - let filteredMatrix = sortedMatrix; - if (filteringOption) { - filteredMatrix = sortedMatrix.map(providerObservations => - providerObservations.filter(observation => - observation.Provenance?.some( - provenance => provenance.Transmitter === filteringOption - ) - ) - ); + let filteredAndSortedMatrix = [...labResultSummaryMatrix]; + + if (filteringOption.length > 0 && fhirDataCollection) { + const filteredMatrix: ObservationSummary[][] = []; + + // Iterate over the goalSummaryMatrix length and push empty arrays to filteredMatrix + for (let i = 0; i < labResultSummaryMatrix!.length; i++) { + filteredMatrix.push([]); + } + + filteringOption.forEach(option => { + // Find the index of the selected option in the filteringOptions array + const index = filteringOptions.findIndex(item => item.value === option); + // If index is found, push the corresponding entry from goalSummaryMatrix to filteredMatrix + if (index !== -1) { + filteredMatrix[index] = filteredAndSortedMatrix[index]; + } + }); + + filteredAndSortedMatrix = filteredMatrix.filter(matrix => matrix !== undefined); + } + + + switch (sortingOption) { + case 'alphabetical-az': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (a.DisplayName || '').localeCompare(b.DisplayName || '')) + ); + break; + case 'alphabetical-za': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (b.DisplayName || '').localeCompare(a.DisplayName || '')) + ); + break; + case 'newest': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (b.Date || '').localeCompare(a.Date || '')) + ); + break; + case 'oldest': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (a.Date || '').localeCompare(b.Date || '')) + ); + break; + default: + break; } - setSortedAndFilteredMatrix(filteredMatrix); + setSortedAndFilteredMatrix(filteredAndSortedMatrix); }; return ( @@ -120,29 +125,39 @@ export const LabResultList: React.FC = (props: LabResultList

    Lab Results

    - {props.fhirDataCollection === undefined + {fhirDataCollection === undefined && <>

    Reading your clinical records...

    - + } - setShowModal(true)}> - SORT/FILTER - - {showModal ? ( - - ) : null} +{fhirDataCollection && fhirDataCollection.length === 1 ? ( // Checking for single provider + setShowModal(true)}> + SORT + + ) : ( + setShowModal(true)}> + SORT/FILTER + + )} + {showModal && ( // Conditional rendering of modal based on the number of providers + fhirDataCollection && fhirDataCollection.length === 1 ? ( + + ) : ( + + ) + )} { sortedAndFilteredMatrix?.map((labResultSummary, index) => { @@ -153,12 +168,12 @@ export const LabResultList: React.FC = (props: LabResultList { labResultSummary && labResultSummary.length > 0 && labResultSummary[0]?.ConceptName === 'init' ?

    Loading...

    - : (!labResultSummary || labResultSummary.length < 1) && props.fhirDataCollection !== undefined + : (!labResultSummary || labResultSummary.length < 1) && fhirDataCollection !== undefined ?

    No records found.

    :
    {labResultSummary?.map((obs, idx) => ( - + ))}
    } diff --git a/src/components/summaries/MedicationList.tsx b/src/components/summaries/MedicationList.tsx index 1193892..bf78e03 100644 --- a/src/components/summaries/MedicationList.tsx +++ b/src/components/summaries/MedicationList.tsx @@ -1,109 +1,122 @@ import '../../Home.css'; -import React, { useState, useEffect } from 'react'; +import React, { FC, useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import { FHIRData, displayDate } from '../../data-services/models/fhirResources'; import { MedicationSummary } from '../../data-services/models/cqlSummary'; import { Summary, SummaryRowItem, SummaryRowItems } from './Summary'; import { BusySpinner } from '../busy-spinner/BusySpinner'; import { SortModal } from '../sort-modal/sortModal'; +import { SortOnlyModal } from '../sort-only-modal/sortOnlyModal'; interface MedicationListProps { fhirDataCollection?: FHIRData[], medicationSummaryMatrix?: MedicationSummary[][], } -interface MedicationListState { -} - -export const MedicationList: React.FC = (props: MedicationListProps) => { +export const MedicationList: FC = ({ fhirDataCollection, medicationSummaryMatrix }) => { process.env.REACT_APP_DEBUG_LOG === "true" && console.log("MedicationList component RENDERED!") const [showModal, setShowModal] = useState(false); const [sortingOption, setSortingOption] = useState(''); - const [filteringOption, setFilteringOption] = useState(''); + const [filteringOption, setFilteringOption] = useState([]); const [sortedAndFilteredMatrix, setSortedAndFilteredMatrix] = useState(); const [filteringOptions, setFilteringOptions] = useState<{ value: string; label: string }[]>([]); - const medSumMatrix: MedicationSummary[][] | undefined = props.medicationSummaryMatrix - - console.log("MedicationListSum",medSumMatrix); - useEffect(() => { applySortingAndFiltering(); -}, [props.medicationSummaryMatrix, sortingOption, filteringOption]); +}, [medicationSummaryMatrix, sortingOption, filteringOption]); useEffect(() => { - if (props.medicationSummaryMatrix) { + if (medicationSummaryMatrix) { generateFilteringOptions(); } -}, [props.medicationSummaryMatrix]); +}, [medicationSummaryMatrix]); const closeModal = () => { setShowModal(false); }; -const handleSortFilterSubmit = (sortOption: string, filterOption: string) => { +const handleSortFilterSubmit = (sortOption: string, filterOption?: string[]) => { setSortingOption(sortOption); - setFilteringOption(filterOption); + if(filterOption){ + setFilteringOption(filterOption); + } setShowModal(false); }; const generateFilteringOptions = () => { - if (!props.medicationSummaryMatrix) return; - - const provenanceValues: string[] = []; - - props.medicationSummaryMatrix.forEach(providerMedications => { - providerMedications.forEach(medication => { - medication.Provenance?.forEach(provenance => { - if (provenance.Transmitter) { - provenanceValues.push(provenance.Transmitter); - } - }); - }); - }); - - const uniqueProvenanceValues = Array.from(new Set(provenanceValues)); + if (!fhirDataCollection || fhirDataCollection.length === 0) { + setFilteringOptions([]); + return; + } - const options = uniqueProvenanceValues.map(value => ({ - value: value, - label: value, + const uniqueServerNames = Array.from(new Set(fhirDataCollection.map(data => data.serverName))); + const options = uniqueServerNames.map(value => ({ + value: value || '', + label: value || '', })); setFilteringOptions(options); }; +const sortingOptions = [ + { value: 'alphabetical-az', label: 'Alphabetical: A-Z' }, + { value: 'alphabetical-za', label: 'Alphabetical: Z-A' }, + { value: 'newest', label: 'Date Created: Newest' }, + { value: 'oldest', label: 'Date Created: Oldest' }, +]; + const applySortingAndFiltering = () => { - if (!props.medicationSummaryMatrix) return; - - let sortedMatrix = props.medicationSummaryMatrix; - if (sortingOption === 'alphabetical-az') { - sortedMatrix = props.medicationSummaryMatrix.map(providerMedications => - [...providerMedications].sort((a, b) => (a.ConceptName ?? '').localeCompare(b.ConceptName ?? '')) - ); - } else if (sortingOption === 'alphabetical-za') { - sortedMatrix = props.medicationSummaryMatrix.map(providerMedications => - [...providerMedications].sort((a, b) => (b.ConceptName ?? '').localeCompare(a.ConceptName ?? '')) - ); - } else if (sortingOption === 'newest') { - sortedMatrix = props.medicationSummaryMatrix.map(providerMedications => - [...providerMedications].sort((a, b) => (b.AuthoredOn ?? '').localeCompare(a.AuthoredOn ?? '')) - ); - } else if (sortingOption === 'oldest') { - sortedMatrix = props.medicationSummaryMatrix.map(providerMedications => - [...providerMedications].sort((a, b) => (a.AuthoredOn ?? '').localeCompare(b.AuthoredOn ?? '')) - ); - } + if (!medicationSummaryMatrix) return; - let filteredMatrix = sortedMatrix; - if (filteringOption) { - filteredMatrix = sortedMatrix.map(providerMedications => - providerMedications.filter(medication => - medication.Provenance?.some(provenance => provenance.Transmitter === filteringOption) - ) - ); + let filteredAndSortedMatrix = [...medicationSummaryMatrix]; + + if (filteringOption.length > 0 && fhirDataCollection) { + const filteredMatrix: MedicationSummary[][] = []; + + // Iterate over the goalSummaryMatrix length and push empty arrays to filteredMatrix + for (let i = 0; i < medicationSummaryMatrix!.length; i++) { + filteredMatrix.push([]); + } + + filteringOption.forEach(option => { + // Find the index of the selected option in the filteringOptions array + const index = filteringOptions.findIndex(item => item.value === option); + // If index is found, push the corresponding entry from goalSummaryMatrix to filteredMatrix + if (index !== -1) { + filteredMatrix[index] = filteredAndSortedMatrix[index]; + } + }); + + filteredAndSortedMatrix = filteredMatrix.filter(matrix => matrix !== undefined); + } + + + switch (sortingOption) { + case 'alphabetical-az': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (a.ConceptName || '').localeCompare(b.ConceptName || '')) + ); + break; + case 'alphabetical-za': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (b.ConceptName || '').localeCompare(a.ConceptName || '')) + ); + break; + case 'newest': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (b.AuthoredOn || '').localeCompare(a.AuthoredOn || '')) + ); + break; + case 'oldest': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (a.AuthoredOn || '').localeCompare(b.AuthoredOn || '')) + ); + break; + default: + break; } - setSortedAndFilteredMatrix(filteredMatrix); + setSortedAndFilteredMatrix(filteredAndSortedMatrix); }; return ( @@ -112,28 +125,38 @@ const applySortingAndFiltering = () => {

    Medications

    - {props.fhirDataCollection === undefined + {fhirDataCollection === undefined && <>

    Reading your clinical records...

    - + } - setShowModal(true)}> - SORT/FILTER - - {showModal ? ( - - ) : null} + {fhirDataCollection && fhirDataCollection.length === 1 ? ( // Checking for single provider + setShowModal(true)}> + SORT + + ) : ( + setShowModal(true)}> + SORT/FILTER + + )} + {showModal && ( // Conditional rendering of modal based on the number of providers + fhirDataCollection && fhirDataCollection.length === 1 ? ( + + ) : ( + + ) + )} { sortedAndFilteredMatrix?.map((medicationSummary, index) => { @@ -148,12 +171,12 @@ const applySortingAndFiltering = () => { { medicationSummary && medicationSummary.length > 0 && medicationSummary[0]?.ConceptName === 'init' ?

    Loading...

    - : (!medicationSummary || medicationSummary.length < 1) && props.fhirDataCollection !== undefined + : (!medicationSummary || medicationSummary.length < 1) && fhirDataCollection !== undefined ?

    No records found.

    :
    {medicationSummary?.map((med, idx) => ( - + ))}
    } diff --git a/src/components/summaries/ServiceRequestList.tsx b/src/components/summaries/ServiceRequestList.tsx index 5d63cce..e1fc39a 100644 --- a/src/components/summaries/ServiceRequestList.tsx +++ b/src/components/summaries/ServiceRequestList.tsx @@ -1,50 +1,75 @@ import '../../Home.css'; -import React, { useState, useEffect } from 'react'; +import React, { FC, useState, useEffect } from 'react'; import { FHIRData, displayTiming, displayConcept } from '../../data-services/models/fhirResources'; import { ServiceRequest } from '../../data-services/fhir-types/fhir-r4'; import { Summary, SummaryRowItem, SummaryRowItems } from './Summary'; import { BusySpinner } from '../busy-spinner/BusySpinner'; import { SortModal } from '../sort-modal/sortModal'; +import { SortOnlyModal } from '../sort-only-modal/sortOnlyModal'; interface ServiceRequestListProps { fhirDataCollection?: FHIRData[]; } -export const ServiceRequestList: React.FC = (props: ServiceRequestListProps) => { +export const ServiceRequestList: FC = ({fhirDataCollection}) => { process.env.REACT_APP_DEBUG_LOG === "true" && console.log("ServiceRequestList component RENDERED!"); const [sortedServiceRequests, setSortedServiceRequests] = useState([]); const [showModal, setShowModal] = useState(false); const [sortOption, setSortOption] = useState(''); - const [filterOption, setFilterOption] = useState(''); + const [filterOption, setFilterOption] = useState([]); const [filteringOptions, setFilteringOptions] = useState<{ value: string; label: string }[]>([]); const [hashMap, setHashMap] = useState>(new Map()); + console.log("fhirDataCollection", fhirDataCollection); + useEffect(() => { applySorting(); - }, [props.fhirDataCollection, sortOption, filterOption]); + }, [fhirDataCollection, sortOption, filterOption]); useEffect(() => { - if (props.fhirDataCollection) { - generateHashMap(props.fhirDataCollection); - } - }, [props.fhirDataCollection]); + generateFilteringOptions(); + }, [fhirDataCollection]); const closeModal = () => { setShowModal(false); }; - const handleSortFilterSubmit = (sortOption: string, filterOption: string) => { + const handleSortFilterSubmit = (sortOption: string, filterOption?: string[]) => { setSortOption(sortOption); - setFilterOption(filterOption); + if(filterOption){ + setFilterOption(filterOption) + } setShowModal(false); }; + const generateFilteringOptions = () => { + if (!fhirDataCollection || fhirDataCollection.length === 0) { + setFilteringOptions([]); + return; + } + + const uniqueServerNames = Array.from(new Set(fhirDataCollection.map(data => data.serverName))); + const options = uniqueServerNames.map(value => ({ + value: value || '', + label: value || '', + })); + + setFilteringOptions(options); + }; + + const sortingOptions = [ + { value: 'alphabetical-az', label: 'Alphabetical: A-Z' }, + { value: 'alphabetical-za', label: 'Alphabetical: Z-A' }, + { value: 'newest', label: 'Date Created: Newest' }, + { value: 'oldest', label: 'Date Created: Oldest' }, + ]; + const applySorting = () => { let serviceRequests: ServiceRequest[] = []; - if (props.fhirDataCollection) { - props.fhirDataCollection.forEach(data => { + if (fhirDataCollection) { + fhirDataCollection.forEach(data => { if (data.serviceRequests) { serviceRequests = serviceRequests.concat(data.serviceRequests); } @@ -81,64 +106,51 @@ export const ServiceRequestList: React.FC = (props: Ser } if (filterOption) { - sortedServiceRequests = sortedServiceRequests.filter((service) => displayConcept(service.code) === filterOption); - } + } setSortedServiceRequests(sortedServiceRequests); }; - const generateHashMap = (dataCollection: FHIRData[]) => { - const newHashMap = new Map(); - - dataCollection.forEach(data => { - if (data.serviceRequests) { - data.serviceRequests.forEach(sr => { - newHashMap.set(sr, data.serverName || ''); - }); - } - }); - - setHashMap(newHashMap); - generateFilteringOptions(newHashMap); - }; - - const generateFilteringOptions = (hashMap: Map) => { - const sourceValues: string[] = Array.from(hashMap.values()); - const uniqueSourceValues = Array.from(new Set(sourceValues)); - const options = uniqueSourceValues.map(value => ({ - value: value, - label: value - })); - setFilteringOptions(options); - }; return (

    Planned Activities

    - {props.fhirDataCollection === undefined + {fhirDataCollection === undefined && <>

    Reading your clinical records...

    - + } - setShowModal(true)}> - SORT/FILTER - - +{fhirDataCollection && fhirDataCollection.length === 1 ? ( // Checking for single provider + setShowModal(true)}> + SORT + + ) : ( + setShowModal(true)}> + SORT/FILTER + + )} + {showModal && ( // Conditional rendering of modal based on the number of providers + fhirDataCollection && fhirDataCollection.length === 1 ? ( + + ) : ( + + ) + )} {sortedServiceRequests.length > 0 ? ( sortedServiceRequests.map((service, idx) => ( diff --git a/src/components/summaries/VitalsList.tsx b/src/components/summaries/VitalsList.tsx index a15734b..fa5aba0 100644 --- a/src/components/summaries/VitalsList.tsx +++ b/src/components/summaries/VitalsList.tsx @@ -1,116 +1,121 @@ import '../../Home.css'; -import React, { useState, useEffect } from 'react'; +import React, { FC, useState, useEffect } from 'react'; import { FHIRData, displayDate } from '../../data-services/models/fhirResources'; import { ObservationSummary } from '../../data-services/models/cqlSummary'; import { Summary, SummaryRowItem, SummaryRowItems } from './Summary'; import { BusySpinner } from '../busy-spinner/BusySpinner'; import { SortModal } from '../sort-modal/sortModal'; +import { SortOnlyModal } from '../sort-only-modal/sortOnlyModal'; interface VitalsListProps { fhirDataCollection?: FHIRData[], vitalSignSummaryMatrix?: ObservationSummary[][], } -interface VitalsListState { -} - -export const VitalsList: React.FC = (props: VitalsListProps) => { +export const VitalsList: FC = ({ fhirDataCollection, vitalSignSummaryMatrix }) => { process.env.REACT_APP_DEBUG_LOG === "true" && console.log("VitalsList component RENDERED!") const [showModal, setShowModal] = useState(false); const [sortingOption, setSortingOption] = useState(''); - const [filteringOption, setFilteringOption] = useState(''); + const [filteringOption, setFilteringOption] = useState([]); const [sortedAndFilteredMatrix,setSortedAndFilteredMatrix] = useState(); const [filteringOptions, setFilteringOptions] = useState<{value: string;label: string}[]>([]); - - const vitSignSumMatrix: ObservationSummary[][] | undefined = props.vitalSignSummaryMatrix useEffect(() => { applySortingAndFiltering(); - }, [props.vitalSignSummaryMatrix, sortingOption, filteringOption]); + }, [vitalSignSummaryMatrix, sortingOption, filteringOption]); useEffect(() => { - if (props.vitalSignSummaryMatrix) { + if (vitalSignSummaryMatrix) { generateFilteringOptions(); } - }, [props.vitalSignSummaryMatrix]); + }, [vitalSignSummaryMatrix]); const closeModal = () => { setShowModal(false); }; - const handleSortFilterSubmit = (sortOption: string, filterOption: string) => { + const handleSortFilterSubmit = (sortOption: string, filterOption?: string[]) => { setSortingOption(sortOption); - setFilteringOption(filterOption); + if(filterOption){ + setFilteringOption(filterOption); + } setShowModal(false); }; const generateFilteringOptions = () => { - if (!props.vitalSignSummaryMatrix) return; - - const provenanceValues: string[] = []; - - props.vitalSignSummaryMatrix.forEach(providerObservations => { - providerObservations.forEach(observation => { - observation.Provenance?.forEach(provenance => { - if (provenance.Transmitter) { - provenanceValues.push(provenance.Transmitter); - } - }); - }); - }); - - const uniqueProvenanceValues = Array.from(new Set(provenanceValues)); + if (!fhirDataCollection || fhirDataCollection.length === 0) { + setFilteringOptions([]); + return; + } - const options = uniqueProvenanceValues.map(value => ({ - value: value, - label: value + const uniqueServerNames = Array.from(new Set(fhirDataCollection.map(data => data.serverName))); + const options = uniqueServerNames.map(value => ({ + value: value || '', + label: value || '', })); setFilteringOptions(options); }; + const sortingOptions = [ + { value: 'alphabetical-az', label: 'Alphabetical: A-Z' }, + { value: 'alphabetical-za', label: 'Alphabetical: Z-A' }, + { value: 'newest', label: 'Date Created: Newest' }, + { value: 'oldest', label: 'Date Created: Oldest' }, + ]; + const applySortingAndFiltering = () => { - if (!props.vitalSignSummaryMatrix) return; - - let sortedMatrix = props.vitalSignSummaryMatrix; - if (sortingOption === 'alphabetical-az') { - sortedMatrix = props.vitalSignSummaryMatrix.map(providerObservations => - [...providerObservations].sort((a, b) => - (a.DisplayName ?? '').localeCompare(b.DisplayName ?? '') - ) - ); - } else if (sortingOption === 'alphabetical-za') { - sortedMatrix = props.vitalSignSummaryMatrix.map(providerObservations => - [...providerObservations].sort((a, b) => - (b.DisplayName ?? '').localeCompare(a.DisplayName ?? '') - ) - ); - } else if (sortingOption === 'newest') { - sortedMatrix = props.vitalSignSummaryMatrix.map(providerObservations => - [...providerObservations].sort((a, b) => - (b.Date ?? '').localeCompare(a.Date ?? '') - ) - ); - } else if (sortingOption === 'oldest') { - sortedMatrix = props.vitalSignSummaryMatrix.map(providerObservations => - [...providerObservations].sort((a, b) => - (a.Date ?? '').localeCompare(b.Date ?? '') - ) - ); + if (!vitalSignSummaryMatrix) return; + + let filteredAndSortedMatrix = [...vitalSignSummaryMatrix]; + + if (filteringOption.length > 0 && fhirDataCollection) { + const filteredMatrix: ObservationSummary[][] = []; + + // Iterate over the goalSummaryMatrix length and push empty arrays to filteredMatrix + for (let i = 0; i < vitalSignSummaryMatrix!.length; i++) { + filteredMatrix.push([]); + } + + filteringOption.forEach(option => { + // Find the index of the selected option in the filteringOptions array + const index = filteringOptions.findIndex(item => item.value === option); + // If index is found, push the corresponding entry from goalSummaryMatrix to filteredMatrix + if (index !== -1) { + filteredMatrix[index] = filteredAndSortedMatrix[index]; + } + }); + + filteredAndSortedMatrix = filteredMatrix.filter(matrix => matrix !== undefined); } + - let filteredMatrix = sortedMatrix; - if (filteringOption) { - filteredMatrix = sortedMatrix.map(providerObservations => - providerObservations.filter(observation => - observation.Provenance?.some( - provenance => provenance.Transmitter === filteringOption - ) - ) - ); + switch (sortingOption) { + case 'alphabetical-az': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (a.DisplayName || '').localeCompare(b.DisplayName || '')) + ); + break; + case 'alphabetical-za': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (b.DisplayName || '').localeCompare(a.DisplayName || '')) + ); + break; + case 'newest': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (b.Date || '').localeCompare(a.Date || '')) + ); + break; + case 'oldest': + filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => + providerGoals.sort((a, b) => (a.Date || '').localeCompare(b.Date || '')) + ); + break; + default: + break; } - setSortedAndFilteredMatrix(filteredMatrix); + setSortedAndFilteredMatrix(filteredAndSortedMatrix); }; return ( @@ -119,29 +124,39 @@ export const VitalsList: React.FC = (props: VitalsListProps) =>

    Vitals

    - {props.fhirDataCollection === undefined + {fhirDataCollection === undefined && <>

    Reading your clinical records...

    - + } - setShowModal(true)}> - SORT/FILTER - - {showModal ? ( - - ) : null} +{fhirDataCollection && fhirDataCollection.length === 1 ? ( // Checking for single provider + setShowModal(true)}> + SORT + + ) : ( + setShowModal(true)}> + SORT/FILTER + + )} + {showModal && ( // Conditional rendering of modal based on the number of providers + fhirDataCollection && fhirDataCollection.length === 1 ? ( + + ) : ( + + ) + )} { sortedAndFilteredMatrix?.map((vitalSignSummary, index) => { @@ -152,12 +167,12 @@ export const VitalsList: React.FC = (props: VitalsListProps) => { vitalSignSummary && vitalSignSummary.length > 0 && vitalSignSummary[0]?.ConceptName === 'init' ?

    Loading...

    - : (!vitalSignSummary || vitalSignSummary.length < 1) && props.fhirDataCollection !== undefined + : (!vitalSignSummary || vitalSignSummary.length < 1) && fhirDataCollection !== undefined ?

    No records found.

    :
    {vitalSignSummary?.map((obs, idx) => ( - + ))}
    } From aa30ebcede69b6a5e15e762e389053daee457440 Mon Sep 17 00:00:00 2001 From: Sai Kiran Reddy Konda Date: Tue, 7 May 2024 10:53:23 -0400 Subject: [PATCH 5/7] changed concept name to CommonName --- src/components/summaries/ConditionList.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/summaries/ConditionList.tsx b/src/components/summaries/ConditionList.tsx index fb883ec..d947aed 100644 --- a/src/components/summaries/ConditionList.tsx +++ b/src/components/summaries/ConditionList.tsx @@ -87,20 +87,19 @@ export const ConditionList: FC = ({ fhirDataCollection, cond filteredMatrix[index] = filteredAndSortedMatrix[index]; } }); - + filteredAndSortedMatrix = filteredMatrix.filter(matrix => matrix !== undefined); } - switch (sortingOption) { case 'alphabetical-az': filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => - providerGoals.sort((a, b) => (a.CommonName || '').localeCompare(b.CommonName || '')) + providerGoals.sort((a, b) => (a.ConceptName || '').localeCompare(b.ConceptName || '')) ); break; case 'alphabetical-za': filteredAndSortedMatrix = filteredAndSortedMatrix.map(providerGoals => - providerGoals.sort((a, b) => (b.CommonName || '').localeCompare(a.CommonName || '')) + providerGoals.sort((a, b) => (b.ConceptName || '').localeCompare(a.ConceptName || '')) ); break; case 'newest': From 4e941dff8f40f0413e665c91820a3fd78fbbb1f0 Mon Sep 17 00:00:00 2001 From: Sai Kiran Reddy Konda Date: Thu, 9 May 2024 10:35:14 -0400 Subject: [PATCH 6/7] added logic to maintain the state of the logout page and passed into timer modal so it wont showup when the logout page is on the screen --- .../session-timeout/SessionTimeoutHandler.tsx | 1 + .../session-timeout/SessionTimeoutModal.tsx | 13 +++++++++- .../session-timeout/SessionTimeoutPage.tsx | 26 ++++++++++++------- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/components/session-timeout/SessionTimeoutHandler.tsx b/src/components/session-timeout/SessionTimeoutHandler.tsx index f289986..16bf9f1 100644 --- a/src/components/session-timeout/SessionTimeoutHandler.tsx +++ b/src/components/session-timeout/SessionTimeoutHandler.tsx @@ -105,6 +105,7 @@ const SessionTimeOutHandler = (props: SessionTimeOutHandlerProps) => { showModal={showModal} handleContinue={handleContinueSession} handleLogout={handleLogout} + isLoggedOut={isLogout} />
    ) diff --git a/src/components/session-timeout/SessionTimeoutModal.tsx b/src/components/session-timeout/SessionTimeoutModal.tsx index 3043a0f..254b729 100644 --- a/src/components/session-timeout/SessionTimeoutModal.tsx +++ b/src/components/session-timeout/SessionTimeoutModal.tsx @@ -6,6 +6,7 @@ interface SessionTimeOutModalProps { showModal: boolean; handleContinue: () => void; handleLogout: () => void; + isLoggedOut: boolean; } const millisToMinutesAndSeconds = (millis: number) => { @@ -14,7 +15,7 @@ const millisToMinutesAndSeconds = (millis: number) => { return minutes + " minutes " + (seconds < 10 ? '0' : '') + seconds + " seconds"; } -const SessionTimeOutModal = ({ showModal, handleContinue, handleLogout }: SessionTimeOutModalProps) => { +const SessionTimeOutModal = ({ showModal, handleContinue, handleLogout, isLoggedOut }: SessionTimeOutModalProps) => { const countDown = React.useMemo(() => { return +(process.env.REACT_APP_CLIENT_IDLE_TIMEOUT_COUNTDOWN ?? 5000) }, []); @@ -55,6 +56,16 @@ const SessionTimeOutModal = ({ showModal, handleContinue, handleLogout }: Sessio handleContinue(); } + useEffect(() => { + if (isLoggedOut) { + handleLogout(); + } + }, [isLoggedOut, handleLogout]); + + if (isLoggedOut) { + return null; + } + return ( diff --git a/src/components/session-timeout/SessionTimeoutPage.tsx b/src/components/session-timeout/SessionTimeoutPage.tsx index fd2c815..983b69a 100644 --- a/src/components/session-timeout/SessionTimeoutPage.tsx +++ b/src/components/session-timeout/SessionTimeoutPage.tsx @@ -3,13 +3,21 @@ import './SessionTimeoutPage.css'; import { faSignOutAlt } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; - -export const SessionTimeoutPage = (props: any) => { - return
    -
    -

    -

    You have been logged out

    -

    Please login again to resume use of MyCarePlanner

    -
    -
    +interface SessionTimeoutPageProps { + isLoggedOut: boolean; } + +export const SessionTimeoutPage = ({ isLoggedOut }: SessionTimeoutPageProps) => { + if (isLoggedOut) { + return ( +
    +
    +

    +

    You have been logged out

    +

    Please login again to resume use of MyCarePlanner

    +
    +
    + ); + } + return null; +}; \ No newline at end of file From eb465f4786c64e2f81aa7681a894a50bca04950d Mon Sep 17 00:00:00 2001 From: Sean <> Date: Thu, 9 May 2024 14:31:56 -0400 Subject: [PATCH 7/7] Updates to home modifed language around additional provider logins --- src/Home.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Home.tsx b/src/Home.tsx index 7e60beb..fb06d24 100644 --- a/src/Home.tsx +++ b/src/Home.tsx @@ -184,8 +184,8 @@ export default class Home extends React.Component {

    -

    Shared Health Records
    - Retrieve records from additional healthcare providers +
    Add a health record account
    + Login to additional healthcare provider accounts