-
Notifications
You must be signed in to change notification settings - Fork 5
Managing Rules
The SnapMD system uses the rules to allow or disallow certain user activities, such as patient registration or patient visibility. Rules can be added, edited, or removed.
To see your rules, you can request a list of rules stored in the system.
To use this endpoint, make a GET request to v2.1/admin/rules?providerId=***
. The "ProviderId" query string parameter is required and must be set to the provider ID. This is the same ID used as the "hospital" ID in other calls.
There are many query string parameters which can narrow the list, but if none are included, a full list is returned. The optional query string parameters include:
- ruleTemplateId (GUID): A string indicate that indicates which rule type to search. Currently only one rule type "40C8B5DD-F032-4E11-82DA-744DB8D47A00" (Subject Address Rule) is supported.
- statusCode (integer): The status of returned rules. 1 for active, 2 for deleted.
- maxRows (integer): The maximum number of rows which should be returned.
If rules in the system matching the criteria exist, an object with an array of rules will be returned in the data field.
A bearer authentication token must be provided for a user that has permission to view availability blocks for the provider.
This rule means "Allow patients to register if they meet certain criteria." The following example demonstrates requesting the availability blocks for one specific day.
GET https://sandbox.connectedcare.md/api/v2.1/admin/rules?providerId=126&statusCode=1
Headers Sent:
- X-Developer-Id: ****
- X-Api-Key: ****
- Authorization: Bearer ****
Response Code (Success): 200 OK
{
"data": [
{
"ruleTemplate": {
"ruleSet": {
"createdDate": "2016-06-04T01:03:17.943Z",
"createdByUserId": 447,
"ruleCategoryId": 1,
"id": "2a727528-2247-4ded-8ac2-b9778a3c1219",
"description": "Patient Registration Rules",
"satisfiedMessage": "Allowed to register",
"unsatisfiedMessage": "Not allowed to register",
"statusCode": 1
},
"createdDate": "2016-06-04T01:18:58.477Z",
"createdByUserId": 447,
"ruleSetId": "2a727528-2247-4ded-8ac2-b9778a3c1219",
"ruleTypeId": 1,
"priority": 1,
"imagePath": "/images/subject_address_rule.png",
"id": "40c8b5dd-f032-4e11-82da-744db8d47a00",
"description": "Subject Address Rules",
"satisfiedMessage": "satified",
"unsatisfiedMessage": "unsatified",
"statusCode": 1
},
"version": 1,
"createdDate": "2016-06-04T07:50:32.413Z",
"createdByUserId": 447,
"subjectAddresses": [
{
"countryCode": "us",
"stateCode": "ny",
"city": "New York City"
},
{
"countryCode": "us",
"stateCode": "ny",
"city": "Buffalo"
}
],
"ruleTemplateId": "40c8b5dd-f032-4e11-82da-744db8d47a00",
"providerId": 126,
"conditionTypeId": 1,
"conditionSource": 1,
"sequence": 1,
"id": "31480ca6-c7f9-4330-8c5c-68097a368805",
"description": "Somewhere in NY state.",
"satisfiedMessage": "Welcome to NY",
"unsatisfiedMessage": "Bye Bye!",
"statusCode": 1
},
{
"ruleTemplate": {
"ruleSet": {
"createdDate": "2016-06-04T01:03:17.943Z",
"createdByUserId": 447,
"ruleCategoryId": 1,
"id": "2a727528-2247-4ded-8ac2-b9778a3c1219",
"description": "Patient Registration Rules",
"satisfiedMessage": "Allowed to register",
"unsatisfiedMessage": "Not allowed to register",
"statusCode": 1
},
"createdDate": "2016-06-04T01:18:58.477Z",
"createdByUserId": 447,
"ruleSetId": "2a727528-2247-4ded-8ac2-b9778a3c1219",
"ruleTypeId": 1,
"priority": 1,
"imagePath": "/images/subject_address_rule.png",
"id": "40c8b5dd-f032-4e11-82da-744db8d47a00",
"description": "Subject Address Rules",
"satisfiedMessage": "satified",
"unsatisfiedMessage": "unsatified",
"statusCode": 1
},
"version": 1,
"createdDate": "2016-06-04T06:03:13.69Z",
"createdByUserId": 447,
"subjectAddresses": [
{
"countryCode": "us",
"stateCode": "ca",
"city": "los angeles",
"postalCode": "90001"
},
{
"countryCode": "us",
"stateCode": "ca",
"city": "los angeles",
"postalCode": "90002"
},
{
"countryCode": "us",
"stateCode": "ca",
"city": "beverly hills"
},
{
"countryCode": "us",
"stateCode": "ca",
"postalCode": "90210"
},
{
"countryCode": "us",
"stateCode": "ca",
"city": "santa monica",
"postalCode": "90401"
},
{
"countryCode": "us",
"stateCode": "ca",
"city": "santa monica",
"postalCode": "90402"
}
],
"ruleTemplateId": "40c8b5dd-f032-4e11-82da-744db8d47a00",
"providerId": 126,
"conditionTypeId": 1,
"conditionSource": 1,
"sequence": 1,
"id": "f17db548-a552-47b1-b19a-1fc52911a472",
"description": "Somewhere in greater LA area.",
"satisfiedMessage": "Welcome to LA",
"unsatisfiedMessage": "Bye Bye!",
"statusCode": 1
}
],
"message": "2/2",
"total": 2
}