The result set has been filtered to show items relevant to the selected CCDS type.
+
diff --git a/src/app/components/resources/resources-table/resources-table.component.ts b/src/app/components/resources/resources-table/resources-table.component.ts
index 0c8e3ae..66162c5 100644
--- a/src/app/components/resources/resources-table/resources-table.component.ts
+++ b/src/app/components/resources/resources-table/resources-table.component.ts
@@ -18,11 +18,16 @@ export class ResourcesTableComponent implements OnInit {
*/
@Input() resourceType: string;
+ /**
+ * Note to display
+ */
+ @Input() note: string;
+
/**
* variable to hold the environment.showCCDSResourceMenuInstead value.
*/
- isCCDSResourceMenuEnabled: boolean
+ isCCDSResourceMenuEnabled: boolean;
constructor() { }
diff --git a/src/app/data/ccds-resource-filters.ts b/src/app/data/ccds-resource-filters.ts
new file mode 100644
index 0000000..a2d3d41
--- /dev/null
+++ b/src/app/data/ccds-resource-filters.ts
@@ -0,0 +1,134 @@
+import { _getOptionScrollPosition } from '@angular/material';
+import { ResourceFilter } from '../models/ccds-resource-filter';
+
+export class ProblemFilter implements ResourceFilter {
+ static filterOptions = [
+ {
+ System: 'http://hl7.org/fhir/condition-category',
+ Code: 'problem-list-item',
+ },
+ ];
+
+ FilterNote = 'The result set has been filtered to show items relevant to the selected CCDS type.
'
+ + 'Filter used: http://hl7.org/fhir/condition-category|problem-list-item';
+
+ Filter(singleResourceEntry: any): boolean {
+ let found = false;
+ ProblemFilter.filterOptions.forEach(filter => {
+ if (singleResourceEntry.resource.category.some((categoryEntry: any) => {
+ return (
+ categoryEntry.coding[0].system.toLowerCase() === filter.System &&
+ categoryEntry.coding[0].code.toLowerCase() === filter.Code
+ );
+ })) {
+ found = true;
+ return true;
+ }
+ });
+ return found;
+ }
+}
+
+export class HealthConcernFilter implements ResourceFilter {
+ static filterOptions = [
+ {
+ System: 'http://hl7.org/fhir/us/core/codesystem/condition-category',
+ Code: 'health-concern',
+ },
+ ];
+
+ FilterNote = 'The result set has been filtered to show items relevant to the selected CCDS type.
'
+ + 'Filter used: http://hl7.org/fhir/us/core/codesystem/condition-category|health-concern';
+
+ Filter(singleResourceEntry: any): boolean {
+ let found = false;
+ HealthConcernFilter.filterOptions.forEach(filter => {
+ if (singleResourceEntry.resource.category.some((categoryEntry: any) => {
+ return (
+ categoryEntry.coding[0].system.toLowerCase() === filter.System &&
+ categoryEntry.coding[0].code.toLowerCase() === filter.Code
+ );
+ })) {
+ found = true;
+ return true;
+ }
+ });
+ return found;
+ }
+}
+
+export class MedicationAllergyFilter implements ResourceFilter {
+ static filterOptions = [
+ {
+ Category: 'medication'
+ },
+ {
+ Url: 'allergentype',
+ Value: 'med'
+ },
+ ];
+
+ static urlAllergy = 'https://fhir.chbase.com/fhir/stu3/structureddefinition/allergy';
+
+ FilterNote = 'The result set has been filtered to show items relevant to the selected CCDS type.
'
+ + 'Filter used: category = "medication" or allergentype = "med"';
+
+ Filter(singleResourceEntry: any): boolean {
+ let found = false;
+ MedicationAllergyFilter.filterOptions.forEach(filter => {
+ if (filter.Category) {
+ if (singleResourceEntry.resource.category &&
+ singleResourceEntry.resource.category.includes(filter.Category)) {
+ found = true;
+ return;
+ }
+ }
+ if (filter.Url) {
+ if (singleResourceEntry.resource.extension.some((extension: any) => {
+ return (
+ extension.url.toLowerCase() === MedicationAllergyFilter.urlAllergy &&
+ extension.extension &&
+ extension.extension.some((ext: any) => {
+ return (
+ ext.url.toLowerCase() === filter.Url &&
+ ext.valueString.toLowerCase() === filter.Value
+ );
+ })
+ );
+ })) {
+ found = true;
+ return;
+ }
+ }
+ });
+ return found;
+ }
+}
+
+export class EncounterDiagnosisFilter implements ResourceFilter {
+ static filterOptions = [
+ {
+ System: 'http://hl7.org/fhir/condition-category',
+ Code: 'encounter-diagnosis',
+ },
+ ];
+
+ FilterNote = 'The result set has been filtered to show items relevant to the selected CCDS type.
'
+ + 'Filter used: http://hl7.org/fhir/condition-category|encounter-diagnosis';
+
+ Filter(singleResourceEntry: any): boolean {
+ let found = false;
+ EncounterDiagnosisFilter.filterOptions.forEach(filter => {
+ if (singleResourceEntry.resource.category.some((categoryEntry: any) => {
+ return (
+ categoryEntry.coding[0].system.toLowerCase() === filter.System &&
+ categoryEntry.coding[0].code.toLowerCase() === filter.Code
+ );
+ })) {
+ found = true;
+ return true;
+ }
+ });
+ return found;
+ }
+}
\ No newline at end of file
diff --git a/src/app/data/ccds-resources.ts b/src/app/data/ccds-resources.ts
index bfb28b7..7a2ced4 100644
--- a/src/app/data/ccds-resources.ts
+++ b/src/app/data/ccds-resources.ts
@@ -1,185 +1,115 @@
-import { CCDSResourceMapping } from "../models/ccds-resource";
+import { CCDSResourceMapping } from '../models/ccds-resource';
+import { EncounterDiagnosisFilter, HealthConcernFilter, MedicationAllergyFilter, ProblemFilter } from './ccds-resource-filters';
export const CCDS_RESOURCE_MAPPING: CCDSResourceMapping[] = [
{
- CCDSType : "Patient Name",
- FhirResource : "Patient",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Patient Name',
+ FhirResource: 'Patient',
+ SearchQueryParameters: {},
},
{
- CCDSType : "Sex",
- FhirResource : "Patient",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
- },{
- CCDSType : "Date of Birth",
- FhirResource : "Patient",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Sex',
+ FhirResource: 'Patient',
+ SearchQueryParameters: {},
+ }, {
+ CCDSType: 'Date of Birth',
+ FhirResource: 'Patient',
+ SearchQueryParameters: {},
},
{
- CCDSType : "Race",
- FhirResource : "Patient",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Race',
+ FhirResource: 'Patient',
+ SearchQueryParameters: {},
},
{
- CCDSType : "Ethnicity",
- FhirResource : "Patient",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Ethnicity',
+ FhirResource: 'Patient',
+ SearchQueryParameters: {},
},
{
- CCDSType : "Preferred language",
- FhirResource : "Patient",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Preferred language',
+ FhirResource: 'Patient',
+ SearchQueryParameters: {},
},
{
- CCDSType : "Smoking Status",
- FhirResource : "Observation",
- SearchQueryParameters : {"code" : "http://loinc.org|72166-2"},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Smoking Status',
+ FhirResource: 'Observation',
+ SearchQueryParameters: { 'code': 'http://loinc.org|72166-2' },
},
{
- CCDSType : "Problems",
- FhirResource : "Condition",
- SearchQueryParameters : {},
- SearchSetFilter : problemFilter
+ CCDSType: 'Problems',
+ FhirResource: 'Condition',
+ SearchQueryParameters: {},
+ SearchSetFilter: new ProblemFilter()
},
{
- CCDSType : "Medications",
- FhirResource : "MedicationStatement",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Medications',
+ FhirResource: 'MedicationStatement',
+ SearchQueryParameters: {},
},
{
- CCDSType : "Medication Allergies",
- FhirResource : "AllergyIntolerance",
- SearchQueryParameters : {},
- SearchSetFilter : medicationAllergyFilter
+ CCDSType: 'Medication Allergies',
+ FhirResource: 'AllergyIntolerance',
+ SearchQueryParameters: {},
+ SearchSetFilter: new MedicationAllergyFilter()
},
{
- CCDSType : "Lab Tests",
- FhirResource : "DiagnosticReport",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Lab Tests',
+ FhirResource: 'DiagnosticReport',
+ SearchQueryParameters: {},
},
{
- CCDSType : "Lab Values/Results",
- FhirResource : "DiagnosticReport",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Lab Values/Results',
+ FhirResource: 'DiagnosticReport',
+ SearchQueryParameters: {},
},
{
- CCDSType : "Vital Signs",
- FhirResource : "Observation",
- SearchQueryParameters : {
- "code" : "http://loinc.org|85353-1,http://loinc.org|8867-4,http://loinc.org|8302-2,http://loinc.org|8306-3,http://loinc.org|29463-7,http://loinc.org|85354-9,http://loinc.org|8480-6,http://loinc.org|8462-4"},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Vital Signs',
+ FhirResource: 'Observation',
+ SearchQueryParameters: {
+ 'code': 'http://loinc.org|85353-1,http://loinc.org|8867-4,http://loinc.org|8302-2,http://loinc.org|8306-3,http://loinc.org|29463-7,http://loinc.org|85354-9,http://loinc.org|8480-6,http://loinc.org|8462-4,http://loinc.org|59408-5'
+ },
},
{
- CCDSType : "Procedures",
- FhirResource : "Procedure",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Procedures',
+ FhirResource: 'Procedure',
+ SearchQueryParameters: {},
},
{
- CCDSType : "Care team Members",
- FhirResource : "CareTeam",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Care team Members',
+ FhirResource: 'CareTeam',
+ SearchQueryParameters: {},
},
{
- CCDSType : "Immunizations",
- FhirResource : "Immunization",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Immunizations',
+ FhirResource: 'Immunization',
+ SearchQueryParameters: {},
},
{
- CCDSType : "Unique Device Identifiers",
- FhirResource : "Device",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Unique Device Identifiers',
+ FhirResource: 'Device',
+ SearchQueryParameters: {},
},
{
- CCDSType : "Assessment and Plan of Treatment",
- FhirResource : "CarePlan",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Assessment and Plan of Treatment',
+ FhirResource: 'CarePlan',
+ SearchQueryParameters: {},
},
{
- CCDSType : "Goals",
- FhirResource : "Goal",
- SearchQueryParameters : {},
- SearchSetFilter : defaultFilter
+ CCDSType: 'Goals',
+ FhirResource: 'Goal',
+ SearchQueryParameters: {},
},
{
- CCDSType : "Health Concerns",
- FhirResource : "Condition",
- SearchQueryParameters : {},
- SearchSetFilter : healthConcernFilter
- }
-]
-
-function defaultFilter(singleResourceEntry: any): boolean {
- return true;
- }
-
-function medicationAllergyFilter(singleResourceEntry: any): boolean {
- if (!singleResourceEntry.resource.extension.some((extension: any) => {
- return (extension.url.toLowerCase() === "https://fhir.chbase.com/fhir/stu3/structureddefinition/allergy" &&
- extension.extension[0].url.toLowerCase() === "allergentype" &&
- extension.extension[0].valueString.toLowerCase() === "med");
- }))
- {
- return false;
+ CCDSType: 'Health Concerns',
+ FhirResource: 'Condition',
+ SearchQueryParameters: {},
+ SearchSetFilter: new HealthConcernFilter()
+ },
+ {
+ CCDSType: 'Encounter Diagnosis',
+ FhirResource: 'Condition',
+ SearchQueryParameters: {},
+ SearchSetFilter: new EncounterDiagnosisFilter()
}
- return true;
-}
-
-function problemFilter(singleResourceEntry: any): boolean {
- // "category": [
- // {
- // "coding": [
- // {
- // "system": "http://hl7.org/fhir/condition-clinical",
- // "code": "problem",
- // "display": "Problem"
- // }
- // ]
- // }
- // ],
- if (!singleResourceEntry.resource.category.some((categoryEntry: any) => {
- return (categoryEntry.coding[0].system.toLowerCase() === "http://hl7.org/fhir/condition-clinical" &&
- categoryEntry.coding[0].code.toLowerCase() === "problem" );
- }))
- {
- return false;
- }
- return true;
-}
-
-
-function healthConcernFilter(singleResourceEntry: any): boolean {
- // "category": [
- // {
- // "coding": [
- // {
- // "system": "http://hl7.org/fhir/us/core/CodeSystem/condition-category",
- // "code": "health-concern",
- // "display": "Health Concern"
- // }
- // ]
- // }
- // ],
- if (!singleResourceEntry.resource.category.some((categoryEntry: any) => {
- return (categoryEntry.coding[0].system.toLowerCase() === "http://hl7.org/fhir/us/core/codesystem/condition-category" &&
- categoryEntry.coding[0].code.toLowerCase() === "health-concern" );
- }))
- {
- return false;
- }
- return true;
-}
\ No newline at end of file
+];
diff --git a/src/app/data/generate-ccda-settings.ts b/src/app/data/generate-ccda-settings.ts
new file mode 100644
index 0000000..56ed025
--- /dev/null
+++ b/src/app/data/generate-ccda-settings.ts
@@ -0,0 +1,5 @@
+export const GENERATE_CCDA_SETTINGS = {
+ Endpoint: '$generate-ccda',
+ SearchQueryParameters: { 'start': '01-05-2020', 'end': '10-09-2020', 'appid': 'd04d3191-8923-4fd3-8c25-e671b73c95fb' },
+ DownloadFileName: 'ClinicalDocument.xml'
+};
diff --git a/src/app/models/ccds-resource-filter.ts b/src/app/models/ccds-resource-filter.ts
new file mode 100644
index 0000000..558ad78
--- /dev/null
+++ b/src/app/models/ccds-resource-filter.ts
@@ -0,0 +1,7 @@
+export interface ResourceFilter {
+
+ FilterNote?: string;
+
+ Filter(singleResourceEntry: any): boolean;
+
+}
diff --git a/src/app/models/ccds-resource.ts b/src/app/models/ccds-resource.ts
index f3f1c3a..484752b 100644
--- a/src/app/models/ccds-resource.ts
+++ b/src/app/models/ccds-resource.ts
@@ -1,3 +1,5 @@
+import { ResourceFilter } from './ccds-resource-filter';
+
/**
* Object to hold mapping between a CCDS datatype and the equivalent FHIR resource
*/
@@ -6,7 +8,7 @@ export interface CCDSResourceMapping {
* Name of the CCDS datatype.
*/
CCDSType: string;
-
+
/**
* FHIR Resource this CCDSType maps to.
*/
@@ -20,6 +22,6 @@ export interface CCDSResourceMapping {
/**
* If query parameters are not possbile, add filters that need to be applied to resource responses.
*/
- SearchSetFilter(singleResourceEntry: any): boolean;
+ SearchSetFilter?: ResourceFilter;
-}
\ No newline at end of file
+}