How Can we Help?
The rules engine is a general utility for rendering qwik components or HTML structures based on a set of JSON rules evaluated against a context object. The component itself is very generic, so individual implementations of it are dependent on router components that are specific to the use case.
The context object is the data that the rules engine evaluates against. It should contain all the data needed to render the components. In the example on this page, the context object contains a clinician object, and a department object.
Rules are JSON objects that contain a match object and a display object. The match object is evaluated against the context that is passed to the component router. If the match object evaluates to true, the display object is returned and rendered by JsonTree. Display objects specify either a component (mapped to the component library) or an HTML structure to render. Display objects can also contain attributes that are spread onto the component. This is how we handle passing props to the matched component. This implies that any props needed by the matched component must exist in the context object, and if we wish to pass something from the context to an attribute, you must specify an object path as the attribute value. Finally, display objects can have a position property, in the case that a template has multiple instances of the component router. This allows us to only render the matched component in the correct position.
Routers should accept the specific use-case's context object and act as a type safety layer, as the inputs of the engine are generic by default. Routers should also import the rules and components they need to render and should handle any additional render logic or data formatting that is specific to the use case.
A router's component library is simply an object where each key/value pair is a component name and the component itself. This allows for the dynamic rendering of components based on the rules engine's output.
Rulesets are arrays of rules that are evaluated in order. The first rule that matches the context is the one that is rendered, this allows for the prioritization of rules. Rulesets should be ordered by most specific to least specific.
It's important to note that the rules engine child component rendering does not support qwik slots due to how they are rendered by the framework. To work around this, the value of the component in the component library should be a wrapper component that includes all necessary slots. The example below demonstrates this with the various configurations of the offer tile.
Context:
{
"clinicianData": {
"agesSeen": [
"Geriatrics",
"Adults"
],
"badges": [
"Gender: Male",
"Languages: English",
"Specialties: Orthopedic Surgery"
],
"bio": "<div>Zahidul I. Chowdhury, MD., earned his medical degree from Ross University School of Medicine in 2013. He completed his Family Medicine residency at the Medical Center at Columbus Regional Health in 2016. He received his undergraduate degree in Molecular and Microbiology from the University of Central Florida. Prior to joining Piedmont Physicians, Dr. Chowdhury was in practice at Family Practice Center in Columbus, Georgia for three years. Dr. Chowdhury is board certified in Family Medicine and is a member of the American Academy of Family Physicians. His medical interests include caring for seniors and the management of chronic diseases like high blood pressure, high cholesterol, diabetes, obesity, etc. Dr. Chowdhury welcomes new patients and accepts most insurance plans, including Medicare. In his spare time, Dr. Chowdhury enjoys spending time with his family.</div>",
"brandRefs": [
{
"brand": {
"brandName": "University Health",
"brandNameShort": "uh"
},
"isPrimary": true,
"url": "https://www.universityhealth.com/provider/Jane+Scot+Doe/389345"
}
],
"careTeam": [
{
"agesSeen": [
"Geriatrics",
"Adults"
],
"badges": [
"Gender: Male",
"Languages: English",
"Specialties: Orthopedic Surgery"
],
"bio": "<div>Zahidul I. Chowdhury, MD., earned his medical degree from Ross University School of Medicine in 2013. He completed his Family Medicine residency at the Medical Center at Columbus Regional Health in 2016. He received his undergraduate degree in Molecular and Microbiology from the University of Central Florida. Prior to joining Piedmont Physicians, Dr. Chowdhury was in practice at Family Practice Center in Columbus, Georgia for three years. Dr. Chowdhury is board certified in Family Medicine and is a member of the American Academy of Family Physicians. His medical interests include caring for seniors and the management of chronic diseases like high blood pressure, high cholesterol, diabetes, obesity, etc. Dr. Chowdhury welcomes new patients and accepts most insurance plans, including Medicare. In his spare time, Dr. Chowdhury enjoys spending time with his family.</div>",
"brandRefs": [
{
"brand": {
"brandName": "University Health",
"brandNameShort": "uh"
},
"isPrimary": true,
"url": "https://www.universityhealth.com/provider/Jane+Scot+Doe/389345"
}
],
"certifications": [
"American Board of Emergency Medicine"
],
"conditionsTreated": [
"Cold and Flu",
"COVID-19",
"Ear Infections"
],
"credentials": [
"MD"
],
"education": [
{
"fieldOfStudy": "Master of Science in Nursing",
"gradYear": 2003,
"name": "Uniformed Services University of the Health Sciences",
"position": "Medical School"
}
],
"emrIdentifiers": [
{
"emrId": "129878",
"emrIdType": "EXTERNAL",
"emrSystemId": "universityhealth.epic"
}
],
"gender": "Male",
"hospitalAffiliations": [
"University Health"
],
"id": "129878",
"imageUrl": "https://cdn-images.kyruus.com/providermatch/piedmont/photos/200/chowdhury-zahidul-1023458890.jpg",
"insurances": [
{
"isNewPatientEnabled": false,
"isReturningPatientEnabled": true,
"name": "Aetna"
}
],
"isAcceptingNewPatients": true,
"isAffiliate": true,
"isBookableOnline": true,
"isBookablePhone": true,
"isBookableVirtual": true,
"isNewPatientEnabled": true,
"isReturningPatientEnabled": true,
"languages": [
"English",
"Klingon"
],
"medicalInterests": [
"learning disabilities",
"abdominal migraine",
"lateral epicondylitis"
],
"name": {
"first": "Andrea",
"last": "Ford",
"middles": [
"Price"
],
"prefix": "Prof.",
"suffix": "IV"
},
"networks": [
"University Health",
"Employed"
],
"npi": "1023458890",
"pageDescription": "Dr. Yassmeen Abdel-Aty is an Otolaryngologist Head and Neck Surgeon who received additional training in the treatment of voice, airway, and swallowing disorders. She is currently practicing at the University Health General Hospital and is on faculty there.",
"pageTitle": "Zahidul Islam Chowdhury, MD - Seattle, WA",
"resultType": "clinician",
"reviews": [
{
"commentDistribution": [
{
"rating": 1,
"count": 3,
"percentage": 1.132
},
{
"rating": 2,
"count": 9,
"percentage": 3.396
},
{
"rating": 3,
"count": 10,
"percentage": 3.774
},
{
"rating": 4,
"count": 18,
"percentage": 6.792
},
{
"rating": 5,
"count": 225,
"percentage": 84.91
}
],
"commentCount": 235,
"comments": [
{
"rating": 5,
"comment": "Excellent provider",
"reviewTimestamp": "2024-01-23T07:00:00-05:00",
"reviewSourceId": "medallia",
"reviewSourceDisplayName": "Medallia",
"reviewSourceIcon": "https://cdn.ratings.md/c/brands/20x20/medallia.png"
},
{
"rating": 5,
"comment": "Very kind and detailed. I can tell Dr. Chowdhury care about his patients and love to educate patients about possible concerns.",
"reviewTimestamp": "2024-01-18T07:00:00-05:00",
"reviewSourceId": "medallia",
"reviewSourceDisplayName": "Medallia",
"reviewSourceIcon": "https://cdn.ratings.md/c/brands/20x20/medallia.png"
},
{
"rating": 5,
"comment": "Rockstar!!! He is consistently just the best with my health assessment and the management of my health care.",
"reviewTimestamp": "2024-01-18T07:00:00-05:00",
"reviewSourceId": "medallia",
"reviewSourceDisplayName": "Medallia",
"reviewSourceIcon": "https://cdn.ratings.md/c/brands/20x20/medallia.png"
},
{
"rating": 5,
"comment": "Went through all of the proper vitals, details, and checks. Gave recommendations. Reviewed the past year and changes.",
"reviewTimestamp": "2024-01-03T07:00:00-05:00",
"reviewSourceId": "medallia",
"reviewSourceDisplayName": "Medallia",
"reviewSourceIcon": "https://cdn.ratings.md/c/brands/20x20/medallia.png"
},
{
"rating": 5,
"comment": "Great guy and very knowledgeable",
"reviewTimestamp": "2024-01-03T07:00:00-05:00",
"reviewSourceId": "medallia",
"reviewSourceDisplayName": "Medallia",
"reviewSourceIcon": "https://cdn.ratings.md/c/brands/20x20/medallia.png"
}
],
"rating": 4.8,
"ratingCount": 2089,
"ratingDistribution": [
{
"rating": 1,
"count": 31,
"percentage": 1.694
},
{
"rating": 2,
"count": 24,
"percentage": 1.311
},
{
"rating": 3,
"count": 36,
"percentage": 1.967
},
{
"rating": 4,
"count": 188,
"percentage": 10.27
},
{
"rating": 5,
"count": 1551,
"percentage": 84.75
}
]
}
],
"specialties": [
{
"name": "Family Medicine"
}
],
"subSpecialties": [
{
"name": "Family Medicine"
}
],
"videoUrl": "https://www.universityhealth.com/videos/Jane+Scot+Doe/389345"
}
],
"careTeamIds": [
{
"emrId": "129878",
"emrIdType": "EXTERNAL",
"emrSystemId": "universityhealth.epic"
}
],
"certifications": [
"American Board of Emergency Medicine"
],
"conditionsTreated": [
"Cold and Flu",
"COVID-19",
"Ear Infections"
],
"credentials": [
"MD"
],
"dateOfBirth": "01/01/1970",
"departmentIds": [
{
"emrId": "129878",
"emrIdType": "EXTERNAL",
"emrSystemId": "universityhealth.epic"
}
],
"departmentPrimaryId": {
"emrId": "129878",
"emrIdType": "EXTERNAL",
"emrSystemId": "universityhealth.epic"
},
"departments": [
{
"accreditations": "<a href=\"https://www.intersocietal.org/vascular/\" class=\"link\"><img style=\"height: 175px; width: 175px;\" src=\"https://www.universityhealth.com/UHealth/media/Images/Awards%20and%20Logos/Wisconsin/vascular-testing-accredited-facility.jpg?ext=.jpg\"></a>",
"address": {
"addressLine1": "822 Industrial Boulevard",
"addressLine2": "Suite 100",
"city": "Ellijay",
"country": "US",
"county": "Gilmer County",
"latitude": 33.79267,
"longitude": -84.39556,
"postalCode": "30540",
"state": "GA"
},
"badges": [
"Gender: Male",
"Languages: English",
"Specialties: Orthopedic Surgery"
],
"banner": "<div>marketing banner for this page</div>",
"brandName": "University Health",
"brandRefs": [
{
"brand": {
"brandName": "University Health",
"brandNameShort": "uh"
},
"isPrimary": true,
"url": "https://www.universityhealth.com/Locations/urgent-care-teasley-denton"
}
],
"businessLine": {
"name": "University Health - Same Day Urgent Care"
},
"businessUnit": {
"name": "University Health"
},
"conditionsTreated": [
"Cold and Flu",
"COVID-19",
"Ear Infections"
],
"description": "<h2>Ear, Nose and Throat (ENT) Care in Seattle</h2>\r\n\r\n<p>Located in Seattle, WA, University Physicians ENT Seattle is a specialty practice dedicated to helping you get better - and stay well.</p>",
"dexcareBuildsPage": true,
"displayName": "University Health Urgent Care Summerhill",
"distance": 2.925616929429825,
"emrIdentifier": {
"emrId": "10582001",
"emrIdType": "EXTERNAL",
"emrSystemId": "universityhealth.epic"
},
"fax": "404-477-1176",
"googlePlaceUrl": "https://www.google.com/maps/place/University+Health+Medical+Group/@42.9202749,-89.2107675,17z/data=!.....",
"hours": {
"custom": "Closed on Christmas",
"fri": {
"close": "19:00",
"custom": "Closed from 12-12:30 for lunch.",
"open": "07:00",
"open24Hours": false
},
"mon": {
"close": "19:00",
"custom": "Closed from 12-12:30 for lunch.",
"open": "07:00",
"open24Hours": false
},
"sat": {
"close": "19:00",
"custom": "Closed from 12-12:30 for lunch.",
"open": "07:00",
"open24Hours": false
},
"sun": {
"close": "19:00",
"custom": "Closed from 12-12:30 for lunch.",
"open": "07:00",
"open24Hours": false
},
"thu": {
"close": "19:00",
"custom": "Closed from 12-12:30 for lunch.",
"open": "07:00",
"open24Hours": false
},
"tue": {
"close": "19:00",
"custom": "Closed from 12-12:30 for lunch.",
"open": "07:00",
"open24Hours": false
},
"wed": {
"close": "19:00",
"custom": "Closed from 12-12:30 for lunch.",
"open": "07:00",
"open24Hours": false
}
},
"id": "129878",
"imageUrl": "https://cdn-images.kyruus.com/providermatch/piedmont/photos/200/chowdhury-zahidul-1023458890.jpg",
"insurances": [
{
"name": "Aetna",
"isNewPatientEnabled": true,
"isReturningPatientEnabled": false
}
],
"isAcceptingNewPatients": true,
"isBookableOnline": true,
"isBookablePhone": true,
"isBookableVirtual": true,
"isNewPatientEnabled": true,
"isReturningPatientEnabled": true,
"pageDescription": "Ear, Nose and Throat (ENT) Clinic in Seattle. ENT is a specialty practice dedicated to helping you get better and stay well",
"pageTitle": "Ear, Nose and Throat (ENT) Clinic in Seattle",
"phone": {
"phoneNumber": "806-675-7382"
},
"policies": [
{
"name": "Over-the-Counter (OTC) Medication Prescription Request Form",
"url": "https://www.universityhealth.com/UHealth/media/Documents/Locations/Non-Hospital/otc-medication-prescription-form.pdf"
}
],
"resultType": "department",
"services": [
{
"name": "Optometry",
"url": "https://www.universityhealth.com/services/eye-care/optometry"
}
],
"specialties": [
{
"name": "Family Medicine"
}
],
"timezone": "America/Los_Angeles",
"url": "https://www.universityhealth.com/Locations/urgent-care-teasley-denton",
"urlName": "PiedmontOrthopedicsOrthoAtlantaPiedmontWest",
"visitTypes": [
{
"dateRangeLookAhead": 90,
"dateRangeStartBuffer": 2,
"description": "This visit type is for patients who have had a visit with this clinician in the past 3 years.",
"displayName": "Illness / Minor Injury",
"emrIdentifier": {
"emrId": "129878",
"emrIdType": "EXTERNAL",
"emrSystemId": "universityhealth.epic"
},
"id": "5692b762-3289-496e-9784-55943c6ccb5f",
"isBookableOnline": true,
"isEstablishedPatient": true,
"isNewPatient": true,
"maxAge": 130,
"minAge": 18,
"modality": "VIDEO",
"urlName": "NewPatient"
}
],
"walkInsWelcome": true
}
],
"education": [
{
"fieldOfStudy": "Master of Science in Nursing",
"gradYear": 2003,
"name": "Uniformed Services University of the Health Sciences",
"position": "Medical School"
},
{
"gradYear": 2023,
"name": "Eastern Washington University",
"position": "Medical School"
}
],
"emrIdentifiers": [
{
"emrId": "129878",
"emrIdType": "EXTERNAL",
"emrSystemId": "universityhealth.epic"
}
],
"gender": "Male",
"hospitalAffiliations": [
"University Health"
],
"id": "129878",
"imageUrl": "https://cdn-images.kyruus.com/providermatch/piedmont/photos/200/chowdhury-zahidul-1023458890.jpg",
"insurances": [
{
"isNewPatientEnabled": false,
"isReturningPatientEnabled": true,
"name": "Aetna"
}
],
"isAcceptingNewPatients": true,
"isActive": false,
"isAffiliate": true,
"isBookableOnline": true,
"isBookablePhone": true,
"isBookableVirtual": true,
"isDeleted": true,
"isNewPatientEnabled": true,
"isReturningPatientEnabled": true,
"languages": [
"English",
"Klingon"
],
"medicalInterests": [
"learning disabilities",
"abdominal migraine",
"lateral epicondylitis"
],
"name": {
"first": "Andrea",
"last": "Ford",
"middles": [
"Price"
],
"prefix": "Prof.",
"suffix": "IV"
},
"networks": [
"University Health",
"Employed"
],
"npi": "1023458890",
"pageDescription": "Dr. Yassmeen Abdel-Aty is an Otolaryngologist Head and Neck Surgeon who received additional training in the treatment of voice, airway, and swallowing disorders. She is currently practicing at the University Health General Hospital and is on faculty there.",
"pageTitle": "Zahidul Islam Chowdhury, MD - Seattle, WA",
"resultType": "clinician",
"reviews": [
{
"commentDistribution": [
{
"rating": 1,
"count": 3,
"percentage": 1.132
},
{
"rating": 2,
"count": 9,
"percentage": 3.396
},
{
"rating": 3,
"count": 10,
"percentage": 3.774
},
{
"rating": 4,
"count": 18,
"percentage": 6.792
},
{
"rating": 5,
"count": 225,
"percentage": 84.91
}
],
"commentCount": 235,
"comments": [
{
"rating": 5,
"comment": "Excellent provider",
"reviewTimestamp": "2024-01-23T07:00:00-05:00",
"reviewSourceId": "medallia",
"reviewSourceDisplayName": "Medallia",
"reviewSourceIcon": "https://cdn.ratings.md/c/brands/20x20/medallia.png"
},
{
"rating": 5,
"comment": "Very kind and detailed. I can tell Dr. Chowdhury care about his patients and love to educate patients about possible concerns.",
"reviewTimestamp": "2024-01-18T07:00:00-05:00",
"reviewSourceId": "medallia",
"reviewSourceDisplayName": "Medallia",
"reviewSourceIcon": "https://cdn.ratings.md/c/brands/20x20/medallia.png"
},
{
"rating": 5,
"comment": "Rockstar!!! He is consistently just the best with my health assessment and the management of my health care.",
"reviewTimestamp": "2024-01-18T07:00:00-05:00",
"reviewSourceId": "medallia",
"reviewSourceDisplayName": "Medallia",
"reviewSourceIcon": "https://cdn.ratings.md/c/brands/20x20/medallia.png"
},
{
"rating": 5,
"comment": "Went through all of the proper vitals, details, and checks. Gave recommendations. Reviewed the past year and changes.",
"reviewTimestamp": "2024-01-03T07:00:00-05:00",
"reviewSourceId": "medallia",
"reviewSourceDisplayName": "Medallia",
"reviewSourceIcon": "https://cdn.ratings.md/c/brands/20x20/medallia.png"
},
{
"rating": 5,
"comment": "Great guy and very knowledgeable",
"reviewTimestamp": "2024-01-03T07:00:00-05:00",
"reviewSourceId": "medallia",
"reviewSourceDisplayName": "Medallia",
"reviewSourceIcon": "https://cdn.ratings.md/c/brands/20x20/medallia.png"
}
],
"rating": 4.8,
"ratingCount": 2089,
"ratingDistribution": [
{
"rating": 1,
"count": 31,
"percentage": 1.694
},
{
"rating": 2,
"count": 24,
"percentage": 1.311
},
{
"rating": 3,
"count": 36,
"percentage": 1.967
},
{
"rating": 4,
"count": 188,
"percentage": 10.27
},
{
"rating": 5,
"count": 1551,
"percentage": 84.75
}
]
}
],
"specialties": [
{
"name": "Family Medicine"
}
],
"subSpecialties": [
{
"name": "Family Medicine"
}
],
"tier": 1,
"videoUrl": "https://www.universityhealth.com/videos/Jane+Scot+Doe/389345",
"specialty": {
"name": "obstetrics"
}
},
"departmentData": {
"accreditations": "<a href=\"https://www.intersocietal.org/vascular/\" class=\"link\"><img style=\"height: 175px; width: 175px;\" src=\"https://www.universityhealth.com/UHealth/media/Images/Awards%20and%20Logos/Wisconsin/vascular-testing-accredited-facility.jpg?ext=.jpg\"></a>",
"address": {
"addressLine1": "822 Industrial Boulevard",
"addressLine2": "Suite 100",
"city": "Ellijay",
"country": "US",
"county": "Gilmer County",
"latitude": 33.79267,
"longitude": -84.39556,
"postalCode": "30540",
"state": "GA"
},
"badges": [
"Gender: Male",
"Languages: English",
"Specialties: Orthopedic Surgery"
],
"banner": "<div>marketing banner for this page</div>",
"brandName": "University Health",
"brandRefs": [
{
"brand": {
"brandName": "University Health",
"brandNameShort": "uh"
},
"isPrimary": true,
"url": "https://www.universityhealth.com/Locations/urgent-care-teasley-denton"
}
],
"businessLine": {
"name": "University Health - Same Day Urgent Care"
},
"businessUnit": {
"name": "University Health"
},
"conditionsTreated": [
"Cold and Flu",
"COVID-19",
"Ear Infections"
],
"description": "<h2>Ear, Nose and Throat (ENT) Care in Seattle</h2>\r\n\r\n<p>Located in Seattle, WA, University Physicians ENT Seattle is a specialty practice dedicated to helping you get better - and stay well.</p>",
"dexcareBuildsPage": true,
"displayName": "University Health Urgent Care Summerhill",
"distance": 2.925616929429825,
"emrIdentifier": {
"emrId": "10582001",
"emrIdType": "EXTERNAL",
"emrSystemId": "universityhealth.epic"
},
"fax": "404-477-1176",
"googlePlaceUrl": "https://www.google.com/maps/place/University+Health+Medical+Group/@42.9202749,-89.2107675,17z/data=!.....",
"hours": {
"custom": "Closed on Christmas",
"fri": {
"close": "19:00",
"custom": "Closed from 12-12:30 for lunch.",
"open": "07:00",
"open24Hours": false
},
"mon": {
"close": "19:00",
"custom": "Closed from 12-12:30 for lunch.",
"open": "07:00",
"open24Hours": false
},
"sat": {
"close": "19:00",
"custom": "Closed from 12-12:30 for lunch.",
"open": "07:00",
"open24Hours": false
},
"sun": {
"close": "19:00",
"custom": "Closed from 12-12:30 for lunch.",
"open": "07:00",
"open24Hours": false
},
"thu": {
"close": "19:00",
"custom": "Closed from 12-12:30 for lunch.",
"open": "07:00",
"open24Hours": false
},
"tue": {
"close": "19:00",
"custom": "Closed from 12-12:30 for lunch.",
"open": "07:00",
"open24Hours": false
},
"wed": {
"close": "19:00",
"custom": "Closed from 12-12:30 for lunch.",
"open": "07:00",
"open24Hours": false
}
},
"id": "129878",
"imageUrl": "https://cdn-images.kyruus.com/providermatch/piedmont/photos/200/chowdhury-zahidul-1023458890.jpg",
"insurances": [
{
"name": "Aetna",
"isNewPatientEnabled": true,
"isReturningPatientEnabled": false
}
],
"isAcceptingNewPatients": true,
"isBookableOnline": true,
"isBookablePhone": true,
"isBookableVirtual": true,
"isNewPatientEnabled": true,
"isReturningPatientEnabled": true,
"pageDescription": "Ear, Nose and Throat (ENT) Clinic in Seattle. ENT is a specialty practice dedicated to helping you get better and stay well",
"pageTitle": "Ear, Nose and Throat (ENT) Clinic in Seattle",
"phone": {
"phoneNumber": "806-675-7382"
},
"policies": [
{
"name": "Over-the-Counter (OTC) Medication Prescription Request Form",
"url": "https://www.universityhealth.com/UHealth/media/Documents/Locations/Non-Hospital/otc-medication-prescription-form.pdf"
}
],
"resultType": "department",
"services": [
{
"name": "Optometry",
"url": "https://www.universityhealth.com/services/eye-care/optometry"
}
],
"specialties": [
{
"name": "Family Medicine"
}
],
"timezone": "America/Los_Angeles",
"url": "https://www.universityhealth.com/Locations/urgent-care-teasley-denton",
"urlName": "PiedmontOrthopedicsOrthoAtlantaPiedmontWest",
"visitTypes": [
{
"dateRangeLookAhead": 90,
"dateRangeStartBuffer": 2,
"description": "This visit type is for patients who have had a visit with this clinician in the past 3 years.",
"displayName": "Illness / Minor Injury",
"emrIdentifier": {
"emrId": "129878",
"emrIdType": "EXTERNAL",
"emrSystemId": "universityhealth.epic"
},
"id": "5692b762-3289-496e-9784-55943c6ccb5f",
"isBookableOnline": true,
"isEstablishedPatient": true,
"isNewPatient": true,
"maxAge": 130,
"minAge": 18,
"modality": "VIDEO",
"urlName": "NewPatient"
}
],
"walkInsWelcome": true
}
}For COVID-19 symptoms/testing, fever, cough, colds, UTI, allergies and more.
Self-pay or Insurance
500 Internal Server Error