API Guardians

See API Specification

Anyone using the API should also become very familiar with our schema documentation which contains important details about individual database table columns.
See Guardian Database Schema.

Guardians GET (single)

Version Added: 25.4.15

Gets a single guardian.

Parameters:

GuardianNum: Required in URL.

Example Request:
GET /guardians/1

Example Response:
{
"GuardianNum": 1,
"PatNumChild": 23,
"PatNumGuardian": 18,
"Relationship": "Father",
"IsGuardian": "true"
}

200 OK
404 NotFound (with explanation)

Guardians GET (multiple)

Version Added: 25.4.15

Gets a list of guardians.

Parameters:

PatNumChild: (Optional) FK to patient.PatNum. If Relationship is "Mother", then this PatNum is the child of the mother.
PatNumGuardian: (Optional) FK to patient.PatNum. If Relationship is "Mother", then this is the PatNum of the mother.

Example Request:
GET /guardians
GET /guardians?PatNumChild=23
GET /guardians?PatNumGuardian=18
GET /guardians?PatNumChild=23&PatNumGuardian=18

Example Response:
[
{
"GuardianNum": 1,
"PatNumChild": 23,
"PatNumGuardian": 18,
"Relationship": "Father",
"IsGuardian": "true"
},
{
"GuardianNum": 2,
"PatNumChild": 23,
"PatNumGuardian": 19,
"Relationship": "Mother",
"IsGuardian": "true"
},
{
"GuardianNum": 3,
"PatNumChild": 23,
"PatNumGuardian": 21,
"Relationship": "Sister",
"IsGuardian": "false"
},
etc...
]

200 OK
400 BadRequest (with explanation)
404 NotFound (with explanation)

Guardians POST (create)

Version Added: 25.4.17

Creates a guardian for a patient.

PatNumChild: Required. FK to patient.PatNum. If Relationship is "Mother", then this PatNum is the child of the mother.
PatNumGuardian: Required. FK to patient.PatNum. If Relationship is "Mother", then this is the PatNum of the mother.
Relationship: Required. Either "Mother", "Stepfather", "Stepmother", "Grandfather", "Grandmother", "Father", "Brother", "CareGiver", "FosterChild", "Guardian", "Grandparent", "Other", "Parent", "Stepchild", "Self", "Sibling", "Sister", "Spouse", "Child", "LifePartner", "Friend", "Grandchild", or "Sitter".

IsGuardian: Optional. Set "true" if this relationship is a guardian. When true, grants patient portal PHI access to the patient specified by PatNumChild. Default "false".

Example Request:
POST /guardians

{
"PatNumChild": 12,
"PatNumGuardian": 11,
"Relationship": "Friend",
"IsGuardian": "false"
}

Example Response:
{
"GuardianNum": 7,
"PatNumChild": 12,
"PatNumGuardian": 11,
"Relationship": "Friend",
"IsGuardian": "false"
}

201 Created
400 BadRequest (with explanation)
404 NotFound (with explanation)

Guardians PUT (update)

Version Added: 25.4.17

Updates a guardian.

GuardianNum: Required in the URL.

Relationship: Optional. Either "Mother", "Stepfather", "Stepmother", "Grandfather", "Grandmother", "Father", "Brother", "CareGiver", "FosterChild", "Guardian", "Grandparent", "Other", "Parent", "Stepchild", "Self", "Sibling", "Sister", "Spouse", "Child", "LifePartner", "Friend", "Grandchild", or "Sitter".
IsGuardian: Optional. Set "true" if this relationship is a guardian. When true, grants patient portal PHI access to the patient specified by PatNumChild.

Example Requests:
PUT /guardians/217

{
"Relationship": "LifePartner",
"IsGuardian": "true"
}

or

{
"IsGuardian": "false"
}

Example Response:
{
"GuardianNum": 217,
"PatNumChild": 32,
"PatNumGuardian": 41,
"Relationship": "LifePartner",
"IsGuardian": "true"
}

200 OK
400 BadRequest (with explanation)
404 NotFound (with explanation)

Guardians DELETE

Version Added: 25.4.17

Deletes a guardian associated with a patient.

GuardianNum: Required in the URL.

Example Requests:
DELETE /guardians/13

Example Responses:
200 OK
400 BadRequest (with explanation)
404 NotFound (with explanation)